-
-
Notifications
You must be signed in to change notification settings - Fork 972
Allow creating API keys with an expiration date #4681
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
Allow creating API keys with an expiration date #4681
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4681 +/- ##
=======================================
Coverage 97.09% 97.09%
=======================================
Files 392 392
Lines 8273 8275 +2
=======================================
+ Hits 8033 8035 +2
Misses 240 240 ☔ View full report in Codecov by Sentry. |
050c66b to
56c4397
Compare
martinemde
left a comment
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.
Looking good so far.
264b4ba to
4275747
Compare
4275747 to
5159c36
Compare
Will be used for CLI workflow to add trusted publishing to a gem, since we dont want the resulting API key that can manage trusted publishing to be long-lived
5159c36 to
de23d50
Compare
| <%= form_with model: [:profile, @api_key], data: { controller: "exclusive-checkbox gem-scope" } do |f| %> | ||
| <%= label_tag :name, t("api_keys.index.name"), class: "form__label" %> | ||
| <%= f.text_field :name, class: "form__input", autocomplete: :off %> | ||
| <%= f.text_field :name, class: "form__input", autocomplete: :off, disabled: f.object.persisted? %> |
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.
Is name "readonly" once created? Is that enforced also on server side somehow?
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.
yes, enforced in the controllers and there are tests for that
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.
Looking again, it seems covered by controller. Is that enough? What about model validation?
Will be used for CLI workflow to add trusted publishing to a gem, since we dont want the resulting API key that can manage trusted publishing to be long-lived