Skip to content
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

oauth config override #63

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

oauth config override #63

wants to merge 22 commits into from

Conversation

peteboothroyd
Copy link

@peteboothroyd peteboothroyd commented Aug 31, 2017

Adding ability to override oauth configuration settings via command line arguments

  • Added args: oauth_refresh_token_endpoint_url, oauth_client_id, oauth_client_secret, oauth_refresh_token_path, oauth_access_token_path
  • These overwrite the corresponding data in the config files
  • Added tests for new args
  • Added logging for case where poylglot hangs waiting for stdin

Peter Boothroyd and others added 7 commits August 31, 2017 15:18
Add three new options for specifying client cert authentication:

  --tls_client_cert_path
  --tls_client_key_path
  --tls_client_override_authority

Update instructions and generate new test certificates, including a
client cert.
Copy link
Member

@dinowernli dinowernli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally looking nice, just a few style nits here and there

try {
URL url = new URL(rawUrl);
return Optional.of(url);
} catch (MalformedURLException mURLE) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/mURLE/e

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure what this means

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant that the standard naming convention is "e" rather than "mURLE".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok thanks, will do

URL url = new URL(rawUrl);
return Optional.of(url);
} catch (MalformedURLException mURLE) {
throw new IllegalArgumentException("URL " + rawUrl +" is invalid", mURLE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing space after +

@@ -131,6 +131,29 @@ private Configuration applyOverrides(Configuration configuration) {
resultBuilder.getCallConfigBuilder().setTlsCaCertPath(
overrides.get().tlsCaCertPath().get().toString());
}
if (overrides.get().oauthRefreshTokenEndpointUrl().isPresent()) {
resultBuilder.getCallConfigBuilder().getOauthConfigBuilder().getRefreshTokenCredentialsBuilder()
.setTokenEndpointUrl(overrides.get().oauthRefreshTokenEndpointUrl().get().toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation looks bad

when(mockOverrides.oauthAccessTokenPath()).thenReturn(Optional.empty());

Configuration config = ConfigurationLoader
.forDefaultConfigSet()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent here as well

please fix throughout the pr

@peteboothroyd
Copy link
Author

I've reformatted the tabs. Is there an automated way this could be done, maybe with a linter to check style?

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

.filter(config -> config.getName().equals(name))
.findAny()
.orElseThrow(() -> new IllegalArgumentException("Could not find named config: " + name));
.filter(config -> config.getName().equals(name))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation still off

Digital Signature, Non Repudiation, Key Encipherment
X509v3 Subject Key Identifier:
E2:53:8F:A6:30:9A:43:C6:24:84:5A:FB:4D:8F:9D:5B:C8:24:28:F8
X509v3 Authority Key Identifier:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this diff is against an old version of head. Please rebase :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants