Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
5440d94
initial version
Nov 19, 2020
f2e38b9
initial version
Nov 19, 2020
69fb877
initial version
Nov 19, 2020
a61eeee
initial version
Nov 19, 2020
cfdc73e
initial version
Nov 19, 2020
7bf4dad
initial version
Nov 19, 2020
7457c59
initial version
Nov 19, 2020
1be04ac
initial version
Nov 19, 2020
d2ab2fe
initial version
Nov 19, 2020
cf74475
Delete check_envvar.sh
JoelGauci Nov 19, 2020
39ae3cb
initial version
Nov 19, 2020
152cab2
Merge branch 'feature/pipelinetest' of https://github.com/JoelGauci/d…
Nov 19, 2020
2c5b206
initial version
Nov 19, 2020
5830975
initial version
Nov 19, 2020
906f9dc
initial version
Nov 19, 2020
ca24da5
initial version
Nov 19, 2020
22264aa
initial version
Nov 19, 2020
ccceca5
initial version
Nov 19, 2020
fa5f67a
initial version
Nov 19, 2020
9b933de
initial version
Nov 19, 2020
49603f4
initial version
Nov 19, 2020
6ecc1ae
initial version
Nov 19, 2020
df90ab0
initial version
Nov 19, 2020
e3524d2
initial version
Nov 19, 2020
dd86180
initial version
Nov 19, 2020
9d51c43
initial version
Nov 19, 2020
1fad3f4
initial version
Nov 19, 2020
02ee592
initial version
Nov 19, 2020
d9d4321
initial version
Nov 19, 2020
b539a8f
initial version
Nov 19, 2020
b481a73
initial version
Nov 19, 2020
31b4dc5
initial version
Nov 19, 2020
ad73fdd
functional test
Nov 23, 2020
f30499c
initial version
Nov 23, 2020
0e6a25a
initial version
Nov 23, 2020
9fa4871
initial version
Nov 23, 2020
50ce573
initial version
Nov 23, 2020
0745d85
functional test
Nov 23, 2020
6fdc9d7
functional test
Nov 23, 2020
50e3dea
functional test
Nov 23, 2020
48e3fc2
functional test
Nov 23, 2020
1ceb7b1
functional test
Nov 23, 2020
4175fe4
functional test
Nov 23, 2020
dc60bfb
functional test
Nov 23, 2020
9666d8f
functional test
Nov 23, 2020
87079f3
functional test
Nov 23, 2020
6bf007f
functional test
Nov 23, 2020
7f39f57
functional test
Nov 23, 2020
3512240
functional test
Nov 23, 2020
ab14742
functional test
Nov 23, 2020
5a1560c
functional test
Nov 24, 2020
0dc89b2
sequence diagram of identity proxy implementation
Nov 25, 2020
2b7d501
policies added on identity proxy
Dec 3, 2020
27c3235
linter: minor fixing on shell script
Dec 3, 2020
9f0c141
initial version of oidc mock
Dec 3, 2020
ac19a9e
minor change in pipeline script
Dec 3, 2020
c6d3617
modification of introspection response
Dec 8, 2020
4b8c6e8
removed unuseful tags from pom.xml
Dec 8, 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
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/references/js-callout @seymen
/references/proxy-template @laughingbiscuit
/references/southbound-mtls @danistrebel
/references/oidc-mock @joelgauci
/references/dummy @joelgauci
/labs/best-practices-hackathon @laughingbiscuit @sauliuz @seymen
/tools/organization-cleanup @laughingbiscuit
/tools/pipeline-runner @laughingbiscuit @seymen
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ further to fit a particular use case.
- [Southbound mTLS](references/southbound-mtls) -
Reference for using mTLS client authentication for securely connecting Apigee to
backend services
- [Identity Proxy](references/dummy) -
Reference for using Apigee as an identity proxy for end-user authentication
via OIDC
- [OIDC Mock Identity Proxy](references/oidc-mock) -
Reference project that includes an oidc mock identity provider

## Tools

Expand Down
5 changes: 5 additions & 0 deletions references/dummy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
target/
node_modules
_edge.json

