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

Add Support for attributes and precedence to ConnectionOptions & phone_number to SignupRequest Struct #421

Merged

Conversation

developerkunal
Copy link
Contributor

🔧 Changes

  • Added support for attributes and precedence fields to ConnectionOptions struct in the management package.
  • Added phone_number field to SignupRequest struct in the authentication package to allow user signup with phone number.

📚 References

🔬 Testing

The following test cases have been added to ensure the new functionality works as expected:

Authentication Package

  • TestDatabaseSignUp_RequiresUsername
    • Tests the Database.Signup method with a connection that requires a username.
  • TestDatabaseSignUp_WithEmailIdentifier
    • Tests the Database.Signup method with a connection that requires an email.
  • TestDatabaseSignUp_WithUsernameIdentifier
    • Tests the Database.Signup method with a connection that requires a username.
  • TestDatabaseSignUp_WithUsernameAndEmailIdentifiers
    • Tests the Database.Signup method with a connection that requires both a username and email.
  • TestDatabaseSignUp_WithPhoneNumberIdentifier
    • Tests the Database.Signup method with a connection that requires a phone number.
  • TestDatabaseSignUp_WithUsernameAndPhoneNumberIdentifiers
    • Tests the Database.Signup method with a connection that requires both a username and phone number.
  • TestDatabaseSignUp_WithUsernameEmailAndPhoneNumberIdentifiers
    • Tests the Database.Signup method with a connection that requires a username, email, and phone number.

Management Package

  • Auth0ConnectionTestCase
    • Added a set of test cases to test various combinations of ConnectionOptions:
      • Auth0 Connection With RequireUsername
      • Auth0 Connection with PhoneNumber as Identifier
      • Auth0 Connection with Email as Identifier
      • Auth0 Connection with Username as Identifier
      • Auth0 Connection Cannot set both requires_username and attributes together
      • Auth0 Connection With No attribute is active
      • Auth0 Connection Cannot set both validation and attributes together
      • Auth0 Connection Attribute required in profile but inactive on signup

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.51%. Comparing base (c044433) to head (9bc078a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
+ Coverage   95.44%   95.51%   +0.07%     
==========================================
  Files          47       47              
  Lines        7725     7848     +123     
==========================================
+ Hits         7373     7496     +123     
  Misses        235      235              
  Partials      117      117              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@lakshmi-auth0 lakshmi-auth0 left a comment

Choose a reason for hiding this comment

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

LGTM!

},
}

func TestConnectionManager_CreateDBConnectionWithDifferentOptions(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How easy is it to figure out which test case is failing with this code?

Copy link
Contributor

@arpit-jn arpit-jn left a comment

Choose a reason for hiding this comment

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

Approved

@developerkunal developerkunal merged commit bd6f669 into main Jul 16, 2024
7 checks passed
@developerkunal developerkunal deleted the SDK-4895-add-support-for-phone-number-as-id-db-connection branch July 16, 2024 09:40
@developerkunal developerkunal mentioned this pull request Aug 16, 2024
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.

5 participants