department-of-veterans-affairs / tmf-auth-exp-design-patterns

Developing design patterns for the authenticated experience
2 stars 0 forks source link

Discovery - Auth Tools & VA Context Provider / Hooks #195

Open adamwhitlock1 opened 1 week ago

adamwhitlock1 commented 1 week ago

User Story

As an engineer, I want to explore creating developer tools that make it easier to work with VA authentication states and application context, so I can spend less time mocking these foundational pieces and more time building features.

Background

Right now engineers have low visibility into the state of their applications in a clear and consistent way. They encounter problems with several areas of applications:

Discovery Goals

  1. Auth State Tools Investigation

    • [ ] Document current auth state management approaches
      • How apps handle auth now
      • Common auth scenarios needed for testing
      • Current pain points in mocking auth
    • [ ] Look into existing tools for auth state manipulation
    • [ ] Identify what an ideal auth mocking experience would look like
  2. VA Context Provider Research

    • [ ] Map out commonly needed VA context data
      • Form data
      • Form configs
      • Route info
      • Feature flags
      • User profile basics
    • [ ] Look at how apps currently share this context
    • [ ] Check out patterns from other large React apps
  3. Technical Approach Ideas

    • [ ] Refactoring useMockedAuth to be more flexible and allow other ways besides query strings to trigger mocked auth state
    • [ ] Look at the session cookie extension for usability
    • [ ] identify if a common context provider would be useful to apps to help engineers

Questions to Figure Out

Resources

What We'll Make

  1. Quick write-up of:

    • How auth and context work now
    • Pain points to solve
    • Ideas for making it better
    • Trade-offs of different approaches
  2. Simple proof of concept showing:

    • Auth state switching
    • Basic context provider

Success Looks Like

Things to Keep in Mind

Review Needed By

Done When