From 4ba987ca73d04dde2f45a32a067ad42ebf27009e Mon Sep 17 00:00:00 2001 From: Alan Zhang <39725075+ABZhang0@users.noreply.github.com> Date: Sun, 17 Nov 2024 18:19:39 -0800 Subject: [PATCH] Set SA token default TTL to 1 day (#8290) Co-authored-by: Alan Zhang --- src/amg/HISTORY.rst | 4 ++++ src/amg/azext_amg/custom.py | 2 ++ src/amg/setup.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/amg/HISTORY.rst b/src/amg/HISTORY.rst index b0e674b6ae4..d45ebefd822 100644 --- a/src/amg/HISTORY.rst +++ b/src/amg/HISTORY.rst @@ -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 diff --git a/src/amg/azext_amg/custom.py b/src/amg/azext_amg/custom.py index 9dd3b5dd35e..e32bfd6a85d 100644 --- a/src/amg/azext_amg/custom.py +++ b/src/amg/azext_amg/custom.py @@ -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) diff --git a/src/amg/setup.py b/src/amg/setup.py index 524fb2a9516..c65fbf8253f 100644 --- a/src/amg/setup.py +++ b/src/amg/setup.py @@ -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