Ouranosinc / Magpie

AuthN/AuthZ services
https://pavics-magpie.readthedocs.io
Apache License 2.0
1 stars 5 forks source link

[Feature] Provide a CLI utility to directly load a set of permissions and submit it to a remote instance #611

Closed fmigneault closed 3 months ago

fmigneault commented 3 months ago

Is your feature request related to a problem? Please describe.

Following helpers can be used to update services, default user/groups and custom users:

However, there is no equivalent for updating permissions from a configuration file using the CLI.

Describe the solution you'd like

As explored in https://github.com/Ouranosinc/Magpie/pull/610 The operations from magpie.register.magpie_register_permissions_from_config can be used from a Python script using a Permissions Configuration corresponding to the format in https://github.com/Ouranosinc/Magpie/blob/master/config/permissions.cfg and a remote Magpie URL.

A CLI helper should be provided to allow doing this directly using the file without need to manually import the function and pass the loaded configuration.