Commit Graph

115 Commits

Author SHA1 Message Date
Dimitrie Stefanescu 2bf77a8df2 fix(dates): consolidates date formatting to ISO strings 2020-10-02 17:16:17 +01:00
Dimitrie Stefanescu bd3eee8308 test(user services): added test for findOrCreateUser 2020-09-24 19:52:19 +01:00
Dimitrie Stefanescu 6d9dd0351c feat(permissions): allows getting public streams with anon requests + tests. test cov back >90% FTW 2020-09-21 17:45:03 +01:00
Dimitrie Stefanescu 6cdeccb74b feat(apps): more service implementations, cleanup, and tests 2020-09-18 23:12:43 +01:00
Dimitrie Stefanescu 03bd49ef6d feat(apps): scaffolded more app services & more (cleanup, tests, etc.) 2020-09-18 16:46:23 +01:00
Dimitrie Stefanescu 3e3d99b782 feat(tracing): improved GQL ops tracing logs 2020-09-03 17:12:57 +01:00
Dimitrie Stefanescu 1b5b13bf9d refactor(subs names): renamed streamCreated/Deleted to Added/Removed 2020-09-01 14:37:52 +01:00
Dimitrie Stefanescu 33fb0fa7f7 docs(subs): updates schema comments to clarify userStreamCreated/Deleted re perms granted/revoked 2020-09-01 12:16:24 +01:00
Dimitrie Stefanescu f24dd6529e test(subs): fixed borked streamUpdate 2020-09-01 12:07:53 +01:00
Dimitrie Stefanescu 28b8c08aff perf(subs): standardises the response on stream subs to id (vs mixture of streamId and id) 2020-09-01 11:58:09 +01:00
Dimitrie Stefanescu 690d95bfde fix(subs): replaces permission subs with created/deleted + sharedBy/revokedBy props 2020-09-01 11:46:38 +01:00
Dimitrie Stefanescu 11571a1d76 fix(subscriptions): added stream deleted subscription 2020-09-01 10:58:29 +01:00
Dimitrie Stefanescu 8a023d25d5 fix(setup): fully removes the setup check app 2020-08-31 18:15:18 +01:00
Dimitrie Stefanescu 0e98b6f5ce feat(subs): adds 'grantor' userid on stream permissions granted event
so later down the line we can do 'x shared y with you', albeit i'm also inclined to move those
permission granted events to stream created/deleted
2020-08-25 10:39:32 +03:00
izzy lyseggen 0723a69895 fix(streams): oops forgot some 2020-08-21 16:51:58 +01:00
izzy lyseggen b8c0bb4125 refactor(mutations): make inputs consistent
all mutations that require more than 1 input now has an input type 🌟
fixes #10
2020-08-21 16:45:21 +01:00
izzy lyseggen 0ef85374b3 style: clean redundant refs and formatting 2020-08-21 16:00:13 +01:00
izzy lyseggen f0db46bbca test(subs): more auth tests for subs
confirm you can't receive updates if you're not authorised for stream
2020-08-21 15:36:49 +01:00
izzy lyseggen be8e8be854 feat(subs): auth within subscripition resolvers 2020-08-21 14:11:10 +01:00
izzy lyseggen 397fb04689 feat(subs): add scope auth to branch & commit subs 2020-08-21 13:46:28 +01:00
izzy lyseggen 0674083f6c feat(auth-dirs): only allow on field definitons 2020-08-21 13:45:44 +01:00
izzy lyseggen 6db1bdcf42 feat(subs): simplify stream create/delete subs
as per discussion, remove `ownerId` input and only allow subscribing to
your own stream creation / deletion
2020-08-21 13:44:19 +01:00
izzy lyseggen 75cddd1260 test(subs): permission granted and revoked tests 2020-08-21 09:38:48 +01:00
izzy lyseggen f71287105a feat(subs): permission subs resolvers
don't know where they vanished to, but they're fixed and back now
2020-08-21 07:44:57 +01:00
izzy lyseggen 99f473873a fix(subs): remove redundant stream sub defs 2020-08-20 10:00:26 +01:00
izzy lyseggen c6db01420a test(subs): merge branch 'dim/gql-subscriptions' 2020-08-20 09:50:15 +01:00
Dimitrie Stefanescu e4f213d4f6 test(subscriptions): works with separate run test server, figuring out starting it from test file
doing `npm run dev:server:test` and running the test with that server over port 3000 works. seems
like ws upgrade requests are not honoured when the server is started from the test file (on 3001).
2020-08-20 10:27:48 +03:00
izzy lyseggen c406abe5ec feat(subs): subs for branch & commit mutations 🥳
also applied @hasRole and @hasScope directives to mutations in this schema
2020-08-19 15:46:40 +01:00
izzy lyseggen 6c3e8b138d feat(subs): rename stream subs & apply directives
- `streamCreated` -> `userStreamCreated
- `streamDeleted` -> `userStreamDeleted`

this is to better show that this is user bound (takes owner id)
rather than stream bound

- @hasRole and @hasScope have been reapplied to each field
2020-08-19 15:45:21 +01:00
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
Dimitrie Stefanescu b3cf8e863a refactor(test/subscriptions): split out the subs test file & added npm test script for it 2020-08-19 17:27:17 +03:00
Dimitrie Stefanescu 1f25b8c5fe refactor(subscriptions): fiddles and riddles 2020-08-19 16:49:39 +03:00
izzy lyseggen 7c13ab02f2 feat(auth-dirs): do a check for context.auth 2020-08-18 16:00:49 +01:00
izzy lyseggen 78657bbe7d feat(subs): finish up streams subscriptions 2020-08-18 10:31:45 +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 ee532b2b96 refactor(streams): use directives for auth
comment out any auth logic within the streams resolvers and add auth
directives to the graphql schema instead

test:server all pass for me with this, so hoping everything is ok here!!
2020-08-14 15:32:06 +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 e3f2d73444 feat(subs): add stream updated and deleted subs 2020-08-12 16:01:19 +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 9d34ac0e95 feat(subs): return stream input from streamCreated 2020-08-11 17:47:47 +01:00
izzy lyseggen fa209157bc feat(subs): add @hasScope dir to streamCreated 2020-08-11 14:39:48 +01:00
izzy lyseggen 199e576b9f feat(directives): create HasScopeDirective 2020-08-11 14:36:53 +01:00
izzy lyseggen fee7ffb257 feat(sub): filter stream created sub by owner id 2020-08-07 15:02:57 +01:00
Dimitrie Stefanescu 7b32d39cac feat(subs): added redis pubsubber (shared resource), imported it into stream resolvers 2020-08-06 10:42:36 +01:00
Dimitrie Stefanescu 8f25a6f2fb fix(subs): subscriptions now properly initialising 2020-08-06 10:16:45 +01:00