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-159] Fix #159 and refactor guardian resource implementation #195

Merged
merged 2 commits into from
Jun 22, 2022

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Jun 21, 2022

Description

Fixes: #159

The constant diffs and the apply errors we were getting were because the "phone-message-hook" provider for the phone block has no options configurable, but the auth0 and twilio ones do. To account for this and to correctly read the provider and phone.options block, the phone.options is set to a Computed property and we explicitly set them in case of "phone-message-hook" to []interface{nil}.

While fixing this we also went ahead and refactored the implementation ensuring that:

  • If the phone block is present then the phone guardian is enabled, otherwise disabled.

We now also skip unnecessary API calls if the phone factor is disabled when reading.

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

@sergiught sergiught force-pushed the patch/DXCDT-159-ISSUE-159-guardian branch from f0d7934 to db89878 Compare June 21, 2022 09:30
@sergiught sergiught force-pushed the patch/DXCDT-159-ISSUE-159-guardian branch from db89878 to e866a35 Compare June 21, 2022 09:39
@sergiught sergiught marked this pull request as ready for review June 21, 2022 09:39
@sergiught sergiught requested a review from a team as a code owner June 21, 2022 09:39
Copy link
Contributor

@Widcket Widcket left a comment

Choose a reason for hiding this comment

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

Looks good, just left a comment about the test case name (and a couple of test constants).

@sergiught sergiught self-assigned this Jun 21, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #195 (1684cc5) into main (743180c) will increase coverage by 0.03%.
The diff coverage is 70.88%.

@@            Coverage Diff             @@
##             main     #195      +/-   ##
==========================================
+ Coverage   83.89%   83.92%   +0.03%     
==========================================
  Files          35       35              
  Lines        6059     6058       -1     
==========================================
+ Hits         5083     5084       +1     
+ Misses        773      771       -2     
  Partials      203      203              
Impacted Files Coverage Δ
auth0/resource_auth0_guardian.go 78.69% <70.88%> (+0.52%) ⬆️

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...1684cc5. Read the comment docs.

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.

Cannot Update auth0_guardian Resource when phone object is set
4 participants