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

DXCDT-155: Fix subsequent updates to partial refresh_token object #187

Merged
merged 6 commits into from
Jun 16, 2022

Conversation

willvedd
Copy link
Contributor

@willvedd willvedd commented Jun 15, 2022

Description

As noted in #24, there is an issue when applying client configurations when not all properties of a refresh token are set. The initial config is applied appropriately, but subsequent applies are met with this general error:

 refresh_token {
          - idle_token_lifetime          = 1296000 -> null
          - infinite_idle_token_lifetime = true -> null
          - infinite_token_lifetime      = true -> null
          - token_lifetime               = 2592000 -> null
            # (3 unchanged attributes hidden)
        }
        # (1 unchanged block hidden)
        
Error: 400 Bad Request: Neither infinite_token_lifetime nor infinite_idle_token_lifetime can be true when token expiration type is 'non-expiring'

What's occurring is that several of these properties within a client's refresh_token object are set to defaults if not explicitly declared. By setting Computed: true to each of these properties, we signal to the provider that the default values should be used instead of remaining empty.

Checklist

Note: Checklist required to be completed before a PR is considered to be reviewable.

Auth0 Code of Conduct

Auth0 General Contribution Guidelines

Changes include test coverage?

  • Yes
  • Not needed

Does the description provide the correct amount of context?

  • Yes, the description provides enough context for the reviewer to understand what these changes accomplish

Have you updated the documentation?

  • Yes, I've updated the appropriate docs
  • Not needed

Is this code ready for production?

  • Yes, all code changes are intentional and no debugging calls are left over

@willvedd willvedd requested a review from a team as a code owner June 15, 2022 19:51
@willvedd willvedd changed the title DXCDT-155: Fix updates DXCDT-155: Fix subsequent updates to partial refresh_token object Jun 15, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #187 (ecf3839) into main (a924b78) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #187      +/-   ##
==========================================
+ Coverage   84.01%   84.02%   +0.01%     
==========================================
  Files          35       35              
  Lines        6024     6029       +5     
==========================================
+ Hits         5061     5066       +5     
  Misses        762      762              
  Partials      201      201              
Impacted Files Coverage Δ
auth0/resource_auth0_client.go 94.20% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a924b78...ecf3839. Read the comment docs.

Copy link
Contributor

@sergiught sergiught left a comment

Choose a reason for hiding this comment

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

Great work fixing this 💪🏻

@willvedd willvedd merged commit 8324b74 into main Jun 16, 2022
@willvedd willvedd deleted the DXCDT-155-fix-subsequent-refresh_token-update branch June 16, 2022 01:42
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.

4 participants