Skip to content

Commit

Permalink
Merge pull request #59 from CanDIG/daisieh/no-service-token
Browse files Browse the repository at this point in the history
Don't pass in OPA_SECRET anymore
  • Loading branch information
daisieh authored May 28, 2024
2 parents b152150 + 2f303fb commit 9d1b724
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions candig_federation/authz.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

app = Flask(__name__)
TEST_KEY = os.getenv("TEST_KEY")
CANDIG_OPA_URL = os.getenv("CANDIG_OPA_URL")
CANDIG_OPA_SECRET = os.getenv("CANDIG_OPA_SECRET")
TYK_FEDERATION_API_ID = os.getenv("TYK_FEDERATION_API_ID")


Expand All @@ -27,7 +25,7 @@ def is_site_admin(request):
return True # no auth
if "Authorization" in request.headers:
try:
return authx.auth.is_site_admin(request, opa_url=CANDIG_OPA_URL, admin_secret=CANDIG_OPA_SECRET)
return authx.auth.is_site_admin(request)
except Exception as e:
print(f"Couldn't authorize site_admin: {type(e)} {str(e)}")
app.logger.warning(f"Couldn't authorize site_admin: {type(e)} {str(e)}")
Expand Down
1 change: 0 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -Euo pipefail

export OPA_SECRET=$(cat /run/secrets/opa-service-token)
export TYK_SECRET_KEY=$(cat /run/secrets/tyk-secret-key)


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
attrs~=23.1.0
candigv2-authx@git+https://github.com/CanDIG/candigv2-authx.git@v2.3.0
candigv2-authx@git+https://github.com/CanDIG/candigv2-authx.git@v2.4.2
connexion==2.14.1
decorator==4.4.0
flask==2.2.5
Expand Down

0 comments on commit 9d1b724

Please sign in to comment.