Skip to content

feat: adding tls capability on epicurou #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
js
.idea
10 changes: 10 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JS-REDIS-1255645:
- '*':
reason: 'High Severity - https://contentstack.atlassian.net/browse/IS-1224'
expires: 2025-06-15T05:52:48.301Z
created: 2025-05-15T05:52:48.306Z
patch: {}
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ fileignoreconfig:
- filename: .github/workflows/secrets-scan.yml
ignore_detectors:
- filecontent
- filename: package-lock.json
checksum: 8dae940d01a846b804a410f9c59b8b173866342950ec0e75026640326bdb8b8c
version: "1.0"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 ABX
Copyright (c) 2018-2025 ABX

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
25 changes: 25 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Security
Contentstack takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.

If you believe you have found a security vulnerability in any Contentstack-owned repository, please report it to us as described below.

Reporting Security Issues
Please do not report security vulnerabilities through public GitHub issues.

Send email to [email protected].

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
Full paths of source file(s) related to the manifestation of the issue
The location of the affected source code (tag/branch/commit or direct URL)
Any special configuration required to reproduce the issue
Step-by-step instructions to reproduce the issue
Proof-of-concept or exploit code (if possible)
Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.

https://www.contentstack.com/trust/
3 changes: 3 additions & 0 deletions js/config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare const config: {
requestValidityPeriod: number;
};
6 changes: 6 additions & 0 deletions js/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/config.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions js/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { RedisClient } from 'redis';
import { EpicurusRedisConfig, serverCallback, subscribeCallback } from './interface';
export default function Epicurus(redisConfig?: EpicurusRedisConfig, requestTimeout?: number): EpicurusPublicInterface;
export declare type EpicurusPublicInterface = {
getRedisClient: () => RedisClient;
getRedisSubClient: () => RedisClient;
subscribe: <T = any>(channel: string, callback: subscribeCallback<T>) => Promise<void>;
publish: (channel: string, body: any) => void;
server: <T = any, S = any>(channel: string, callback: serverCallback<T, S>) => Promise<void>;
request: <T = any>(channel: string, body: any) => Promise<T>;
shutdown: () => void;
close: () => void;
};
40 changes: 40 additions & 0 deletions js/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/integration/client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
22 changes: 22 additions & 0 deletions js/integration/client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/integration/client.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/integration/server.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
15 changes: 15 additions & 0 deletions js/integration/server.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/integration/server.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions js/interface.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export declare type serverCallback<T, S> = (body: T & {
channel: string;
}, responseCallback: (error: any, response?: S) => any) => any;
export declare type subscribeCallback<T> = (body: T & {
channel: string;
}) => any;
export interface EpicurusPubSubCallbackReference {
[channel: string]: Function[];
}
export interface EpicurusRequest {
reqId: string;
body: any;
ttl: number;
}
export interface EpicurusResponse {
error?: any;
result?: any;
}
export interface EpicurusRedisConfig {
host: string;
port: number;
}
3 changes: 3 additions & 0 deletions js/interface.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/interface.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions js/lib/error.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export declare class EpicurusError extends Error {
id: number;
context: {};
status: {};
severity: number;
constructor(message: string, meta: {
context?: {};
args?: any;
requestReference?: any;
severity: number;
status?: number;
id?: number;
stack?: string;
name?: string;
});
toString(): string;
}
18 changes: 18 additions & 0 deletions js/lib/error.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/lib/error.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions js/lib/pub_sub/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { subscribeCallback } from '../../interface';
export declare function subscribe<T>(subClient: any, channel: string, callback: subscribeCallback<T>): Promise<void>;
export declare function publish(redisClient: any, channel: string, body: any): void;
export declare function setupSubscriptionListener(subClient: any): void;
export declare function shutdownSubscribers(): void;
export declare function removeCallbacks(): void;
50 changes: 50 additions & 0 deletions js/lib/pub_sub/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js/lib/pub_sub/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions js/lib/request_response/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { serverCallback } from '../../interface';
export declare function request<T>(redisClient: any, channel: string, body: any, requestValidityPeriod: number): Promise<T>;
export declare function server<T, S>(redisClient: any, channel: string, callback: serverCallback<T, S>, serverValidityPeriod: number): Promise<void>;
export declare function disableServers(): void;
export declare function enableServers(): void;
export declare function closeAllClients(): void;
Loading
Loading