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

Preserve user ID casing in state #197

Merged
merged 2 commits into from
Jun 22, 2022
Merged

Conversation

willvedd
Copy link
Contributor

@willvedd willvedd commented Jun 21, 2022

Description

As noted in #41 , the Terraform inexplicably converts all user IDs to lower case when writing to state. The specific block of code in question is:

StateFunc: func(s interface{}) string {
   return strings.ToLower(s.(string))
},

This was added in this commit that was pushed directly to master. It doesn't appear that this code serves any functional purpose and I suspect that it was added in error. Additionally, this line is taken from one of the Terraform SDK examples, which further suggests that it doesn't serve a functional purpose to Auth0.

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 21, 2022 18:49
@codecov-commenter
Copy link

Codecov Report

Merging #197 (bfaa0af) into main (743180c) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #197      +/-   ##
==========================================
- Coverage   83.89%   83.88%   -0.01%     
==========================================
  Files          35       35              
  Lines        6059     6056       -3     
==========================================
- Hits         5083     5080       -3     
  Misses        773      773              
  Partials      203      203              
Impacted Files Coverage Δ
auth0/resource_auth0_user.go 72.39% <ø> (-0.37%) ⬇️

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 743180c...bfaa0af. Read the comment docs.

@sergiught
Copy link
Contributor

sergiught commented Jun 21, 2022

Just as a non-blocking suggestion, it might be worth updating the docs now and specifying that the user_id is now case sensitive.

e.g.

* `user_id` - (Optional) String. ID of the user (case-sensitive). 

@willvedd willvedd merged commit 013fabd into main Jun 22, 2022
@willvedd willvedd deleted the remove-user-case-sensitivity branch June 22, 2022 14:20
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