Skip to content

Initialize dev user to fake Auth in development #100

@AnnaLenaO

Description

@AnnaLenaO

Problem:
In development:
To test run GraphQL Mutation updateUser you have to manually fake authentication,
or explicit write a valid email, that you know exists in the databse, when the user credential is updated for that user.

Solution:
Add a fake user to database with a known email.
This is done in config folder in a seperate class as CommandLineRunner.

Create a custom DevAuthenticationFilter extends GenericFilterBean that sets the fake users authentication.

Update developmentSecurityFilterChain() with:
.addFilterBefore(DevAuthenticationFilter, BasicAuthenticationFilter.class)

Defenition of done:
In development it is possible to make requests to /graphql without explicit write a valid email in code
or fake authentication.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions