-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
[Fix] Key Expiry Default Duration #22956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,6 +98,7 @@ export function KeyEditView({ | |
| ); | ||
| const [autoRotationEnabled, setAutoRotationEnabled] = useState<boolean>(keyData.auto_rotate || false); | ||
| const [rotationInterval, setRotationInterval] = useState<string>(keyData.rotation_interval || ""); | ||
| const [neverExpire, setNeverExpire] = useState<boolean>(!keyData.expires); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unchecking "Never Expire" without a duration silently keeps key as never-expiring
Consider adding a validation step in |
||
| const [isKeySaving, setIsKeySaving] = useState(false); | ||
| const { data: projects } = useProjects(); | ||
| const { data: uiSettingsData } = useUISettings(); | ||
|
|
@@ -265,6 +266,10 @@ export function KeyEditView({ | |
| } | ||
| // If it's already an array (shouldn't happen, but handle it), keep as is | ||
|
|
||
| if (neverExpire) { | ||
| values.duration = null; | ||
| } | ||
|
|
||
| await onSubmit(values); | ||
| } finally { | ||
| setIsKeySaving(false); | ||
|
|
@@ -660,6 +665,8 @@ export function KeyEditView({ | |
| onAutoRotationChange={setAutoRotationEnabled} | ||
| rotationInterval={rotationInterval} | ||
| onRotationIntervalChange={setRotationInterval} | ||
| neverExpire={neverExpire} | ||
| onNeverExpireChange={setNeverExpire} | ||
| /> | ||
| <Form.Item name="duration" hidden initialValue=""> | ||
| <Input /> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tooltip message is inaccurate in create mode
The tooltip was previously conditional based on
isCreateMode. Now it always says "Leave empty to keep the current expiry unchanged." However, in create mode there is no "current expiry" — leaving the field empty means "never expire". This is a UX regression for the key creation flow (used increate_key_button.tsxwithisCreateMode={true}).The
isCreateModeprop is still passed through toKeyLifecycleSettingsby callers, so it can still be used to differentiate the tooltip message.