Skip to content

Commit

Permalink
Update auth.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Jan 23, 2025
1 parent cbe6258 commit ccebfd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/authx/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ def set_service_store_secret(service, key=None, value=None, vault_url=VAULT_URL,
response = requests.post(url, headers=headers, data=value)
if response.status_code >= 200 and response.status_code < 300:
return get_service_store_secret(service, key, token=token)
return response.json(), response.status_code
return response.text, response.status_code


def get_service_store_secret(service, key=None, vault_url=VAULT_URL, role_id=None, secret_id=None, token=None):
Expand Down Expand Up @@ -1031,6 +1031,7 @@ def create_service_token(vault_url=VAULT_URL):
token = uuid.uuid1()
try:
response, status_code = set_service_store_secret(SERVICE_NAME, key=f"token/{token}", value={"token": token})
logger.debug(f"service service {response} {status_code}")
if status_code != 200:
raise CandigAuthError(f"Could not create_service_token from {SERVICE_NAME}: {response}")
except Exception as e:
Expand Down

0 comments on commit ccebfd4

Please sign in to comment.