Skip to content

Commit

Permalink
fix: kong admin url change for helm deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
antidodo committed Apr 17, 2024
1 parent 733e048 commit bc1edad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/utils/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@


def create_tokens(analysis_id: str, project_id: str) -> dict[str, str]:
return {'DATA_SOURCE_TOKEN': _get_kong_token(analysis_id, project_id),
tokens = {'DATA_SOURCE_TOKEN': _get_kong_token(analysis_id, project_id),
'KEYCLOAK_TOKEN': _get_keycloak_token(analysis_id, project_id)}

return tokens



def _get_keycloak_token(analysis_id: str, project_id: str) -> str:
#TODO create client in keycloak
# curl -q -X POST -d "grant_type=client_credentials&client_id=service1&client_secret=9dd01665c2f3f02f93c32d03bd854569f03cd62f439ccf9f0861c141b9d6330e" http://keycloak-service:8080/realms/flame/protocol/openid-connect/token
# curl -q -X POST -d "grant_type=client_credentials&client_id=service1&client_secret=9dd01665c2f3f02f93c32d03bd854569f03cd62f439ccf9f0861c141b9d6330e" http://flame-node-keycloak-service:8080/realms/flame/protocol/openid-connect/token
client = os.getenv('RESULT_CLIENT_ID')
client_secret = os.getenv('RESULT_CLIENT_SECRET')

Expand All @@ -39,7 +40,7 @@ def _get_keycloak_token(analysis_id: str, project_id: str) -> str:


def _get_kong_token(analysis_id: str, project_id: str) -> str:
kong_admin_url = "kong-kong-admin"
kong_admin_url = "flame-node-kong-admin"
configuration = Configuration(host=kong_admin_url)

# Add consumer
Expand Down

0 comments on commit bc1edad

Please sign in to comment.