Skip to content
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

Teams - key-pair management #170

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Teams - key-pair management #170

merged 1 commit into from
Feb 19, 2024

Conversation

timalces
Copy link
Contributor

@timalces timalces commented Feb 2, 2024

In OpenStack, key-pairs are user specific. However, in order to authenticate their management (viewing, creating and deleting), the user must be part of an openstack project and the project_id provided.

This PR updates the key-pair logic to now look for a project id belonging to one of the user's teams, and use that for authentication. If none is found, the user is prevented from managing keypairs.

This does not require any change to the openstack service API.

Note: as key-pairs are user specific, they will persist after the user is removed from a project, or the project is deleted. This also means if they no longer have any teams, they will be unable to access any existing key-pairs (but they will be accessible if the user is once again assigned to a team).

Also, as key-pairs are not tied to a project, it does not matter if a different project_id is used to view/delete key-pairs after they have been created (e.g. if the user moves to a different team).

@@ -100,4 +97,10 @@ def destroy
def key_pair_params
params.require(:key_pair).permit(*PERMITTED_PARAMS)
end

# key pairs are user (not project) specific, but membership of a project is required
Copy link
Contributor Author

@timalces timalces Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is intended that in the future users will have a personal team created during sign up. That can then be used for the below.

@timalces timalces changed the title Use team project id for user's key-pair management Teams - key-pair management Feb 15, 2024
Copy link
Collaborator

@benarmston benarmston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not ran the code here and probably won't for #171 or #173 either. So once all of the PRs are merged to exp/teams I think it will need a final review including code run through.

That said, this looks good to me, and the idea of having a default team seems like a good idea.

@timalces timalces merged commit f73abe0 into exp/teams Feb 19, 2024
@timalces timalces deleted the teams/keypairs branch February 19, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants