mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-21 03:50:10 +00:00
feat: added token based communications
This commit is contained in:
@@ -81,7 +81,10 @@ const envSchema = z
|
||||
SECRET_SCANNING_WEBHOOK_PROXY: zpStr(z.string().optional()),
|
||||
SECRET_SCANNING_WEBHOOK_SECRET: zpStr(z.string().optional()),
|
||||
SECRET_SCANNING_GIT_APP_ID: zpStr(z.string().optional()),
|
||||
SECRET_SCANNING_PRIVATE_KEY: zpStr(z.string().optional())
|
||||
SECRET_SCANNING_PRIVATE_KEY: zpStr(z.string().optional()),
|
||||
// LICENCE
|
||||
LICENCE_SERVER_URL: zpStr(z.string().optional()),
|
||||
LICENCE_SERVER_KEY: zpStr(z.string().optional())
|
||||
})
|
||||
.transform((data) => ({
|
||||
...data,
|
||||
|
||||
@@ -4,9 +4,9 @@ export class DatabaseError extends Error {
|
||||
|
||||
error: unknown;
|
||||
|
||||
constructor({ name, error, message }: { message?: string; name: string; error: unknown }) {
|
||||
constructor({ name, error, message }: { message?: string; name?: string; error: unknown }) {
|
||||
super(message || "Failed to execute db ops");
|
||||
this.name = name;
|
||||
this.name = name || "DatabaseError";
|
||||
this.error = error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,11 @@ export const isValidIpOrCidr = (ip: string): boolean => {
|
||||
return false;
|
||||
};
|
||||
|
||||
export type TIp = {
|
||||
ipAddress: string;
|
||||
type: IPType;
|
||||
prefix: number;
|
||||
};
|
||||
/**
|
||||
* Validates the IP address [ipAddress] against the trusted IPs [trustedIps].
|
||||
*/
|
||||
@@ -111,11 +116,7 @@ export const checkIPAgainstBlocklist = ({
|
||||
trustedIps
|
||||
}: {
|
||||
ipAddress: string;
|
||||
trustedIps: {
|
||||
ipAddress: string;
|
||||
type: IPType;
|
||||
prefix: number;
|
||||
}[];
|
||||
trustedIps: TIp[];
|
||||
}) => {
|
||||
const blockList = new net.BlockList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user