-
Notifications
You must be signed in to change notification settings - Fork 29
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
Cyberstorm api create/delete service account (TS-2320) #1098
Open
Roffenlund
wants to merge
6
commits into
master
Choose a base branch
from
cyberstorm-api-create-service-account
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+336
−0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
django/thunderstore/api/cyberstorm/tests/test_create_service_account.py
Outdated
Show resolved
Hide resolved
django/thunderstore/api/cyberstorm/tests/test_create_service_account.py
Outdated
Show resolved
Hide resolved
f59e764
to
7580d68
Compare
x753
reviewed
Feb 17, 2025
x753
reviewed
Feb 17, 2025
x753
reviewed
Feb 18, 2025
9e7246d
to
d1f1098
Compare
Implement a serializer for creating service accounts, and a serializer for deleting service accounts. Two of the fields in the serializer intended for creating service accounts are read-only, as they are only required in the response from the view. Refs. TS-2320
Added CreateServiceAccountAPIView and DeleteServiceAccountAPIView to manage service account creation and deletion with team-specific permission checks. Introduced TeamPermissionMixin to handle permission checks for users based on team access and actions on service accounts. Both views enforce team-based access control, ensuring users have the appropriate permissions to create or delete service accounts for the given team. Refs. TS-2320
Refs. TS-2320
Rename team_id to team_name in the kwargs for the create/delete service account endpoints. Refs. TS-2320
- Inherit DestroyAPIView in DeleteServiceAccountAPIView. - Use delete() instead of post() for deleting service accounts. - Add uuid to URL instead of sending a payload to the DELETE endpoint. - Update tests accordingly. Refs. TS-2320
d1f1098
to
a5fa14c
Compare
Add missing parameter whe calling the ServiceAccount's .create function. Error raised after rebase. Refs. TS-2320
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements the following:
CreateServiceAccountAPIView: Handles the creation of service accounts with team-specific permission checks, ensuring that only authorized users can create service accounts for a given team.
DeleteServiceAccountAPIView: Manages the deletion of service accounts, enforcing team-based permissions to ensure that only users with the right access can delete service accounts for a team.
TeamPermissionMixin: A mixin class that centralizes the logic for permission checks based on team access. It ensures that users are authorized to perform actions on service accounts for the specified team.