Skip to content

Commit

Permalink
Set SA token default TTL to 1 day (#8290)
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Zhang <[email protected]>
  • Loading branch information
ABZhang0 and Alan Zhang authored Nov 18, 2024
1 parent ac9a484 commit 4ba987c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/amg/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,7 @@ Release History
2.5.2
++++++
* `az grafana create`: fix issue with principal type implicit selection during role assignment step

2.5.3
++++++
* `az grafana service-account token create`: set token default expiration time to 1 day as stated in the documentation
2 changes: 2 additions & 0 deletions src/amg/azext_amg/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ def create_service_account_token(cmd, grafana_name, service_account, token, time

if time_to_live:
data['secondsToLive'] = _convert_duration_to_seconds(time_to_live)
else:
data['secondsToLive'] = _convert_duration_to_seconds("1d")

response = _send_request(cmd, resource_group_name, grafana_name, "post",
"/api/serviceaccounts/" + service_account_id + '/tokens', data)
Expand Down
2 changes: 1 addition & 1 deletion src/amg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# TODO: Confirm this is the right version number you want and it matches your
# HISTORY.rst entry.
VERSION = '2.5.2'
VERSION = '2.5.3'

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down

0 comments on commit 4ba987c

Please sign in to comment.