-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bradley/dev mode credentials #286
Bradley/dev mode credentials #286
Conversation
I converted to a draft because I decided to go ahead and write some tests for this. Update: I did manually test that I can use |
src/auth/middleware.ts
Outdated
uuid: undefined | ||
if (process.env.NODE_ENV === 'development') { | ||
testUUID = muid.v4() | ||
console.log(`The user.uuid for this session is: ${testUUID.toString()}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use logger.info()
instead?
src/auth/middleware.ts
Outdated
} | ||
|
||
if (process.env.NODE_ENV === 'development' && (user.uuid == null)) { | ||
user.roles = ['admin', 'editor'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI the three roles that currently exist are editor
, user_admin
and org_admin
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I changed it to include all three roles.
@bradleyDean can you please rebase to fix conflicts? |
Should be closed since this got implemented by #371 |
What?
Create
serve-dev
command which automatically authenticates the user and gives them certain permissions, as described in this issue.How?
The issue linked above described the process pretty well, but notice that
createContext
now creates a closure so that seperate requests will not keep creating new user id's. I also created a launch config object so we can run the newserve-dev
command using a debugger.Validation?
I used the
serve-dev
command to add areas to the db in the graphql playground. I was shaky on how to get the necessary uuid's (for specifying which specific area I wanted to delte, fetch, etc), so it would probably be a good idea for someone more familiar with the API to run the new command, then exercise other API endpoints, just so we can validate it with more code paths. Alternatively, maybe someone more familiar with using the API and I can chat on discord and I'll run additional validation myself.Tests?
I haven't implemented any tests yet :(
If anyone thinks I should, let me know and I'll get on it.