create-graphql-server icon indicating copy to clipboard operation
create-graphql-server copied to clipboard

Authorization PR

Open tobkle opened this issue 7 years ago • 8 comments

tobkle avatar Aug 03 '17 17:08 tobkle

How would you like to take this forward (i.e. implement the actual code generation?)

The nice thing about the current setup is now we have the generated code we want (modulo a few small changes / formatting etc) we can follow TDD to get the code gen built. Have you looked at the codegen part of CGS yet? I'd be happy to be more involved in this part if we want to merge this PR to a branch and commit directly to that branch?

tmeasday avatar Aug 07 '17 07:08 tmeasday

Can work on the code generator soon, after the npm package for the authorization part.

I'm ok with the branch. Do you create it?

tobkle avatar Aug 10 '17 19:08 tobkle

@tobkle bringing this out of the line comments. You said:

Removing it in model/Twitter.js currently has no negative effect on the current test cases.

But if I remove try/catch in the model/User.js, it is getting admin access in some of the cases. Or maybe we have to adjust the underlying queryForRoles -> logger(authlog) instead, which holds the throw on error? Do you have a better idea therefore? I agree the try/catch here isn't nice, but somehow I have to react on this error case, otherwise I'll get admin access.

Hmm, this sounds a little concerning ;)

What is the exact flow that ends up giving admin access if we don't catch the exception? I would have expected it to just kill the whole query?

tmeasday avatar Aug 14 '17 06:08 tmeasday

Did the change. First prototype of the adjusted generator is running. Tests are passing. Except for the yarn.lock on CircleCI. Had it run with npm instead of yarn the last time, as yarn was causing problems in my local environment. Yarn hadn't got any network connect. Haven't had the time yet to solve that. Can you give me some comments about the way the generator is implemented? Reading the AST is not so well done yet. Also the code replacement in the model file, but it was the easiest first approach. I should find some time to continue on the weekend.

tobkle avatar Aug 23 '17 05:08 tobkle

Have now two active branches master (this) and another one, where I've integrated both, Authorizations and Query Arguments.

tobkle avatar Sep 07 '17 14:09 tobkle

Sorry I am lagging so much on this, crunch time for me right now.

tmeasday avatar Sep 08 '17 00:09 tmeasday

Don't mind. Whenever you have the time. Have learnt a lot on this project so far. Thanks for your work.

tobkle avatar Sep 08 '17 06:09 tobkle

Wow, this is looking really amazing

tmeasday avatar Sep 15 '17 04:09 tmeasday