Skip to content
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

DX(PrivateSchema): separate authorization from resolvers #6248

Closed
2 tasks
mattkrick opened this issue Mar 21, 2022 · 0 comments · Fixed by #6263
Closed
2 tasks

DX(PrivateSchema): separate authorization from resolvers #6248

mattkrick opened this issue Mar 21, 2022 · 0 comments · Fixed by #6263
Assignees
Labels
DX Developer Experience

Comments

@mattkrick
Copy link
Member

mattkrick commented Mar 21, 2022

Predecessor: #6228

Using the private schema as a test, how should we separate authorization and resolution?

By breaking them apart, we have a clear separation of concerns, which is good for scalability.
It also means we should be able to identify glaring holes in our permissions.

Suggested Options

Considerations

Some mutations may change the underlying authorization. If authorization is checked using a dataloader, then that dataloader would have to be cleared before returning the mutation resolution, otherwise it'll result in stale authorization.
For example, let's say I call the mutation removeFromTeam which requires the viewer to be on TeamX. The authorizer uses a dataloader to see if an active TeamMember exists. Then, the resolver inactivates that team member & returns the team member. if that team member gets resolved using the dataloader, it'll still show up as active.

Background

This was the challenge problem for backend devs: https://www.notion.so/parabol/Back-end-Technical-Problem-a9d281e0396b41be85865e2b3a8461b4

We also talk about it here: #4540 (comment)

AC

  • Create a 1 or many draft PRs that show what the code would look like using each option.
  • If there are other options to consider, bring them up & weigh the pros/cons

Estimate: 8 hours

@mattkrick mattkrick added the DX Developer Experience label Mar 21, 2022
@mattkrick mattkrick moved this to To Prioritize in Sprint Board Beta Mar 21, 2022
@mattkrick mattkrick moved this from To Prioritize to Self Review in Sprint Board Beta Mar 22, 2022
@mattkrick mattkrick mentioned this issue Mar 22, 2022
1 task
@mattkrick mattkrick moved this from Self Review to Reviewer Review in Sprint Board Beta Mar 24, 2022
@mattkrick mattkrick self-assigned this Mar 24, 2022
Repository owner moved this from Reviewer Review to Done in Sprint Board Beta Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Developer Experience
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant