Skip to content

Commit

Permalink
add(secrets): relax key name (#60)
Browse files Browse the repository at this point in the history
Fixes #55.

* add(secrets): relax key name

* Update src/routes/team/[team]/(teamPages)/[env]/secret/[secret]/AddKeyValue.svelte

Co-authored-by: Trong Huu Nguyen <tronghn@users.noreply.github.com>

* Update src/routes/team/[team]/(teamPages)/[env]/secret/[secret]/AddKeyValue.svelte

Co-authored-by: Trong Huu Nguyen <tronghn@users.noreply.github.com>

* fix(secrets): can start with underscore, hyphens and periods.

---------

Co-authored-by: Trong Huu Nguyen <tronghn@users.noreply.github.com>
  • Loading branch information
ybelMekk and tronghn authored Apr 29, 2024
1 parent b533424 commit 765ee29
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
return 'Must be less than 253 characters';
}
if (/^[_a-zA-Z0-9]+$/.test(key) === false) {
return 'Can only contain letters, numbers, or _';
if (/^[-._a-zA-Z0-9]+$/.test(key) === false) {
return 'Must consist of letters, numbers, or certain special characters (underscores, hyphens, and periods)';
}
if (/^[a-zA-Z_]+/.test(key) === false) {
return 'Must start with a letter or _';
if (/^[a-zA-Z_.-]+/.test(key) === false) {
return 'Must start with a letter or one of the following special characters: (underscores, hyphens, and periods)';
}
return '';
};
Expand Down Expand Up @@ -87,7 +87,9 @@
error={validKey(key)}
>
<svelte:fragment slot="label">Key</svelte:fragment>
<svelte:fragment slot="description"><i>Example: SOME_KEY</i></svelte:fragment>
<svelte:fragment slot="description"
><i>Examples: SOME_KEY, some.key, or some-key</i></svelte:fragment
>
</TextField>
</div>
<div class="entry">
Expand Down

0 comments on commit 765ee29

Please sign in to comment.