Make API key regex pattern more flexible (support 16-128 chars with hyphens/underscores)
This commit is contained in:
1 parent
850c94dcd6
commit
b662784087
1 file changed
+2
-4
@@ -15,12 +15,10 @@ const inputSpec = InputSpec.of({
|
|||||||
default: null,
|
default: null,
|
||||||
masked: true,
|
masked: true,
|
||||||
placeholder: 'sk-...',
|
placeholder: 'sk-...',
|
||||||
// Upstream's own shape check, applied here too — the Status Page rejects a
|
// Allow standard PPQ keys and broader key lengths/characters (e.g. alphanumeric, underscores, hyphens)
|
||||||
// malformed key outright, but a key written straight to config.json would
|
|
||||||
// only surface as a 401 on the first request.
|
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
regex: '^sk-[A-Za-z0-9]{16,64}$',
|
regex: '^sk-[A-Za-z0-9_-]{16,128}$',
|
||||||
description: i18n('A PPQ.AI key starts with "sk-".'),
|
description: i18n('A PPQ.AI key starts with "sk-".'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in new issue
Block a user