-
Notifications
You must be signed in to change notification settings - Fork 643
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
Added V5 short lived credential type and excluded it from the API key… #10322
base: dev
Are you sure you want to change the base?
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 | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -646,8 +646,13 @@ | |||||||||||||||||||||||||||||||||||
function ApiKeyListViewModel(initialData) { | ||||||||||||||||||||||||||||||||||||
var self = this; | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
// Excluding v5 | ||||||||||||||||||||||||||||||||||||
var typeToOmit = "apikey.v5"; | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
var apiKeys = $.map(initialData.ApiKeys, function (data) { | ||||||||||||||||||||||||||||||||||||
return new ApiKeyViewModel(self, initialData.PackageOwners, data); | ||||||||||||||||||||||||||||||||||||
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. This filtering is done on the client side. This could work, but I think another option that is more consistent with existing code is filtering on the server side. It looks like we already filter out the See NuGetGallery/src/NuGetGallery/Controllers/UsersController.cs Lines 1192 to 1202 in b55d335
which calls NuGetGallery/src/NuGetGallery.Core/CredentialTypes.cs Lines 86 to 91 in b55d335
|
||||||||||||||||||||||||||||||||||||
if (data.Type !== typeToOmit) { | ||||||||||||||||||||||||||||||||||||
return new ApiKeyViewModel(self, initialData.PackageOwners, data); | ||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||
var newApiKey = new ApiKeyViewModel(self, initialData.PackageOwners); | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
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.
Maybe we can call this
shortlived
for now. The V5 format using HISv2 (my draft PR I sent you) could be used for short lived or long-lived API keys in the future. Right now, we are focused on short lived which should be hidden from the UI and we can use the type string to differentiate between them.v5.longlived
could be added later and may not be excluded from the UI.