fix: prevent default profile credential collision (#1628)

* fix: prevent default profile credential collision

* fix: isolate default profile credential fallback
This commit is contained in:
Kai (Tam Nhu) Tran authored and GitHub committed 2026-07-01 01:15:45 -04:00
1 parent 20df3445d9
commit 343899f6c1
4 files changed
+124 -17

No files matched your search

+5 -1
View File
@@ -36,6 +36,7 @@ export const DEFAULT_ACCOUNT_CONTEXT_GROUP = 'default';
export const DEFAULT_ACCOUNT_CONTINUITY_MODE: AccountContinuityMode = 'standard';
export const MAX_CONTEXT_GROUP_LENGTH = 64;
export const ACCOUNT_PROFILE_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
const RESERVED_ACCOUNT_PROFILE_NAMES = new Set(['default']);
const CONTEXT_GROUP_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
@@ -57,7 +58,10 @@ export function isValidContextGroupName(value: string): boolean {
* Validate account profile naming constraints.
*/
export function isValidAccountProfileName(value: string): boolean {
return ACCOUNT_PROFILE_NAME_PATTERN.test(value);
return (
ACCOUNT_PROFILE_NAME_PATTERN.test(value) &&
!RESERVED_ACCOUNT_PROFILE_NAMES.has(value.toLowerCase())
);
}
/**