-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Oauth2 resource param #15147
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
Oauth2 resource param #15147
Changes from 4 commits
5c1c426
0e4849d
f10fddc
a41d062
93364fc
bae2d4a
cd8beb0
e8cbee4
05bf32d
d466930
4de33fa
d3f8f3f
bf6afd4
8236816
a376282
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,6 +109,7 @@ class OAuth2Test : public testing::Test { | |
| p.add_auth_scopes("user"); | ||
| p.add_auth_scopes("openid"); | ||
| p.add_auth_scopes("email"); | ||
| p.set_resource("oauth2-resource"); | ||
| auto* matcher = p.add_pass_through_matcher(); | ||
| matcher->set_name(":method"); | ||
| matcher->set_exact_match("OPTIONS"); | ||
|
|
@@ -197,6 +198,9 @@ TEST_F(OAuth2Test, DefaultAuthScope) { | |
| // Auth_scopes was not set, should return default value. | ||
| EXPECT_EQ(test_config_->encodedAuthScopes(), TEST_DEFAULT_SCOPE); | ||
|
|
||
| // resource by default is not set | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: proper grammar/punctuation in comments |
||
| EXPECT_EQ(test_config_->resource(), ""); | ||
|
|
||
| // Recreate the filter with current config and test if the scope was added | ||
| // as a query parameter in response headers. | ||
| init(test_config_); | ||
|
|
@@ -324,7 +328,8 @@ TEST_F(OAuth2Test, OAuthErrorNonOAuthHttpCallback) { | |
| TEST_CLIENT_ID + "&scope=" + TEST_ENCODED_AUTH_SCOPES + | ||
| "&response_type=code&" | ||
| "redirect_uri=http%3A%2F%2Ftraffic.example.com%2F" | ||
| "_oauth&state=http%3A%2F%2Ftraffic.example.com%2Fnot%2F_oauth"}, | ||
| "_oauth&state=http%3A%2F%2Ftraffic.example.com%2Fnot%2F_oauth" | ||
| "&resource=oauth2-resource"}, | ||
| }; | ||
|
|
||
| // explicitly tell the validator to fail the validation | ||
|
|
@@ -634,7 +639,8 @@ TEST_F(OAuth2Test, OAuthTestFullFlowPostWithParameters) { | |
| "&response_type=code&" | ||
| "redirect_uri=https%3A%2F%2Ftraffic.example.com%2F" | ||
| "_oauth&state=https%3A%2F%2Ftraffic.example.com%2Ftest%" | ||
| "3Fname%3Dadmin%26level%3Dtrace"}, | ||
| "3Fname%3Dadmin%26level%3Dtrace" | ||
| "&resource=oauth2-resource"}, | ||
| }; | ||
|
|
||
| // Fail the validation to trigger the OAuth flow. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,7 @@ name: oauth | |
| - user | ||
| - openid | ||
| resource: oauth2-resource | ||
| )EOF"); | ||
|
|
||
| // Add the OAuth cluster. | ||
|
|
||
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.
The RFC seems to allow multiple values here, should this be a
repeatedfield?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.
@snowp I will convert this to a
repeatedfield.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.
@snowp Its up for review.