Skip to content

Instantly share code, notes, and snippets.

@favila
Last active June 30, 2022 22:04
Show Gist options
  • Select an option

  • Save favila/2e42c698c86c70060d57449736a9dae7 to your computer and use it in GitHub Desktop.

Select an option

Save favila/2e42c698c86c70060d57449736a9dae7 to your computer and use it in GitHub Desktop.

Revisions

  1. favila revised this gist Jun 30, 2022. No changes.
  2. favila revised this gist Jun 30, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -63,6 +63,7 @@ Decisions?

    Complete Signup Response?
    bad request? -> Complete Signup Error?


    # Check conditions *in this order*
    Complete Signup Error?
  3. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -72,7 +72,8 @@ Decisions?
    terms of service not accepted? -> Incomplete Signup
    requested org slug is reserved? -> Incomplete Signup
    requested org slug in use by an org -> Incomplete Signup
    requested org
    requested org slug in use by a workspace -> Incomplete Signup




  4. favila revised this gist Jun 30, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -70,7 +70,9 @@ Decisions?
    password does not conform to policy? -> Incomplete Signup
    user exists already for requested username -> Incomplete Signup
    terms of service not accepted? -> Incomplete Signup
    requested org slug
    requested org slug is reserved? -> Incomplete Signup
    requested org slug in use by an org -> Incomplete Signup
    requested org



  5. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -69,7 +69,8 @@ Decisions?
    oauth signup with password? -> Incomplete Signup
    password does not conform to policy? -> Incomplete Signup
    user exists already for requested username -> Incomplete Signup

    terms of service not accepted? -> Incomplete Signup
    requested org slug



  6. favila revised this gist Jun 30, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -68,6 +68,7 @@ Decisions?
    Complete Signup Error?
    oauth signup with password? -> Incomplete Signup
    password does not conform to policy? -> Incomplete Signup
    user exists already for requested username -> Incomplete Signup



  7. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -67,7 +67,8 @@ Decisions?
    # Check conditions *in this order*
    Complete Signup Error?
    oauth signup with password? -> Incomplete Signup
    password doe
    password does not conform to policy? -> Incomplete Signup




  8. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -66,7 +66,8 @@ Decisions?

    # Check conditions *in this order*
    Complete Signup Error?
    oauth-signup-no-pass
    oauth signup with password? -> Incomplete Signup
    password doe



  9. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -64,7 +64,9 @@ Decisions?
    Complete Signup Response?
    bad request? -> Complete Signup Error?

    # Check conditions *in this order*
    Complete Signup Error?
    oauth-signup-no-pass



  10. favila revised this gist Jun 30, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -66,6 +66,7 @@ Decisions?

    Complete Signup Error?




    ## Signup REST operations:
  11. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -12,11 +12,11 @@ States
    Complete Signup request -> Complete Signup Response?
    Delete Signup request -> No Signup
    Get Signup request -> Get Signup Response?
    # Update Signup only updates signup/generic-qas question-and-answer data (no effect on state)
    # Update Signup only updates :signup/generic-qas (question-and-answer) data (no effect on state)
    Update Signup -> Incomplete Signup

    Completed Signup
    # Update Signup only updates question-and-answer data (no effect on state)
    # Update Signup only updates :signup/generic-qas (question-and-answer) data (no effect on state)
    Update Signup request -> Completed Signup

    TODO
  12. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -12,10 +12,11 @@ States
    Complete Signup request -> Complete Signup Response?
    Delete Signup request -> No Signup
    Get Signup request -> Get Signup Response?
    # Update Signup only updates signup/generic-qas question-and-answer data (no effect on state)
    Update Signup -> Incomplete Signup

    Completed Signup
    # Update Signup only updates question-and-answer data
    # Update Signup only updates question-and-answer data (no effect on state)
    Update Signup request -> Completed Signup

    TODO
  13. favila revised this gist Jun 30, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -12,9 +12,11 @@ States
    Complete Signup request -> Complete Signup Response?
    Delete Signup request -> No Signup
    Get Signup request -> Get Signup Response?
    Update Signup -> TODO
    Update Signup -> Incomplete Signup

    Completed Signup
    # Update Signup only updates question-and-answer data
    Update Signup request -> Completed Signup

    TODO

  14. favila revised this gist Jun 30, 2022. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -59,6 +59,10 @@ Decisions?
    signup created? -> Send Signup Email?

    Complete Signup Response?
    bad request? -> Complete Signup Error?

    Complete Signup Error?



    ## Signup REST operations:
  15. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@

    States
    # No signup uuid is known.
    # No Signup uuid is known.
    # These requests are parameterized by email address.
    No Signup*
    Create Signup request -> Create Signup Response?
    Get Redirect to Google OAuth Signup -> TODO
    Create Signup via Google OAuth -> TODO

    # An Incomplete Signup satisfies `find-active-signup-id`
    # A Signup uuid is known. An Incomplete Signup satisfies `find-active-signup-id`
    Incomplete Signup
    Complete Signup request -> Complete Signup Response?
    Delete Signup request -> No Signup
  16. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@

    States
    # No signup ID is known; Signups are parameterized by em
    # No signup uuid is known.
    # These requests are parameterized by email address.
    No Signup*
    Create Signup request -> Create Signup Response?
    Get Redirect to Google OAuth Signup -> TODO
  17. favila revised this gist Jun 30, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@

    States
    #
    # No signup ID is known; Signups are parameterized by em
    No Signup*
    Create Signup request -> Create Signup Response?
    Get Redirect to Google OAuth Signup -> TODO
  18. favila revised this gist Jun 30, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@

    States
    #
    No Signup*
    Create Signup request -> Create Signup Response?
    Get Redirect to Google OAuth Signup -> TODO
  19. favila revised this gist Jun 30, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -33,6 +33,7 @@ Decisions?
    bad request? -> Create Signup Error?
    # Side effects: Update :signup/sent-at, resend email
    signup exists for email and no email sent in last 24 hours? -> Update Signup sent-at?
    no signup exists for email and no user owns email? -> Create Signup Record?

    # Check conditions *in this order*
    Create Signup Error?
  20. favila revised this gist Jun 30, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -52,6 +52,7 @@ Decisions?
    email sent? -> Incomplete Signup

    Create Signup Record?
    # See https://www.notion.so/useshortcut/Signup-Flow-Notes-087de916ed7f444e98a147691ea6702e#89149f041fe64d3a9535da6c0500a985
    signup created? -> Send Signup Email?

    Complete Signup Response?
  21. favila revised this gist Jun 30, 2022. 1 changed file with 1 addition and 51 deletions.
    52 changes: 1 addition & 51 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -48,7 +48,7 @@ Decisions?

    Send Signup Email?
    # A signup email contains a link like http://app.shortcut.com/signup/${signup-uuid}

    # The frontend page at that link will post to the Complete Signup REST endpoint
    email sent? -> Incomplete Signup

    Create Signup Record?
    @@ -74,53 +74,3 @@ Decisions?
    # /oauth/signup(-return) routes:
    # Get Redirect to Google OAuth Signup
    # Create Signup via Google OAuth


    #States
    # No Signup
    # # Signups are unique by email, which is the only required parameter to this event
    # Create Signup Request -> Create Signup Response?
    #
    # # Signups have an email and are unique by email.
    # # An Incomplete Signup an email must have been sent with a signup link and verification code.
    # Incomplete Signup
    # # A signup email contains a link like http://app.shortcut.com/signup/${signup-uuid}
    # # The frontend page at that link will post to the Complete Signup REST endpoint
    # Complete Signup Request -> Complete Signup Response?
    # Delete Signup Request -> Delete Signup Response?
    # Get Signup Request -> Get Signup Response?
    #
    # Completed Signup
    #
    # User Exists
    #
    #
    #Responses?
    # Complete Signup Response?
    #
    # Delete Signup Response?
    #
    # Get Signup Response?
    # Create Signup Response?
    # # Error responses
    # # Check conditions *in this order*:
    # banned email domain? -> No Signup
    # email has user already? -> User Exists
    # completed signup for email already? -> Completed Signup
    # unusable legacy referral code? -> No Signup
    # ## Saasquatch referral codes are either static (in our code) or dynamic (each profile can have its own unique one)
    # unknown Saasquatch referral code? -> No Signup
    # signup exists for email and email sent in last 24 hours? -> Incomplete Signup
    # # Successful responses
    # signup exists for email and no email sent in last 24 hours? -> Update Signup sent-at?
    # no signup exists? -> Create Signup Record?
    #
    # Update Signup sent-at?
    # sent-at updated? -> Send Signup Email?
    #
    # Create Signup Record?
    # signup created? -> Send Signup Email?
    #
    # Send Signup Email?
    # email sent? -> Incomplete Signup
    #
  22. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -47,6 +47,8 @@ Decisions?
    sent-at updated? -> Send Signup Email?

    Send Signup Email?
    # A signup email contains a link like http://app.shortcut.com/signup/${signup-uuid}

    email sent? -> Incomplete Signup

    Create Signup Record?
  23. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ Decisions?
    verify signup? -> Completed Signup

    Create Signup Response?
    bad request? -> Complete Signup Error?
    bad request? -> Create Signup Error?
    # Side effects: Update :signup/sent-at, resend email
    signup exists for email and no email sent in last 24 hours? -> Update Signup sent-at?

    @@ -52,6 +52,7 @@ Decisions?
    Create Signup Record?
    signup created? -> Send Signup Email?

    Complete Signup Response?


    ## Signup REST operations:
  24. favila revised this gist Jun 30, 2022. 1 changed file with 3 additions and 6 deletions.
    9 changes: 3 additions & 6 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -17,10 +17,7 @@ States
    TODO


    Decisions?
    Create Signup Response?


    Decisions?
    Get Signup Response?
    # Error response: Logout Required
    # (Get Signup can only be accessed while not authenticated.)
    @@ -32,13 +29,13 @@ Decisions?
    # Emits App Event scope/signup-verify
    verify signup? -> Completed Signup

    Complete Signup Response?
    Create Signup Response?
    bad request? -> Complete Signup Error?
    # Side effects: Update :signup/sent-at, resend email
    signup exists for email and no email sent in last 24 hours? -> Update Signup sent-at?

    # Check conditions *in this order*
    Complete Signup Error?
    Create Signup Error?
    banned email domain? -> No Signup
    email has user already? -> TODO
    completed signup for email already? -> Completed Signup
  25. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -37,9 +37,8 @@ Decisions?
    # Side effects: Update :signup/sent-at, resend email
    signup exists for email and no email sent in last 24 hours? -> Update Signup sent-at?


    Complete Signup Error?
    # Check conditions *in this order*:
    # Check conditions *in this order*
    Complete Signup Error?
    banned email domain? -> No Signup
    email has user already? -> TODO
    completed signup for email already? -> Completed Signup
  26. favila revised this gist Jun 30, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ Decisions?
    Complete Signup Response?
    bad request? -> Complete Signup Error?
    # Side effects: Update :signup/sent-at, resend email
    signup exists for email and no email sent in last 24 hours? -> Incomplete Signup
    signup exists for email and no email sent in last 24 hours? -> Update Signup sent-at?


    Complete Signup Error?
  27. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -54,7 +54,8 @@ Decisions?
    email sent? -> Incomplete Signup

    Create Signup Record?

    signup created? -> Send Signup Email?



    ## Signup REST operations:
  28. favila revised this gist Jun 30, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -52,7 +52,9 @@ Decisions?

    Send Signup Email?
    email sent? -> Incomplete Signup


    Create Signup Record?



    ## Signup REST operations:
  29. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,8 @@ Decisions?
    bad request? -> Complete Signup Error?
    # Side effects: Update :signup/sent-at, resend email
    signup exists for email and no email sent in last 24 hours? -> Incomplete Signup



    Complete Signup Error?
    # Check conditions *in this order*:
    banned email domain? -> No Signup
  30. favila revised this gist Jun 30, 2022. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions SketchSystems.spec
    Original file line number Diff line number Diff line change
    @@ -34,8 +34,8 @@ Decisions?

    Complete Signup Response?
    bad request? -> Complete Signup Error?
    # Side effects: Update sent-at
    signup exists for email and no email sent in last 24 hours? -> Update Signup sent-at?
    # Side effects: Update :signup/sent-at, resend email
    signup exists for email and no email sent in last 24 hours? -> Incomplete Signup

    Complete Signup Error?
    # Check conditions *in this order*: