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

[Java][jersey2] Fix RuntimeException when HTTP signature parameters are not configured #6457

Merged
merged 25 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
41e97e6
Mustache template should use invokerPackage tag to generate import
sebastien-rosset May 13, 2020
1760f6a
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 13, 2020
3ae466e
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 13, 2020
b628667
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 13, 2020
4dc915c
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 14, 2020
7a207f6
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 16, 2020
776fba6
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 18, 2020
3fac434
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 19, 2020
a96c46b
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 20, 2020
1351fd0
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 21, 2020
ba65735
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 22, 2020
9a0b89e
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 22, 2020
4c84190
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 22, 2020
94ae683
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 22, 2020
aac9f5a
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 23, 2020
93baa3d
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 23, 2020
5c313b4
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 23, 2020
cda8898
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 23, 2020
1f7e5c1
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 24, 2020
bef435e
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 25, 2020
a9cad38
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 26, 2020
877ecfe
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 27, 2020
8c055f5
Merge branch 'master' of https://github.com/OpenAPITools/openapi-gene…
sebastien-rosset May 27, 2020
f48c34f
fix runtime exception when HttpSignatureAuth is not set
sebastien-rosset May 27, 2020
33c192a
fix runtime exception when HttpSignatureAuth is not set
sebastien-rosset May 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ public class ApiClient {
{{#isHttpSignature}}
if (auth instanceof HttpSignatureAuth) {
authentications.put("{{name}}", auth);
} else {
authentications.put("{{name}}", null);
}
{{/isHttpSignature}}
{{/isBasic}}
Expand Down Expand Up @@ -246,10 +244,20 @@ public class ApiClient {
return this;
}

/**
* Returns the base URL to the location where the OpenAPI document is being served.
*
* @return The base URL to the target host.
*/
public String getBasePath() {
return basePath;
}

/**
* Sets the base URL to the location where the OpenAPI document is being served.
*
* @param basePath The base URL to the target host.
*/
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
{{#hasOAuthMethods}}
Expand Down Expand Up @@ -1281,7 +1289,7 @@ public class ApiClient {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) {
throw new RuntimeException("Authentication undefined: " + authName);
continue;
}
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,20 @@ public ApiClient setHttpClient(Client httpClient) {
return this;
}

/**
* Returns the base URL to the location where the OpenAPI document is being served.
*
* @return The base URL to the target host.
*/
public String getBasePath() {
return basePath;
}

/**
* Sets the base URL to the location where the OpenAPI document is being served.
*
* @param basePath The base URL to the target host.
*/
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
setOauthBasePath(basePath);
Expand Down Expand Up @@ -1183,7 +1193,7 @@ protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, M
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) {
throw new RuntimeException("Authentication undefined: " + authName);
continue;
}
auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
Expand Down