mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: rabbit rabbit changes
This commit is contained in:
@@ -244,10 +244,6 @@ export const certificateEstServiceFactory = ({
|
|||||||
|
|
||||||
const certificates = extractX509CertFromChain(caCertChain).map((cert) => new x509.X509Certificate(cert));
|
const certificates = extractX509CertFromChain(caCertChain).map((cert) => new x509.X509Certificate(cert));
|
||||||
|
|
||||||
if (!certificates) {
|
|
||||||
throw new BadRequestError({ message: "Failed to parse certificate chain" });
|
|
||||||
}
|
|
||||||
|
|
||||||
const caCertificate = new x509.X509Certificate(caCert);
|
const caCertificate = new x509.X509Certificate(caCert);
|
||||||
return convertRawCertsToPkcs7([caCertificate.rawData, ...certificates.map((cert) => cert.rawData)]);
|
return convertRawCertsToPkcs7([caCertificate.rawData, ...certificates.map((cert) => cert.rawData)]);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const isValidUserPattern = (value: string): boolean => {
|
|||||||
if (value === "*") return true; // Handle wildcard separately
|
if (value === "*") return true; // Handle wildcard separately
|
||||||
|
|
||||||
// Simpler, more specific pattern for usernames
|
// Simpler, more specific pattern for usernames
|
||||||
const userRegex = /^[a-z_][a-z0-9_-]$/;
|
const userRegex = /^[a-z_][a-z0-9_-]*$/i;
|
||||||
return userRegex.test(value);
|
return userRegex.test(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ export const createDigestAuthRequestInterceptor = (
|
|||||||
nc += 1;
|
nc += 1;
|
||||||
const nonceCount = nc.toString(16).padStart(8, "0");
|
const nonceCount = nc.toString(16).padStart(8, "0");
|
||||||
const cnonce = crypto.randomBytes(24).toString("hex");
|
const cnonce = crypto.randomBytes(24).toString("hex");
|
||||||
const realm = authDetails.find((el) => el[0].toLowerCase().indexOf("realm") > -1)?.[1].replaceAll('"', "");
|
const realm = authDetails.find((el) => el[0].toLowerCase().indexOf("realm") > -1)?.[1]?.replaceAll('"', "") || "";
|
||||||
const nonce = authDetails.find((el) => el[0].toLowerCase().indexOf("nonce") > -1)?.[1].replaceAll('"', "");
|
const nonce = authDetails.find((el) => el[0].toLowerCase().indexOf("nonce") > -1)?.[1]?.replaceAll('"', "") || "";
|
||||||
const ha1 = crypto.createHash("md5").update(`${username}:${realm}:${password}`).digest("hex");
|
const ha1 = crypto.createHash("md5").update(`${username}:${realm}:${password}`).digest("hex");
|
||||||
const path = opts.url;
|
const path = opts.url;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ describe("validate-string", () => {
|
|||||||
|
|
||||||
test("Check special characters", () => {
|
test("Check special characters", () => {
|
||||||
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Hyphen])("Hello-World")).toBeTruthy();
|
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Hyphen])("Hello-World")).toBeTruthy();
|
||||||
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Hyphen])("Hello-World")).toBeTruthy();
|
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Plus])("Hello+World")).toBeTruthy();
|
||||||
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Underscore])("Hello_World")).toBeTruthy();
|
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Underscore])("Hello_World")).toBeTruthy();
|
||||||
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Colon])("Hello:World")).toBeTruthy();
|
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Colon])("Hello:World")).toBeTruthy();
|
||||||
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Underscore])("Hello World")).toBeFalsy();
|
expect(characterValidator([CharacterType.AlphaNumeric, CharacterType.Underscore])("Hello World")).toBeFalsy();
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ export const recursivelyGetSecretPaths = ({
|
|||||||
const formatMultiValueEnv = (val?: string) => {
|
const formatMultiValueEnv = (val?: string) => {
|
||||||
if (!val) return "";
|
if (!val) return "";
|
||||||
if (!val.match("\n")) return val;
|
if (!val.match("\n")) return val;
|
||||||
return `"${val.replaceAll("/n", "\\n")}"`;
|
return `"${val.replaceAll("\n", "\\n")}"`;
|
||||||
};
|
};
|
||||||
|
|
||||||
type TInterpolateSecretArg = {
|
type TInterpolateSecretArg = {
|
||||||
|
|||||||
Reference in New Issue
Block a user