-
Notifications
You must be signed in to change notification settings - Fork 63
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
Implement declarative auth design for GraphQL service #210
Conversation
Codecov Report
@@ Coverage Diff @@
## master #210 +/- ##
============================================
- Coverage 90.12% 90.08% -0.04%
Complexity 204 204
============================================
Files 41 43 +2
Lines 1691 1796 +105
Branches 695 753 +58
============================================
+ Hits 1524 1618 +94
- Misses 153 164 +11
Partials 14 14
Continue to review full report at Codecov.
|
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a couple of minor comments, but overall, LGTM.
ListenerAuthConfig[] auth = <ListenerAuthConfig[]>serviceConfig?.auth; | ||
return auth; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we directly return here?
ListenerAuthConfig[] auth = <ListenerAuthConfig[]>serviceConfig?.auth; | |
return auth; | |
return <ListenerAuthConfig[]>serviceConfig?.auth; |
} | ||
} | ||
|
||
isolated function tryAuthenticate(ListenerAuthConfig[] authConfig, string header) returns http:Unauthorized|http:Forbidden? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we use plural names for arrays? Like authConfigs
?
} | ||
} | ||
|
||
@test:Config {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add a test group for auth tests?
@test:Config {} | |
@test:Config { | |
groups: ["auth"] | |
} |
Purpose
This PR introduces the declarative auth design for GraphQL service.
Design: https://docs.google.com/document/d/1dGw5uUP6kqZNTwMfQ_Ik-k0HTMKhX70XpEA3tys9_kk/edit?usp=sharing
Fixes: ballerina-platform/ballerina-library#1336
Related to ballerina-platform/ballerina-library#584
Examples
Checklist