Commit Graph

11 Commits

Author SHA1 Message Date
izzy lyseggen 222f932547 feat(auth-dirs): revert @hasScope and @hasRole
make these field definition only again so it works for now.
the obj directives problem is more messy than i thought 🙃
2020-08-19 15:41:42 +01:00
izzy lyseggen eabfa99651 feat(auth-dirs): remove @isAuthorized directives
was decided that these were a bit too much.
auth will be reverted to `authorizeResolver` within the resolvers
2020-08-19 15:39:52 +01:00
izzy lyseggen 7c13ab02f2 feat(auth-dirs): do a check for context.auth 2020-08-18 16:00:49 +01:00
izzy lyseggen 9bb7b6fe05 feat(auth-dirs): allow hasScope and hasRole on obj
implement `visitObject()` so the directives can be applied to objects.
I have applied them to all mutations and tests all still pass.

NOTE: i feel like there must be a way to abstract and reuse directive
definitions as it's very repetitive, but I'm a bit too brain dead today
to think of an elegant solution
2020-08-17 17:12:52 +01:00
izzy lyseggen 3463b998e5 fix(auth-dir): fix silly typo 2020-08-14 16:38:28 +01:00
izzy lyseggen 405964b653 feat(auth-dir): break auth into three directives
@isAuthorized directive for Stream, Branch, and Commit

this is a light wrapper around `authorizeResolver` which finds the
`resourceId` depending on where the request is coming from.
it's still not super cleand and I will continue thinking about how to
improve this despite inconsistencies with the id location
2020-08-14 15:23:41 +01:00
izzy lyseggen 11c357a79f fix(directives): find correct resolver
handle case when default field resolver is not the right one to use
2020-08-14 10:39:45 +01:00
izzy lyseggen ec09927f94 feat(directives): add @hasRole directive 2020-08-12 16:03:13 +01:00
izzy lyseggen 0f1dc6078e fix(directives): typo in hasScope 2020-08-12 10:36:17 +01:00
izzy lyseggen 768ff42a50 refactor(directives): load these nicely 2020-08-12 09:59:07 +01:00
izzy lyseggen 199e576b9f feat(directives): create HasScopeDirective 2020-08-11 14:36:53 +01:00