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

Auth0 user invite tickets #895

Merged
merged 10 commits into from
Nov 21, 2022
Merged

Auth0 user invite tickets #895

merged 10 commits into from
Nov 21, 2022

Conversation

pdeziel
Copy link
Collaborator

@pdeziel pdeziel commented Nov 17, 2022

Scope of changes

This adds some functionality to the BFF to generate user invite tickets. There are two types of tickets the BFF generates:

  1. Password reset - this should be generated when we need to create a user account for a collaborator on their behalf (after they are added as a collaborator), and allows them to change their password from the generated one.
  2. Verification email - this is currently used to ensure the user is still verified in Auth0 and redirect them to the authentication callback after they click the link.

Type of change

  • bug fix
  • new feature
  • documentation
  • other (describe)

Acceptance criteria

With this change the user should receive a user invite email when they are added as a collaborator in the organization. If they click the link they should be able to change their password if they are a new user, or be automatically redirected to the configured GDS_BFF_AUTH0_REDIRECT_URL if they are an existing registered user.

Author checklist

  • I have manually tested the change and/or added automation in the form of unit tests or integration tests
  • I have updated the dependencies list
  • I have recompiled and included new protocol buffers to reflect changes I made
  • I have added new test fixtures as needed to support added tests
  • Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
  • I have moved the associated Shortcut story to "Ready for Review"

Reviewer(s) checklist

  • Any new user-facing content that has been added for this PR has been QA'ed to ensure correct grammar, spelling, and understandability.

w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(ticket)
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added these methods so the Auth0 management API doesn't error on us during tests.

Copy link
Contributor

@DanielSollis DanielSollis left a comment

Choose a reason for hiding this comment

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

This looks good, I just had one comment suggesting a possible change.

pkg/bff/collaborators.go Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2022

Codecov Report

Base: 44.66% // Head: 47.48% // Increases project coverage by +2.82% 🎉

Coverage data is based on head (2550789) compared to base (aafe412).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #895      +/-   ##
==========================================
+ Coverage   44.66%   47.48%   +2.82%     
==========================================
  Files         667      280     -387     
  Lines       24198    20662    -3536     
  Branches     1517      667     -850     
==========================================
- Hits        10807     9811     -996     
+ Misses      12017     9481    -2536     
+ Partials     1374     1370       -4     
Flag Coverage Δ
unittests 47.48% <ø> (+2.82%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...com/trisacrypto/directory/pkg/bff/collaborators.go 58.48% <0.00%> (-10.09%) ⬇️
.../github.com/trisacrypto/directory/pkg/bff/users.go 57.43% <0.00%> (-0.83%) ⬇️
...github.com/trisacrypto/directory/pkg/bff/server.go 66.31% <0.00%> (-0.72%) ⬇️
web/gds-user-ui/src/modules/start/index.tsx
web/gds-user-ui/src/constants/lang-key.ts
web/gds-user-ui/src/theme/components/Button.ts
...ts/CertificateReview/LegalPersonReview.stories.tsx
web/gds-user-ui/src/modules/auth/reset/index.tsx
...ogress/TestNetCertificateProgressBar.component.tsx
...user-ui/src/components/TrisaVerifiedLogo/index.tsx
... and 381 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pdeziel pdeziel merged commit 71d4485 into main Nov 21, 2022
@pdeziel pdeziel deleted the sc-9509 branch November 21, 2022 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants