Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use tz::TimeZone for az-cli time conversion on unix platforms #1431

Merged
merged 2 commits into from Oct 3, 2023

Conversation

demoray
Copy link
Contributor

@demoray demoray commented Oct 3, 2023

As indicated in #1371, there are numerous issues with handling the az-cli's output of an access token's expiration date when it comes to time zones.

An update to the Azure CLI is in progress that will add a new field that will handle the conversion, currently tracked as Azure/azure-cli#27476.

We should make use of this new feature once it's available, but we should also keep this functionality as a fallback for supporting older Azure CLIs.

As indicated in Azure#1371, there are numerous issues with handling the
az-cli's output of an access token's expiration date when it comes to
time zones.

An update to the Azure CLI is in progress that will add a _new_ field
that will handle the conversion, currently tracked as Azure/azure-cli#27476.

We should make use of this new feature once it's available, but we
should also keep this functionality as a fallback for supporting older
Azure CLIs.
@demoray demoray requested a review from cataggar October 3, 2023 17:24
@demoray demoray merged commit 1455c3d into Azure:main Oct 3, 2023
19 checks passed
@demoray demoray deleted the use-tz-rs-crate-for-timezones branch October 3, 2023 18:05
demoray pushed a commit to demoray/azure-sdk-for-rust that referenced this pull request Oct 3, 2023
The original change in Azure#1431 was built & tested on a machine with the
timezone of GMT, which is effectively UTC as it relates to the testing.

In addition to fixing the conversion, this adds a unit test for unix
platforms that temporarily changes the `TZ` environment variable (used
for setting the timezone for libc platforms), performs the conversion,
then resets the `TZ` environment variable.

This validates the functionality regardless of the testing environment.
@demoray demoray mentioned this pull request Oct 3, 2023
demoray added a commit that referenced this pull request Oct 4, 2023
The original change in #1431 was built & tested on a machine with the
timezone of GMT, which is effectively UTC as it relates to the testing.

In addition to fixing the conversion, this adds a unit test for unix
platforms that temporarily changes the `TZ` environment variable (used
for setting the timezone for libc platforms), performs the conversion,
then resets the `TZ` environment variable.

This validates the functionality regardless of the testing environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants