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

Added new login flow. Respect domain flag on auth0 login command. #1038

Merged
merged 22 commits into from
Aug 13, 2024

Conversation

duedares-rvj
Copy link
Contributor

@duedares-rvj duedares-rvj commented Jul 15, 2024

New improved login flow.
When domain flag is passed along with --no-input during auth0 login, it is interpreted as a user-flow. And hence pre-set the tenant while performing the browser based login.

The evaluation matrix of the flow is mentioned here:

Screenshot 2024-08-05 at 1 14 30 PM

🔧 Changes

  1. Added new flow to determine user-flow or machine-flow based on the initial cli input. (Handle params like --no-input)
  2. If the evaluation cannot be made, prompt user for login type.
  3. Added domain value evaluation function ensuring it's auth.com domain.
  4. Relevant unit test cases added.

Eg. User could use below for user-login:
auth0 login --domain <tenant domain> --no-input

📚 References

This addresses a feature request as suggest in:
#1000

🔬 Testing

Required test cases added under login_test.go which is consumed by make commands. No additional steps required.

📝 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 29, 2024

Codecov Report

Attention: Patch coverage is 41.97531% with 47 lines in your changes missing coverage. Please review.

Project coverage is 72.14%. Comparing base (f5c05e5) to head (c4883bd).

Files Patch % Lines
internal/cli/login.go 40.78% 42 Missing and 3 partials ⚠️
internal/cli/cli.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1038      +/-   ##
==========================================
- Coverage   72.34%   72.14%   -0.21%     
==========================================
  Files          94       94              
  Lines       12781    12839      +58     
==========================================
+ Hits         9247     9263      +16     
- Misses       2984     3024      +40     
- Partials      550      552       +2     

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

@duedares-rvj duedares-rvj marked this pull request as ready for review August 5, 2024 05:52
@duedares-rvj duedares-rvj requested a review from a team as a code owner August 5, 2024 05:52
@duedares-rvj duedares-rvj self-assigned this Aug 5, 2024
@duedares-rvj duedares-rvj changed the title Added use case to ensure if domain if passed in cli, it's populated t… Added new login flow. Respect domain flag on auth0 login command. Aug 5, 2024
@developerkunal
Copy link
Contributor

Changes LGTM.

@duedares-rvj duedares-rvj force-pushed the respect-domain-flag-for-user-login branch from bc6f8c9 to 8c815b6 Compare August 5, 2024 08:15
duedares-rvj and others added 21 commits August 7, 2024 15:56
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.26.0 to 0.27.0.
- [Commits](golang/net@v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/auth0/go-auth0](https://github.com/auth0/go-auth0) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/auth0/go-auth0/releases)
- [Changelog](https://github.com/auth0/go-auth0/blob/main/CHANGELOG.md)
- [Commits](auth0/go-auth0@v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/auth0/go-auth0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.8 to 3.3.2.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](ruby/rexml@v3.2.8...v3.3.2)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/lestrrat-go/jwx](https://github.com/lestrrat-go/jwx) from 1.2.29 to 1.2.30.
- [Release notes](https://github.com/lestrrat-go/jwx/releases)
- [Changelog](https://github.com/lestrrat-go/jwx/blob/v1.2.30/Changes)
- [Commits](lestrrat-go/jwx@v1.2.29...v1.2.30)

---
updated-dependencies:
- dependency-name: github.com/lestrrat-go/jwx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/schollz/progressbar/v3](https://github.com/schollz/progressbar) from 3.14.4 to 3.14.5.
- [Release notes](https://github.com/schollz/progressbar/releases)
- [Commits](schollz/progressbar@v3.14.4...v3.14.5)

---
updated-dependencies:
- dependency-name: github.com/schollz/progressbar/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [rexml](https://github.com/ruby/rexml) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](ruby/rexml@v3.3.2...v3.3.3)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/hashicorp/hc-install](https://github.com/hashicorp/hc-install) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/hashicorp/hc-install/releases)
- [Commits](hashicorp/hc-install@v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/hc-install
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.26.0 to 0.27.0.
- [Commits](golang/net@v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.26.0 to 0.27.0.
- [Commits](golang/net@v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.26.0 to 0.27.0.
- [Commits](golang/net@v0.26.0...v0.27.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@duedares-rvj duedares-rvj force-pushed the respect-domain-flag-for-user-login branch from ca6368b to ddbd3f7 Compare August 7, 2024 10:28
@duedares-rvj duedares-rvj merged commit da131fe into main Aug 13, 2024
8 checks passed
@duedares-rvj duedares-rvj deleted the respect-domain-flag-for-user-login branch August 13, 2024 05:45
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