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

default to 4h for token expiration #637

Merged
merged 1 commit into from
Aug 21, 2024
Merged

default to 4h for token expiration #637

merged 1 commit into from
Aug 21, 2024

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Aug 21, 2024

  • The defined constant AZURE_OPENAI_TOKEN_EXPIRATION has been added to constants.ts. It's value indicates a time period in milliseconds, specifically four hours. ⏳
  • In azuretoken.ts, the createAzureToken function has been modified. Now it includes the AZURE_OPENAI_TOKEN_EXPIRATION constant as a part of return object.
    • Specifically, it's being utilized to decide the expiresOnTimestamp. If azureToken.expiresOnTimestamp is null, the expiresOnTimestamp is set to the current time plus four hours (coming from our newly defined constant). 📝💡
  • Essentially, it appears the changes are concerned with implementing a set expiration time for Azure authentication tokens, and ensuring that this token expiry is maintained across the project. 🔄💼

generated by pr-describe

Copy link

The changes in the pull request seem to be mainly about handling token expiration for Azure.

The changes made in azuretoken.ts includes importing a new constant AZURE_OPENAI_TOKEN_EXPIRATION from the constants.ts file. This constant is then used as a fallback value for the expiresOnTimestamp field in the createAzureToken function in case azureToken.expiresOnTimestamp is not defined.

In constants.ts, a new constant AZURE_OPENAI_TOKEN_EXPIRATION is defined and set to 4 hours.

The changes look good as they add a layer of safety to the createAzureToken function by ensuring that expiresOnTimestamp will always have a value, and the value is configurable from constants.ts.

LGTM 🚀

generated by pr-review

@pelikhan pelikhan merged commit 5e3ad0a into main Aug 21, 2024
10 checks passed
@pelikhan pelikhan deleted the azure-experiation branch August 21, 2024 02:00
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.

1 participant