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
AuthRegistry Implementation #139
Conversation
* IMPORT specifies an authorization that allows you to import a type (implying read-write permissions) | ||
* EXPORT specifies an authorization that allows you to export a type (implying read-only permissions) | ||
*/ | ||
enum AuthMode { |
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.
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.
I don't mind going with AuthMode but the bigger question seems that it goes unused except in log statements. Can we remove it alltogether?
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.
I was thinking it will get passed into the getAuthDataGenerator call to the AuthServiceProvider, which will then return a generator for the correct permissions mode.
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.
Per offline discussion, SGTM
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.
Done - Added test. Also for posterity, this is meant to mimic the existing ServiceMode enum here: https://github.com/google/data-portability/blob/master/portability-core/src/main/java/org/dataportabilityproject/shared/ServiceMode.java
Used to determine scopes for auth generation (see GoogleServiceProvider for example: https://github.com/google/data-portability/blob/master/portability-core/src/main/java/org/dataportabilityproject/serviceProviders/google/GoogleServiceProvider.java#L64)
* IMPORT specifies an authorization that allows you to import a type (implying read-write permissions) | ||
* EXPORT specifies an authorization that allows you to export a type (implying read-only permissions) | ||
*/ | ||
enum AuthMode { |
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.
I don't mind going with AuthMode but the bigger question seems that it goes unused except in log statements. Can we remove it alltogether?
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.
Very nice! One question on MS which can be in a follow up.
Also, I'll adjust my PR to use this once it's merged.
|
||
@Override | ||
public List<String> getImportTypes() { | ||
return ImmutableList.of(); |
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.
Do we need to put values here and below?
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.
I left it blank since nothing was implemented yet for it but I didnt want to return null at the same time. I guess I could throw an Unsupported exception too. What makes the most sense?
#127