Skip to content
New issue

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

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

Already on GitHub? # to your account

Proposal: Allow to adjust token validity for Api Clients via Terraform #539

Conversation

mlitvinav
Copy link
Contributor

@mlitvinav mlitvinav commented Nov 18, 2024

The API Clients allow to override the default token validity but this is only possible during the creation of the api client.

While the access_token's are valid for 48 hours, the lifetime of refresh_tokens is 200 days, which is pretty high. I would like to be able to set custom validity values for the api clients. Especially because there is no way to update existing clients, so after creation hooks wont work here.

NEW FEATURES | UPGRADE NOTES | ENHANCEMENTS | BUG FIXES | EXPERIMENTS

Extends resource_api_client to read and write the fields accessTokenValiditySeconds and refreshTokenValiditySeconds.


Please double check if these changes are good to go. It seems there is not much that needs to be changed but i am unfamiliar with Go and working with TF providers.

@mlitvinav mlitvinav requested a review from a team as a code owner November 18, 2024 13:03
Copy link
Member

@demeyerthom demeyerthom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mlitvinav this looks good! Would you mind fully implementing the logic? I think it is just a case of passing the two additional fields to the draft if they are present.

Also, the changes file you added is incorrect. These are generated automatically from the contents of the .changes/unreleased folder. You can generate a new one with changie new (see https://changie.dev/guide/installation/)

@demeyerthom demeyerthom added the enhancement New feature or request label Nov 26, 2024
@mlitvinav mlitvinav force-pushed the allow-to-adjust-token-validity-for-api-clients branch from d041567 to ecc1f64 Compare November 27, 2024 14:06
@mlitvinav
Copy link
Contributor Author

Hi @demeyerthom, i have created the change via changie and added the missing fields on draft

@demeyerthom demeyerthom merged commit 2ca859b into labd:main Dec 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants