Skip to content

Commit

Permalink
change "scopes" jwt claim to "scope"
Browse files Browse the repository at this point in the history
  • Loading branch information
theganyo committed May 1, 2020
1 parent ecb9043 commit e4ce98a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 27 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module github.com/apigee/apigee-remote-service-cli

go 1.13

replace github.com/apigee/apigee-remote-service-golib => github.com/theganyo/apigee-remote-service-golib v0.0.0-20200423221707-af08871b57d8
replace github.com/apigee/apigee-remote-service-golib => github.com/theganyo/apigee-remote-service-golib v0.0.3-dev.0.20200501003346-5a2e36b98451

replace github.com/apigee/apigee-remote-service-envoy => github.com/theganyo/apigee-remote-service-envoy v0.0.2-dev.0.20200423231709-14df7f1737c8
replace github.com/apigee/apigee-remote-service-envoy => github.com/theganyo/apigee-remote-service-envoy v0.0.3-dev.0.20200501003753-06e24318646f

// replace github.com/apigee/apigee-remote-service-golib => ../apigee-remote-service-golib

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/theganyo/apigee-remote-service-envoy v0.0.2-dev.0.20200423231709-14df7f1737c8 h1:jwiyjnStqDH254In15z8Ctp0bB8sLX8WCmmvwrbp5VA=
github.com/theganyo/apigee-remote-service-envoy v0.0.2-dev.0.20200423231709-14df7f1737c8/go.mod h1:f1P9ufpJ1xJQaY4DECfZa3IhV5WobKjiuvAqzupH4G4=
github.com/theganyo/apigee-remote-service-golib v0.0.0-20200423221707-af08871b57d8 h1:OL0QoIU4byNDuKyDfPsqia9aAACALKRXHh7Tymj0JZM=
github.com/theganyo/apigee-remote-service-golib v0.0.0-20200423221707-af08871b57d8/go.mod h1:1Y8IJBsjT19gv+pRgmvKNF2FoMguc181K9syiGq2IsY=
github.com/theganyo/apigee-remote-service-envoy v0.0.3-dev.0.20200501003753-06e24318646f h1:CnZVrQCDy51KeoZI70LISyZ51xRbs86vvZcjVIrwen0=
github.com/theganyo/apigee-remote-service-envoy v0.0.3-dev.0.20200501003753-06e24318646f/go.mod h1:/1EjxHxdYCheoezRzCyVpQ43ZMmo6UfSxnA7yHIt//Y=
github.com/theganyo/apigee-remote-service-golib v0.0.3-dev.0.20200501003346-5a2e36b98451 h1:gl8Eh97bmVPc53WXweZjzjgc30wiofoCwS/kLgB6nME=
github.com/theganyo/apigee-remote-service-golib v0.0.3-dev.0.20200501003346-5a2e36b98451/go.mod h1:1Y8IJBsjT19gv+pRgmvKNF2FoMguc181K9syiGq2IsY=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
Expand Down
10 changes: 5 additions & 5 deletions proxies/proxies.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Claim name="api_product_list" ref="apiProductList" type="string" array="true"/>
<Claim name="application_name" ref="apigee.developer.app.name"/>
<Claim name="developer_email" ref="apigee.developer.email"/>
<Claim name="scopes" ref="scope" type="string" array="true"/>
<Claim name="scope" ref="scope"/>
</AdditionalClaims>
<OutputVariable>jwtmessage</OutputVariable>
</GenerateJWT>
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ try {
print(err);
}

var scope = context.getVariable("oauthv2accesstoken.AccessTokenRequest.scope");
if (scope) {
var scopearr = scope.split(" ");
context.setVariable("scope", scopearr.join());
} else {
context.setVariable("scope", "");
}

context.setVariable("scope", context.getVariable("oauthv2accesstoken.AccessTokenRequest.scope"));
context.setVariable("apiProductList", apiProductsList.join());
context.setVariable("nbf", new Date().toUTCString());
context.setVariable("iss", context.getVariable("proxyProto") + "://" + context.getVariable("proxyHost") + context.getVariable("proxy.basepath") + context.getVariable("proxy.pathsuffix"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Claim name="api_product_list" ref="apiProductList" type="string" array="true"/>
<Claim name="application_name" ref="apigee.developer.app.name"/>
<Claim name="developer_email" ref="apigee.developer.email"/>
<Claim name="scopes" ref="scope" type="string" array="true"/>
<Claim name="scope" ref="scope"/>
</AdditionalClaims>
<OutputVariable>jwtmessage</OutputVariable>
</GenerateJWT>
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ try {
print(err);
}

var scope = context.getVariable("oauthv2accesstoken.AccessTokenRequest.scope");
if (scope) {
var scopearr = scope.split(" ");
context.setVariable("scope", scopearr.join());
}

context.setVariable("scope", context.getVariable("oauthv2accesstoken.AccessTokenRequest.scope"));
context.setVariable("apiProductList", apiProductsList.join());
context.setVariable("nbf", new Date().toUTCString());
context.setVariable("iss", context.getVariable("proxyProto") + "://" + context.getVariable("proxyHost") + context.getVariable("proxy.basepath") + context.getVariable("proxy.pathsuffix"));
Expand Down

0 comments on commit e4ce98a

Please sign in to comment.