1 change: 1 addition & 0 deletions references/dummy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummy identity-v1
13 changes: 13 additions & 0 deletions references/dummy/apiproxy/identity-api-v1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<APIProxy revision="1" name="identity-api-v1"/>
33 changes: 33 additions & 0 deletions references/dummy/apiproxy/policies/AM-BuildIdpRequest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-BuildIdpRequest">
<DisplayName>AM-BuildIdpRequest</DisplayName>
<Properties/>
<AssignTo createNew="true" type="request">idpPostTokenRequest</AssignTo>
<Set>
<Headers>
<Header name="content-type">application/x-www-form-urlencoded</Header>
<Header name="accept">application/json</Header>
<Header name="Authorization">{flow.idp.Authorization}</Header>
</Headers>
<FormParams>
<FormParam name="code">{request.formparam.code}</FormParam>
<FormParam name="redirect_uri">{flow.idp.apigee.redirect_uri}</FormParam>
<FormParam name="scope">{oauthv2authcode.OA2-GetOriginalStateAttributes.scope}</FormParam>
<FormParam name="grant_type">authorization_code</FormParam>
</FormParams>
<Verb>POST</Verb>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</AssignMessage>
23 changes: 23 additions & 0 deletions references/dummy/apiproxy/policies/AM-GenerateState2ForIdp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-GenerateState2ForIdp">
<DisplayName>AM-GenerateState2ForIdp</DisplayName>
<Properties/>
<AssignVariable>
<Name>oidc.flow.authorization.state2</Name>
<Ref>oauthv2authcode.OA2-GenerateAzCode-State2.code</Ref>
</AssignVariable>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
26 changes: 26 additions & 0 deletions references/dummy/apiproxy/policies/AM-RedirectToApp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-RedirectToApp">
<DisplayName>AM-RedirectToApp</DisplayName>
<Properties/>
<Set>
<Headers>
<Header name="Location">{oidc.flow.authorize.redirect_uri}?code={oauthv2authcode.OA2-StoreExternalAuthorizationCode.code}&amp;state={oidc.flow.authorize.state1}</Header>
</Headers>
<StatusCode>302</StatusCode>
<ReasonPhrase>Found</ReasonPhrase>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
26 changes: 26 additions & 0 deletions references/dummy/apiproxy/policies/AM-RedirectToIdpAuth.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-RedirectToIdpAuth">
<DisplayName>AM-RedirectToIdpAuth</DisplayName>
<Properties/>
<Set>
<Headers>
<Header name="Location">https://{flow.idp.az.hostname}/{flow.idp.az.uri}?client_id={flow.idp.apigee.client_id}&amp;response_type=code&amp;scope={oidc.flow.authorize.scope}&amp;state={oidc.flow.authorization.state2}&amp;redirect_uri={flow.idp.apigee.redirect_uri}&amp;prompt=consent</Header>
</Headers>
<StatusCode>302</StatusCode>
<ReasonPhrase>Found</ReasonPhrase>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
24 changes: 24 additions & 0 deletions references/dummy/apiproxy/policies/AM-SanitizeRequest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-SanitizeRequest">
<DisplayName>AM-SanitizeRequest</DisplayName>
<Properties/>
<Remove>
<Headers>
<Header name="authorization"/>
</Headers>
</Remove>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
25 changes: 25 additions & 0 deletions references/dummy/apiproxy/policies/AM-SetClientIdAsFormParam.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-SetClientIdAsFormParam">
<DisplayName>AM-SetClientIdAsFormParam</DisplayName>
<Properties/>
<Add>
<FormParams>
<FormParam name="client_id">{request.queryparam.client_id}</FormParam>
<FormParam name="client_secret">{oidc.flow.client_secret}</FormParam>
</FormParams>
</Add>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
22 changes: 22 additions & 0 deletions references/dummy/apiproxy/policies/AM-SetDummyResponse.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-SetDummyResponse">
<DisplayName>AM-SetDummyResponse</DisplayName>
<Properties/>
<Set>
<Payload contentType="application/json">{"response":{"status":"ok","message":"access token has been validated!","user":{"name":"{flow.protected.name}","email":"{flow.protected.email}"}}}</Payload>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="response"/>
</AssignMessage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-SetState1InResponseHeader">
<DisplayName>AM-SetState1InResponseHeader</DisplayName>
<Properties/>
<Set>
<Headers>
<Header name="x-state">{oauthv2authcode.OA2-GetOriginalStateAttributes.state1}</Header>
</Headers>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
43 changes: 43 additions & 0 deletions references/dummy/apiproxy/policies/AM-StateAttributes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<AssignMessage async="false" continueOnError="false" enabled="true" name="AM-StateAttributes">
<DisplayName>AM-StateAttributes</DisplayName>
<Properties/>
<AssignVariable>
<Name>oidc.flow.authorize.state1</Name>
<Ref>oauthv2authcode.OA2-AttributesFromAzCode-State2.state1</Ref>
</AssignVariable>
<AssignVariable>
<Name>request.formparam.client_id</Name>
<Ref>oauthv2authcode.OA2-AttributesFromAzCode-State2.client_id</Ref>
</AssignVariable>
<AssignVariable>
<Name>oidc.flow.authorize.redirect_uri</Name>
<Ref>oauthv2authcode.OA2-AttributesFromAzCode-State2.redirect_uri</Ref>
</AssignVariable>
<AssignVariable>
<Name>oidc.flow.authorize.response_type</Name>
<Ref>oauthv2authcode.OA2-AttributesFromAzCode-State2.response_type</Ref>
</AssignVariable>
<AssignVariable>
<Name>oidc.flow.authorize.scope</Name>
<Ref>oauthv2authcode.OA2-AttributesFromAzCode-State2.scope</Ref>
</AssignVariable>
<AssignVariable>
<Name>oauth_external_authorization_status</Name>
<Value>true</Value>
</AssignVariable>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<BasicAuthentication async="false" continueOnError="false" enabled="true" name="BA-AddClientID-ClientSecret-AzHeader">
<DisplayName>BA-AddClientID-ClientSecret-AzHeader</DisplayName>
<Operation>Encode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="flow.idp.apigee.client_id"/>
<Password ref="flow.idp.apigee.client_secret"/>
<AssignTo createNew="true">flow.idp.Authorization</AssignTo>
</BasicAuthentication>
21 changes: 21 additions & 0 deletions references/dummy/apiproxy/policies/BA-GetClientCredentials.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<BasicAuthentication async="false" continueOnError="false" enabled="true" name="BA-GetClientCredentials">
<DisplayName>BA-GetClientCredentials</DisplayName>
<Operation>Decode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<User ref="request.queryparam.client_id"/>
<Password ref="oidc.flow.client_secret"/>
<Source>request.header.Authorization</Source>
</BasicAuthentication>
22 changes: 22 additions & 0 deletions references/dummy/apiproxy/policies/EV-ExtractJWKS.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV-ExtractJWKS">
<DisplayName>EV-ExtractJWKS</DisplayName>
<Source>jwks</Source>
<JSONPayload>
<Variable name="flow.idp.jwks_payload" type="string">
<JSONPath>$</JSONPath>
</Variable>
</JSONPayload>
</ExtractVariables>
Loading