fix configdb (#622)

This commit is contained in:
Moritz Schneider 2025-04-11 20:37:29 -07:00 committed by GitHub
parent d242292ab6
commit 7f74b082ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -321,7 +321,7 @@ export async function getEnvironmentConfigOverride(options: EnvironmentOptions):
.sort((a, b) => stringCompare(a.id, b.id));
for (const perm of projectPermissionDefinitions) {
configOverride[`teams.projectPermissionDefinitions.${perm.id}`] = filterUndefined({
configOverride[`users.userPermissionDefinitions.${perm.id}`] = filterUndefined({
description: perm.description,
containedPermissions: typedFromEntries(perm.contained_permission_ids.map(containedPerm => [containedPerm, {}]))
});

View File

@ -33,7 +33,7 @@ export function getInvalidConfigReason(c: unknown, options: { configName?: strin
if (c === null || typeof c !== 'object') return `${configName} must be a non-null object`;
for (const [key, value] of Object.entries(c)) {
if (typeof key !== 'string') return `${configName} must have only string keys (found: ${typeof key})`;
if (!key.match(/^[a-zA-Z0-9_$][a-zA-Z_$0-9\-]*(?:\.[a-zA-Z0-9_$][a-zA-Z_$0-9\-]*)*$/)) return `All keys of ${configName} must consist of only alphanumeric characters, dots, underscores, dollar signs, or hyphens and start with a character other than a hyphen (found: ${key})`;
if (!key.match(/^[a-zA-Z0-9_:$][a-zA-Z_:$0-9\-]*(?:\.[a-zA-Z0-9_:$][a-zA-Z_:$0-9\-]*)*$/)) return `All keys of ${configName} must consist of only alphanumeric characters, dots, underscores, colons, dollar signs, or hyphens and start with a character other than a hyphen (found: ${key})`;
const entryName = `${configName}.${key}`;
const reason = getInvalidConfigValueReason(value, { valueName: entryName });