Skip to content

Commit

Permalink
Update opa_ingest.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Jan 9, 2024
1 parent dc915fa commit 80d60ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opa_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
def add_user_to_dataset(user, dataset, token):
# get current access:
access, status_code = auth.get_opa_access()
print(json.dumps(access))
if status_code != 200:
raise Exception(f"OPA error: {access}")
# {"access": {"controlled_access_list": {"[email protected]": ["SYNTHETIC-1", "mock1"], "[email protected]": ["SYNTHETIC-2"]}, "open_datasets": ["open1", "open2"], "opt_in_datasets": ["opt-in-1"], "registered_datasets": ["registered3"]}}
Expand All @@ -27,6 +26,7 @@ def add_user_to_dataset(user, dataset, token):
controlled_access_list[user] = [dataset]

# put back:
print(json.dumps(access))
response, status_code = auth.set_opa_access(access)
print(json.dumps(response))
if status_code != 200:
Expand Down

0 comments on commit 80d60ac

Please sign in to comment.