Squarespace / pgbedrock

Manage a Postgres cluster's roles, role memberships, schema ownership, and privileges
https://pgbedrock.readthedocs.io/en/latest/
Other
313 stars 35 forks source link

Ensure objects are not referenced multiple times within a spec #14

Closed johnshiver closed 6 years ago

johnshiver commented 6 years ago

A few things I am wondering about:

  1. detect_multiple_role_definitions requires a template rather than dictionary like verify_spec method. I wasnt sure where was the best place to run detect_multiple_role_definitions, I added it to load_spec since we would essentially have to do the same thing if we were to keep the two separate

  2. error string on objs referenced in read/write might be misleading. if obj with the same name is referenced in read write for multiple sections ( schema / table / sequence ) the name will simply show up multiple times in the error string Example:

    danil:
        can_login: true
        privileges:
            sequences:
                read:
                    - hoop
                write:
                    - hoop
            tables:
                read:
                    - hoop
                write:
                    - hoop

    error string will be: danil: [hoop, hoop]

Should we add more info?

Looking forward to hearing your feedback!