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

Support multiple groups for users #579

Closed
wants to merge 1 commit into from

Conversation

thomas-vogels
Copy link
Contributor

@thomas-vogels thomas-vogels commented Nov 1, 2021

Description

This PR brings us the option to configure multiple groups for each user.
This allows us to bring in the configuration of users, which we have done before on the command line.

There seem to be a lot of changes here but it's really just pushing the change of "group -> groups" through.

That said, having this PR first would help: Add "groups" and "comment" to user info #591

User-visible changes

The following commands have been updated:

  • initialize -- all users and groups from the configuration are created if requested. This now supports users being in multiple groups.
  • create_users (or its alias create_user) -- this no longer supports specifying a group or creating a schema for the user. You should specify a user's groups in the configuration file. If you need to create a schema, use update_user.
  • update_user -- this no longer supports specifying a group or creating a schema for the user. You should specify a user's groups in the configuration file. You can use this command to add a user's schema. If you have added the user's password to your .pgpass file, then the user's password will be updated.

Note that users are now created without passwords and cannot login until you run:

arthur.py update_user

In order to be backwards compatible with current configuration files, both group with a single identifier and groups with a list oof identifiers is supported to configure a user's groups.

Note that users is a list in the configuration and you cannot spread the definition of users over multiple files. The last list of users in configuration files wins.

Here's an example for user configuration.

{
    "data_warehouse": {
        "users": [
            {
                "name": "default",
                "group": "analyst"
            },
            {
                "name": "tom",
                "groups": ["analyst", "etl_ro"]
            }
        ]
    }
}

Links

Supports: Manage users access and group membership using configuration #581

Testing

You can run all commands using --dry-run to make sure that they would do what you want them to do.

@github-actions github-actions bot added documentation python Pull requests that update Python code labels Nov 1, 2021
@thomas-vogels thomas-vogels force-pushed the support-multiple-groups-for-users branch from 28c954f to 58cdcf9 Compare November 1, 2021 11:55
@thomas-vogels thomas-vogels marked this pull request as ready for review November 1, 2021 12:22
@thomas-vogels thomas-vogels added this to the v1.54.0 milestone Nov 1, 2021
@thomas-vogels thomas-vogels modified the milestones: v1.54.0, v1.55.0 Nov 5, 2021
@thomas-vogels thomas-vogels force-pushed the support-multiple-groups-for-users branch from 58cdcf9 to ee6c70d Compare November 7, 2021 14:04
@thomas-vogels thomas-vogels modified the milestones: v1.55.0, v1.56.0, v1.57.0 Nov 7, 2021
@thomas-vogels thomas-vogels force-pushed the support-multiple-groups-for-users branch from ee6c70d to 3c64b5a Compare November 14, 2021 16:36
@thomas-vogels thomas-vogels changed the base branch from next to table-design-add-user-groups November 14, 2021 16:36
@thomas-vogels thomas-vogels force-pushed the support-multiple-groups-for-users branch 2 times, most recently from ee74028 to b64eccb Compare November 15, 2021 14:08
Base automatically changed from table-design-add-user-groups to next November 23, 2021 19:31
@thomas-vogels thomas-vogels modified the milestones: v1.57.0, v1.58.0 Dec 21, 2021
@thomas-vogels thomas-vogels modified the milestones: v1.58.0, v1.59.0 Jan 12, 2022
@thomas-vogels thomas-vogels force-pushed the support-multiple-groups-for-users branch from b64eccb to 2f684e0 Compare March 8, 2022 19:52
@thomas-vogels thomas-vogels removed this from the v1.59.0 milestone Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant