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

add: user management on Core #210

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

st3v3nmw
Copy link
Collaborator

@st3v3nmw st3v3nmw commented Feb 5, 2024

This change allows us to list, add, and remove SSO users on Ubuntu Core systems.

Example listing on staging:
Screenshot from 2024-02-05 12-51-12

Depends on canonical/snap-http#7

@st3v3nmw st3v3nmw force-pushed the add-and-remove-users branch 5 times, most recently from ea3c37b to 730c5d7 Compare February 7, 2024 07:57
@st3v3nmw st3v3nmw marked this pull request as ready for review February 7, 2024 08:01
message["email"],
message["sudoer"],
message["force-managed"],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't love this. It's a violation of interface-dependency. I'd prefer it if we modified add_user to have a signature that can support both, even if that's just:

def add_user(self, message):

That way the differences between adding users on core and non-core is contained completely within the UserManagement class and doesn't leak up to the Manager.

Changing what message types we respond to is ok, but alternatively you could simply have the message types we do not respond to be no-ops in SnapdUserManagement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refactored:

  • fixed the interface-dependency violation for add_user & remove_user
  • added no-ops to SnapdUserManagement (ignored the function arguments to keep the linter happy)

Copy link
Contributor

@Perfect5th Perfect5th left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Perfect5th Perfect5th merged commit 15f2817 into canonical:master Feb 9, 2024
5 checks passed
@st3v3nmw st3v3nmw deleted the add-and-remove-users branch February 12, 2024 07:09
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