-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from CanDIG/stable-candidate-v3.1.0
v3.1.0: Data model 3, site curator role
- Loading branch information
Showing
15 changed files
with
430 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
"SITE_ADMIN_USER" | ||
], | ||
"curator": [ | ||
"USER2" | ||
], | ||
"local_team": [ | ||
"USER1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import json | ||
import os | ||
from authx.auth import add_provider_to_opa, get_user_id | ||
import sys | ||
|
||
## Updates Vault's opa service store with the information for our IDP | ||
|
||
token = None | ||
try: | ||
if os.path.isfile('/app/bearer.txt'): | ||
with open('/app/bearer.txt') as f: | ||
token = f.read().strip() | ||
if token is not None: | ||
print("Updating our IDP with a new bearer token") | ||
response = add_provider_to_opa(token, os.getenv("KEYCLOAK_REALM_URL")) | ||
os.remove('/app/bearer.txt') | ||
if get_user_id(None, token=token) is None: | ||
print("IDP is incorrect: verify that Keycloak is set up and clean/build/compose opa again") | ||
sys.exit(2) | ||
except Exception as e: | ||
raise Exception(f"failed to save idp keys: {str(e)} {status_code}") | ||
sys.exit(1) | ||
|
||
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.