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
ensure only one key is deleted if multiple with same name #862
Conversation
@@ -16,7 +16,7 @@ func Map[T any, U any](slice []T, mapFn func(T) U) []U { | |||
return result | |||
} | |||
|
|||
// Find is a generic function that searches through a list searching for all items that match | |||
// Filter is a generic function that searches through a list searching for all items that match |
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.
Oops!
d2727dc
to
9bdb251
Compare
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.
It looks like this would remove the first key rather than the one selected. I think it would make sense to either add a unique constraint on the name (so this problem doesn't exist) or swap out the identifier in the DELETE request to be a unique identifier (like we do with slugs) so that we can target them directly.
oh that's a good point - yeah I feel like the first one makes the most sense. I'll take a look |
@jrozner we're now deleting based on the unique credential ID instead of the name |
@jrozner @jkennedyvz I just added a check to ensure that the username is unique |
Ensure that if there are multiple keys with the same name, only one is deleted
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.