Skip to content

Commit

Permalink
Merge pull request #26 from gisaia/feat/autoorg
Browse files Browse the repository at this point in the history
auto fill organisation when available in configuration
  • Loading branch information
sylvaingaudan authored Oct 24, 2024
2 parents 2ac0201 + 3e33ef9 commit cb8e839
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arlas/cli/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ def create_collection(arlas: str, collection: str, model_resource: str, index: s
model = {}
if index:
model["index_name"] = index
if not owner:
configuration: ARLAS = Configuration.settings.arlas.get(arlas, None)
if configuration and configuration.authorization and configuration.authorization.token_url and configuration.authorization.token_url.headers and configuration.authorization.token_url.headers.get("arlas-org-filter"):
owner = configuration.authorization.token_url.headers.get("arlas-org-filter")
if owner:
model["organisations"] = {
"owner": owner,
Expand Down

0 comments on commit cb8e839

Please sign in to comment.