Commit Graph

4652 Commits

Author SHA1 Message Date
Dimitrie Stefanescu 02b660d8ae test(subs): keeps spawned process error logging in tests
so we can read them in the ci logs easier
2020-08-23 20:24:29 +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 d204902fcb style(subs-tests): formatting 2020-08-21 14:24:51 +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 7ed81e0d2a Merge branch 'dim/sub-circle' of https://github.com/Speckle-Next/Server into izzy/gql-subscriptions 2020-08-21 10:20:25 +01:00
izzy lyseggen 70c6b76b85 test(subs): stream sub auth tests
prevent sub for different user or with wrong scope
2020-08-21 10:12:44 +01:00
izzy lyseggen 773f86dcdc test(ci): make the child process windoze friendly 2020-08-21 09:54:18 +01:00
Dimitrie Stefanescu 6f64f7e485 test(ci): set default timeout flag for all tests to 5000ms 2020-08-21 11:54:00 +03:00
izzy lyseggen 1ded3a2a76 test(ci): merge in branch 'dim/sub-circle' 2020-08-21 09:52:47 +01:00
izzy lyseggen 75cddd1260 test(subs): permission granted and revoked tests 2020-08-21 09:38:48 +01:00
Dimitrie Stefanescu a9ad5cbd0b test(ci): peppered await sleep(500) before every mutation 2020-08-21 11:24:37 +03:00
Dimitrie Stefanescu 8fd0f7e580 test(ci): trying out new spawning mechanism for sub test 2020-08-21 11:16:02 +03: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 dc4d8de77e Merge branch 'izzy/gql-subscriptions' of https://github.com/Speckle-Next/Server into izzy/gql-subscriptions 2020-08-20 15:26:30 +01:00
izzy lyseggen 22248bf538 test(subs): basic tests for all subscriptions
did somebody say TESTS 🥳
2020-08-20 15:26:17 +01:00
Dimitrie Stefanescu 80f4dad51e test(server startup): made it easier? hopefully? 2020-08-20 16:01:19 +03:00
Dimitrie Stefanescu 9b02354a42 Merge pull request #18 from Speckle-Next/dim/circle-ci-fixes
Dim/circle ci fixes
2020-08-20 15:51:37 +03:00
Dimitrie Stefanescu 9ce41e18ff fix(tests): someone fumbled up 2020-08-20 15:46:17 +03:00
Dimitrie Stefanescu 8278f77fbc test(subs): added missing nodemon dev dep 2020-08-20 15:43:04 +03:00
Dimitrie Stefanescu d40258cfe6 test(circleci): added test server runner separately 2020-08-20 15:39:02 +03:00
izzy lyseggen ac58d4f53a Revert "test(subs): bump to timeout 7k"
Didn't work.

This reverts commit 41153f1aeb.
2020-08-20 10:42:48 +01:00
izzy lyseggen 41153f1aeb test(subs): bump to timeout 7k to pacify circle ci 2020-08-20 10:36:05 +01:00
izzy lyseggen 762f369c56 test(subs): bump timeout to 5k bc steve jobs's 👻 2020-08-20 10:08:43 +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 7a03c884ea fix(tests/subscriptions): fixes port conflict in subscription tests when ran from all tests command 2020-08-20 11:31:25 +03:00
Dimitrie Stefanescu 29dfa57d82 test(subscriptions): subscription tests now run independently 🙌 2020-08-20 11:26:51 +03: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
Dimitrie Stefanescu 45d73e3a47 test(subscriptions): first working scaffold of subscriptions test! 2020-08-19 21:47: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
Dimitrie Stefanescu 6f788565b7 Merge branch 'izzy/gql-subscriptions' of https://github.com/Speckle-Next/Server into izzy/gql-subscriptions 2020-08-18 18:01:27 +03:00
izzy lyseggen 7c13ab02f2 feat(auth-dirs): do a check for context.auth 2020-08-18 16:00:49 +01:00
Dimitrie Stefanescu 1868641367 fix(tests & frontend): fixes the frontend client subscription connection & scaffolds tests 2020-08-18 17:58:07 +03: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 a4abbe0eaf test(subs): breaking your tests dim sorry 🙃
added three subscription tests that fail b/c i'm dumb and don't know
how the mystical websocket woo woo witchcraft works
2020-08-14 15:36:27 +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 6b8bb65dc5 feat(auth-dir): add auth directives to schema 2020-08-14 15:24:47 +01:00