fides icon indicating copy to clipboard operation
fides copied to clipboard

Invite users via email

Open galvana opened this issue 2 years ago • 3 comments

Closes https://ethyca.atlassian.net/browse/PROD-1553

Description Of Changes

Invite users by email!

Initial design doc here: https://ethyca.atlassian.net/wiki/spaces/EN/pages/2872344650/Hackathon+2023+-+Team+1

Code Changes

Frontend

  • [x] Adds email field to user creation/edit flow
  • [x] Conditionally render setting up a different user's password—only go through this flow if email messaging is not enabled. Otherwise rely on emailing the user to have them set up their own password and activate their own account
  • [x] User page and overall user table now have fields for email as well as a badge for if invite is pending
  • [x] Refactor login page to use our more standard components (this lets us toggle to see the password!)
  • [x] Render a login page with different copy if visiting the url with an invite code- the username field is disabled and prefilled
  • [x] Call new accept invite endpoint when "logging in"
  • [x] URLs now 'persist' through login, i.e. if you visited /user-management while not logged in, got redirected to the login page, then signed in, you'll automatically be redirected to /user-management (where in the past, you'd go to the home screen)
  • [x] sneaky lil animation for logging in

Backend

  • [x] Exposes whether email messaging is enabled via the health endpoint
  • [x] Email is now a required field on creating new users
  • [x] User object has two additional attributes: disabled and disabled_reason. A user pending an invite would have disabled=true and disabled_reason="pending_invite"
  • [x] Flow for sending an email with an invite code when a user is created
  • [x] New endpoint for accepting an invite
  • [x] Updated the create user CLI command to require an email

Steps to Confirm

  • [ ] Add FIDES__ADMIN_UI__URL="http://localhost:3000" to your .env file
  • [ ] Configure email messaging via the API, the Fides Postman collection makes this easy to do with these two API calls
    • [ ] Messaging Config - Email > Post Messaging Config
    • [ ] Messaging Config - Email > Messaging Config Secrets
  • [ ] In the Admin UI, navigate to Management > User Management and click Add New User
    • [ ] Fill out the form with an email address you have access to. Verify the password field is disabled, that's a quick way to verify that "invite users via email" is properly configured
  • [ ] Check your email, open the invite link in an incognito window to avoid conflicting with your current Admin UI session
  • [ ] Provide a password and submit, you should be redirected to the Admin UI landing page

Pre-Merge Checklist

galvana avatar Dec 21 '23 21:12 galvana

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Jul 2, 2024 1:41am

vercel[bot] avatar Dec 21 '23 21:12 vercel[bot]

Passing run #8665 ↗︎

0 4 0 0 Flakiness 0

Details:

Merge 9b3e24800600c8b4ecdf4fee6ef94635629d0e17 into a01735f32d1e904a7762623c969e...
Project: fides Commit: 9054df61bf ℹ️
Status: Passed Duration: 00:40 💡
Started: Jul 2, 2024 1:52 AM Ended: Jul 2, 2024 1:53 AM

Review all test suite changes for PR #4539 ↗︎

cypress[bot] avatar Dec 21 '23 21:12 cypress[bot]

Codecov Report

Attention: Patch coverage is 90.71038% with 17 lines in your changes missing coverage. Please review.

Project coverage is 86.57%. Comparing base (a01735f) to head (9b3e248).

Files Patch % Lines
src/fides/api/service/user/fides_user_service.py 83.33% 5 Missing and 3 partials :warning:
src/fides/api/api/v1/endpoints/oauth_endpoints.py 20.00% 3 Missing and 1 partial :warning:
src/fides/api/api/v1/endpoints/user_endpoints.py 92.00% 1 Missing and 1 partial :warning:
src/fides/api/models/fides_user_invite.py 95.12% 1 Missing and 1 partial :warning:
.../api/service/messaging/message_dispatch_service.py 75.00% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4539      +/-   ##
==========================================
+ Coverage   86.54%   86.57%   +0.02%     
==========================================
  Files         352      354       +2     
  Lines       21892    22053     +161     
  Branches     2887     2901      +14     
==========================================
+ Hits        18947    19092     +145     
- Misses       2438     2448      +10     
- Partials      507      513       +6     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 10 '24 01:01 codecov[bot]

Passing run #8668 ↗︎

0 4 0 0 Flakiness 0

Details:

Invite users via email (#4539)
Project: fides Commit: 281a981870
Status: Passed Duration: 00:42 💡
Started: Jul 2, 2024 3:37 PM Ended: Jul 2, 2024 3:38 PM

Review all test suite changes for PR #4539 ↗︎

cypress[bot] avatar Jul 02 '24 15:07 cypress[bot]

party

allisonking avatar Jul 02 '24 16:07 allisonking