mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 11:27:32 +00:00
misc: add support for number field values
This commit is contained in:
@@ -1,9 +1,13 @@
|
|||||||
import picomatch from "picomatch";
|
import picomatch from "picomatch";
|
||||||
|
|
||||||
export const doesFieldValueMatchJwtPolicy = (fieldValue: string | boolean, policyValue: string) => {
|
export const doesFieldValueMatchJwtPolicy = (fieldValue: string | boolean | number, policyValue: string) => {
|
||||||
if (typeof fieldValue === "boolean") {
|
if (typeof fieldValue === "boolean") {
|
||||||
return fieldValue === (policyValue === "true");
|
return fieldValue === (policyValue === "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof fieldValue === "number") {
|
||||||
|
return fieldValue === parseInt(policyValue, 10);
|
||||||
|
}
|
||||||
|
|
||||||
return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue);
|
return policyValue === fieldValue || picomatch.isMatch(fieldValue, policyValue);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export const identityJwtAuthServiceFactory = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let tokenData: Record<string, string | boolean> = {};
|
let tokenData: Record<string, string | boolean | number> = {};
|
||||||
|
|
||||||
if (identityJwtAuth.configurationType === JwtConfigurationType.JWKS) {
|
if (identityJwtAuth.configurationType === JwtConfigurationType.JWKS) {
|
||||||
const decryptedJwksCaCert = orgDataKeyDecryptor({
|
const decryptedJwksCaCert = orgDataKeyDecryptor({
|
||||||
|
|||||||
Reference in New Issue
Block a user