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

feat: Support additional request parameters for 3LO #1070

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kondo19
Copy link

@kondo19 kondo19 commented Sep 7, 2023

Introduce a way to pass additional parameters to auhtorization url

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

@google-cla
Copy link

google-cla bot commented Sep 7, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added size: s Pull request size is small. size: m Pull request size is medium. and removed size: s Pull request size is small. labels Sep 7, 2023
);
}

public AuthorizationCodeFlow(

Choose a reason for hiding this comment

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

lets remove this overloaded method. If someone really wants to pass additional parameters, they can create builder, set additionalparam and call build() on the builder. Exactly like what we have done in the test.

Copy link
Author

Choose a reason for hiding this comment

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

Yes I see. I have removed overloaded method.

Choose a reason for hiding this comment

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

Lets remove this overloaded method

@@ -156,6 +184,7 @@ protected AuthorizationCodeFlow(Builder builder) {
clientId = Preconditions.checkNotNull(builder.clientId);
authorizationServerEncodedUrl =
Preconditions.checkNotNull(builder.authorizationServerEncodedUrl);
additionalParameters = Preconditions.checkNotNull(builder.additionalParameters);

Choose a reason for hiding this comment

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

no need of null check here because it is an optional thing. You are checking for null before using it.

Copy link
Author

Choose a reason for hiding this comment

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

Ah! Removed precondition check.

setClientAuthentication(clientAuthentication);
setClientId(clientId);
setAuthorizationServerEncodedUrl(authorizationServerEncodedUrl);
setAdditionalParameters(Collections.<String, String>emptyMap());

Choose a reason for hiding this comment

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

It is ok to just leave additional params as null. No need to set as empty map. It is ok to have it as well, no harm.

@sai-sunder-s
Copy link

Run mvn com.coveo:fmt-maven-plugin:format to fix formatting issues.

@kondo19
Copy link
Author

kondo19 commented Sep 19, 2023

Successfully ran command "mvn com.coveo:fmt-maven-plugin:format" on repo. Not sure how to clear up the missing CLA.

@sai-sunder-s sai-sunder-s marked this pull request as ready for review September 19, 2023 16:45
@sai-sunder-s sai-sunder-s requested a review from a team as a code owner September 19, 2023 16:45
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: m Pull request size is medium. labels Sep 19, 2023
Copy link
Member

@TimurSadykov TimurSadykov left a comment

Choose a reason for hiding this comment

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

LGTM

@TimurSadykov
Copy link
Member

Successfully ran command "mvn com.coveo:fmt-maven-plugin:format" on repo. Not sure how to clear up the missing CLA.

This could happen if you contributed to this PR using different emails from different PCs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants