-
Notifications
You must be signed in to change notification settings - Fork 132
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
Implementation of JWTAuthorizationProvider #1116
Implementation of JWTAuthorizationProvider #1116
Conversation
worker/worker.go
Outdated
@@ -173,6 +173,12 @@ type ( | |||
Run() error | |||
} | |||
|
|||
AuthorizationProvider interface { |
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.
This is giving me a cyclic error @longquanzheng.
If I would like to place this on "go.uber.org/cadence/.gen/go/shared"
but I'm wondering if everything inside of .gen
is generated and if that's the case how could I generate that struct there? Or where do you recommend me to place it?
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.
Yeah don’t put it under .gen. There should be other places to put it . Would it work if you put it under auth/ ? And then use type aliases to export to public
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.
Over all looks great 👍
internal/internal_worker.go
Outdated
@@ -29,6 +29,7 @@ import ( | |||
"encoding/hex" | |||
"errors" | |||
"fmt" | |||
"go.uber.org/cadence/internal/common/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.
This should be moved to the below section/group
internal/worker.go
Outdated
@@ -225,6 +226,10 @@ type ( | |||
// Optional: Flags to turn on/off some server side options | |||
// default: all the features in the struct are turned off | |||
FeatureFlags FeatureFlags | |||
|
|||
// Optional: Authorization interface to get the Auth Token | |||
// default: empty token |
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.
Default should be no provider
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.
LGTM, it would be better to have some unit tests.
…adence-client into adding-auth-provider-interface
@longquanzheng test added :), check |
…adence-client into adding-auth-provider-interface
Pull Request Test Coverage Report for Build ebefd216-b2af-484f-8ba4-55a8796259d8
💛 - Coveralls |
What changed?
Implementation of
JWTAuthorizationProvider
in both worker and clientWhy?
Part of this proposal
How did you test it?
Running the server with oauth file
and modifying cadence-samples
Adding Authorization value in NewClient here
Adding Authorization value in NewDomainClient here
Adding Authorization value in worker.Options here
Potential risks
None