Skip to content

Commit

Permalink
fixes #1067 update the SignKeyRequest to get the proxy info from the …
Browse files Browse the repository at this point in the history
…sign section
  • Loading branch information
stevehu committed Nov 15, 2021
1 parent 38c6e5c commit 65b1ae5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

/**
* The configuration is coming from the sign/key section in the client.yml file. This request is used
* to get the key for sign verification.
* to get the key for sign verification. The proxy configuration is defined in the sign section as it
* is not possible the same service using two different proxy servers.
*
* @author Steve Hu
*/
Expand All @@ -45,8 +46,8 @@ public SignKeyRequest(String kid) {
Map<String, Object> keyConfig = (Map<String, Object>)signConfig.get(ClientConfig.KEY);
if(keyConfig != null) {
setServerUrl((String)keyConfig.get(ClientConfig.SERVER_URL));
setProxyHost((String)keyConfig.get(ClientConfig.PROXY_HOST));
int port = keyConfig.get(ClientConfig.PROXY_PORT) == null ? 443 : (Integer)keyConfig.get(ClientConfig.PROXY_PORT);
setProxyHost((String)signConfig.get(ClientConfig.PROXY_HOST));
int port = signConfig.get(ClientConfig.PROXY_PORT) == null ? 443 : (Integer)signConfig.get(ClientConfig.PROXY_PORT);
setProxyPort(port);
setServiceId((String)keyConfig.get(ClientConfig.SERVICE_ID));
Object object = keyConfig.get(ClientConfig.ENABLE_HTTP2);
Expand Down
9 changes: 0 additions & 9 deletions client/src/main/resources/config/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,6 @@ oauth:
# key distribution server url. It will be used to establish connection if it exists.
# if it is not set, then a service lookup against serviceId will be taken to discover an instance.
# server_url: ${client.signKeyServerUrl:https://localhost:6886}
# For users who leverage SaaS OAuth 2.0 provider from lightapi.net or others in the public cloud
# and has an internal proxy server to access code, token and key services of OAuth 2.0, set up the
# proxyHost here for the HTTPS traffic. This option is only working with server_url and serviceId
# below should be commented out. OAuth 2.0 services cannot be discovered if a proxy server is used.
# proxyHost: ${client.signKeyProxyHost:proxy.lightapi.net}
# We only support HTTPS traffic for the proxy and the default port is 443. If your proxy server has
# a different port, please specify it here. If proxyHost is available and proxyPort is missing, then
# the default value 443 is going to be used for the HTTP connection.
# proxyPort: ${client.signKeyProxyPort:3128}
# the unique service id for key distribution service, it will be used to lookup key service if above url doesn't exist.
serviceId: ${client.signKeyServiceId:com.networknt.oauth2-key-1.0.0}
# the path for the key distribution endpoint
Expand Down

0 comments on commit 65b1ae5

Please sign in to comment.