hwsc-org / hwsc-app-gateway-svc

Web application gateway management service
https://hwsc-org.github.io/hwsc-app-gateway-svc/
0 stars 0 forks source link

Epic/CreateUser #13

Closed kimlisa closed 5 years ago

kimlisa commented 5 years ago

Chrome wants to create a user.

  1. The user fills up the registration form in the website
  2. Chrome will check for user input validity
  3. Chrome gathers this info into a userObject
- firstName: string
- lastName: string
- email: string
- password: hashed string
- organization: string
  1. Chrome calls app-gateway-svc CreateUser(userObject) CreateUser(UserResponse)
  2. app-gateway-svc will call user-svc GetStatus()
  3. Two results from user-svc:
    - Service is unavailable: return error with this message
    - Service is available: proceed with the following
  4. app-gateway-svc will call user-svc CreateUser(userObject)
  5. user-svc will take this userObject and check if email already exists in mongoDB (unique email)
  6. Two results:
    - Email is taken: return error with this message
    - Email not taken: proceed with the following
  7. user-svc will create a unique user ID using ulid
  8. user-svc will hash the hashed password using bcrypt
  9. user-svc will create and insert new document with userObject information in user collection
  10. user-svc sends back OK
  11. app-gateway-svc receives any of the following message from user-svc and sends it back to Chrome:
    1: Service is down
    2: Email is taken
    3: OK
  12. Chrome can take any of the following action:
  13. If service is down: Chrome displays error message to user that service is unavailable atm and try again later
  14. If email is taken: Chrome displays error message to user to use a different email
  15. If OK: Chrome will redirect user to logged in search page
faraonc commented 5 years ago

Follow-up enhancement for app-gateway-svc https://github.com/hwsc-org/hwsc-app-gateway-svc/issues/14

faraonc commented 5 years ago

https://github.com/hwsc-org/hwsc-user-svc/issues/19

faraonc commented 5 years ago

High Level

  1. I am thinking about starting from Chrome clicking the Registration link
  2. Chrome dials using maybe a dummy email and password
  3. app-gateway maybe does not need to go to user-svc to get a dummy token with registration permission with a hardcoded secret for registration, or maybe go to user-svc to to get a dummy token with secret that can change?
  4. User fills out form
  5. Chrome sends out the form to app-gateway-svc using CreateUser
  6. app-gateway-svc forwards to user-svc
  7. Update DB
  8. Send Email
  9. Chrome disconnects GRPC from app-gateway-svc
  10. Chrome redirects to succesful or failed registration
faraonc commented 5 years ago

We can also use a dummy token instead of dummy email and password.

What are the trade-offs?

Do we have other ways to do this?

kimlisa commented 5 years ago

High Level

New User

Email Verification Process: should also work as updating email?

NEW Users who log in without verifying their email

faraonc commented 5 years ago

High Level

New User

Email Verification Process: should also work as updating email?

NEW Users who log in without verifying their email