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.
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).