Skip to content

ROX-11070: Only allow a single default group per auth provider#2296

Merged
dhaus67 merged 3 commits intomasterfrom
dh/Only_allow_a_single_default_group_per_auth_provider
Jul 5, 2022
Merged

ROX-11070: Only allow a single default group per auth provider#2296
dhaus67 merged 3 commits intomasterfrom
dh/Only_allow_a_single_default_group_per_auth_provider

Conversation

@dhaus67
Copy link
Contributor

@dhaus67 dhaus67 commented Jul 4, 2022

Description

This PR is a follow-up from the discussion here.

The issue is that, with the changes of introducing a unique identifier not based on a composite key of a group's properties, we potentially allow clients to create an arbitrary amount of default groups.

Previously, this was not possible due to the authProviderID's value being used as a key to store the group, uniquely identifying it, creating a 1:1 mapping between default group and auth provider.

This complicates things for the UI, as we would either change the current flow within the UI and allow multiple "default roles" to be assigned, as well as posing a challenge to distinguish between the different default groups.

Since this is not at all intended, we should restrict the datastore and only allow a single default group (with no key / value field set) per auth provider ID. This way, we achieve the same behavior related to default groups as
beforehand and do not add increased complexity to the front end.

Testing Performed

  • Unit tests added.

@dhaus67
Copy link
Contributor Author

dhaus67 commented Jul 4, 2022

@ghost
Copy link

ghost commented Jul 4, 2022

Tag for build #730864 is 3.70.x-571-g2c7d8d8164.

💻 For deploying this image using the dev scripts, run the following first:

export MAIN_IMAGE_TAG='3.70.x-571-g2c7d8d8164'

🕹️ A roxctl binary can be downloaded from the CircleCI artifacts.

@dhaus67 dhaus67 force-pushed the dh/06-15-Handle_ID_of_groups_within_UI branch from 666fb17 to 7db4450 Compare July 4, 2022 12:13
@dhaus67 dhaus67 force-pushed the dh/Only_allow_a_single_default_group_per_auth_provider branch from ab96951 to 7840840 Compare July 4, 2022 12:13
@dhaus67 dhaus67 requested a review from rukletsov July 4, 2022 12:13
s.ErrorIs(err, errox.AlreadyExists)

// 3. Updating the initially existing group to make it a default group should fail.
// Fetch the group by its properties.
Copy link
Member

Choose a reason for hiding this comment

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

That's an interesting styling approach : ).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Learnt it from the best 😜

Base automatically changed from dh/06-15-Handle_ID_of_groups_within_UI to master July 4, 2022 20:41
@dhaus67 dhaus67 force-pushed the dh/Only_allow_a_single_default_group_per_auth_provider branch from 14e3956 to 2c7d8d8 Compare July 4, 2022 20:52
@ghost
Copy link

ghost commented Jul 4, 2022

Images are ready for the commit at 2c7d8d8.

To use with deploy scripts, first export MAIN_IMAGE_TAG=3.70.x-572-g6c8c9543a7.

@dhaus67 dhaus67 merged commit b5de4de into master Jul 5, 2022
@dhaus67 dhaus67 deleted the dh/Only_allow_a_single_default_group_per_auth_provider branch July 5, 2022 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants