├── .gitignore
├── docs-src
├── auth.png
├── docs.png
└── auth.flow
├── docs
├── img
│ ├── 36ef8aad1eccf126.png
│ ├── 886c4504f41c6448.png
│ └── a3e199e178b20649.png
└── codelab.json
├── apiproxies
├── identity-v1
│ ├── package-lock.json
│ ├── package.json
│ └── apiproxy
│ │ ├── apigee-v1.xml
│ │ ├── manifests
│ │ └── manifest.xml
│ │ ├── policies
│ │ ├── Shared.VerifyEIDAS.xml
│ │ ├── Shared.DynamicRegistration.xml
│ │ ├── Shared.AuthCode.ExternalToken.xml
│ │ ├── Shared.ClientCredentials.Token.xml
│ │ └── add-cors.xml
│ │ └── proxies
│ │ └── default.xml
├── mock-tpp-v1
│ ├── package-lock.json
│ ├── package.json
│ └── apiproxy
│ │ ├── apigee-v1.xml
│ │ ├── manifests
│ │ └── manifest.xml
│ │ ├── policies
│ │ ├── Shared.JWKS.xml
│ │ └── add-cors.xml
│ │ └── proxies
│ │ └── default.xml
└── sandboxes-v1
│ ├── package-lock.json
│ ├── apiproxy
│ ├── resources
│ │ └── hosted
│ │ │ ├── support
│ │ │ ├── clients.json
│ │ │ ├── config.json
│ │ │ └── routes.js
│ │ │ ├── package.json
│ │ │ ├── app.yaml
│ │ │ ├── views
│ │ │ ├── pages
│ │ │ │ ├── ping.ejs
│ │ │ │ ├── consent.ejs
│ │ │ │ └── login.ejs
│ │ │ └── partials
│ │ │ │ ├── foot.ejs
│ │ │ │ ├── header.ejs
│ │ │ │ └── head.ejs
│ │ │ ├── public
│ │ │ └── styles.css
│ │ │ └── app.js
│ ├── targets
│ │ └── default.xml
│ ├── manifests
│ │ ├── manifest.xml
│ │ └── hosted-target-manifest.xml
│ ├── policies
│ │ ├── Shared.CORSError.xml
│ │ ├── Shared.RaiseCORS.xml
│ │ └── Shared.CORSHeaders.xml
│ ├── apigee-v1.xml
│ └── proxies
│ │ └── default.xml
│ └── package.json
├── sharedflows
├── verify-eidas-v1
│ ├── sharedflowbundle
│ │ ├── resources
│ │ │ └── java
│ │ │ │ └── eidas-certificate-parser-1.0.0.jar
│ │ ├── sharedflows
│ │ │ └── default.xml
│ │ ├── policies
│ │ │ └── JavaCallout.EiDAS-CertificateParse.xml
│ │ ├── manifests
│ │ │ └── manifest.xml
│ │ └── verify-eidas-v1.xml
│ └── package.json
├── mock-jwks
│ ├── package.json
│ └── sharedflowbundle
│ │ ├── sharedflows
│ │ └── default.xml
│ │ ├── manifests
│ │ └── manifest.xml
│ │ ├── policies
│ │ └── Assign.JWKS.xml
│ │ └── mock-jwks.xml
├── cors-error-v1
│ ├── package.json
│ └── sharedflowbundle
│ │ ├── sharedflows
│ │ └── default.xml
│ │ ├── policies
│ │ └── Assign.CORSHeaders.xml
│ │ ├── manifests
│ │ └── manifest.xml
│ │ └── cors-error-v1.xml
├── cors-headers-v1
│ ├── package.json
│ └── sharedflowbundle
│ │ ├── sharedflows
│ │ └── default.xml
│ │ ├── policies
│ │ └── Assign.CORSHeaders.xml
│ │ ├── manifests
│ │ └── manifest.xml
│ │ └── cors-headers-v1.xml
├── cors-options-v1
│ ├── package.json
│ └── sharedflowbundle
│ │ ├── sharedflows
│ │ └── default.xml
│ │ ├── manifests
│ │ └── manifest.xml
│ │ ├── policies
│ │ └── RaiseCORSHeaders.xml
│ │ └── cors-options-v1.xml
├── traffic-mgmt-v1
│ ├── package.json
│ └── sharedflowbundle
│ │ ├── sharedflows
│ │ └── default.xml
│ │ ├── policies
│ │ └── Spike-Arrest-1.xml
│ │ ├── manifests
│ │ └── manifest.xml
│ │ └── traffic-mgmt-v1.xml
├── verifyaccesstoken
│ ├── package.json
│ └── sharedflowbundle
│ │ ├── sharedflows
│ │ └── default.xml
│ │ ├── policies
│ │ └── VerifyAccessToken.xml
│ │ ├── manifests
│ │ └── manifest.xml
│ │ └── verifyaccesstoken.xml
├── dynamic-registration
│ ├── package.json
│ └── sharedflowbundle
│ │ ├── policies
│ │ ├── JS.ExtractProducts.xml
│ │ ├── KVM.GetMgmtCredentials.xml
│ │ ├── Extract.ExternalCredentials.xml
│ │ ├── Assign.Response.xml
│ │ ├── Extract.RegisterApp.xml
│ │ ├── Callout.AssociateCredentials.xml
│ │ ├── Callout.CreateCredentialPair.xml
│ │ ├── Callout.RegisterAppExternal.xml
│ │ ├── Callout.CreateCompanyApp.xml
│ │ └── Callout.CreateCompany.xml
│ │ ├── resources
│ │ └── jsc
│ │ │ └── ExtractProducts.js
│ │ ├── sharedflows
│ │ └── default.xml
│ │ ├── dynamic-registration.xml
│ │ └── manifests
│ │ └── manifest.xml
├── authcode-externaltoken
│ ├── package.json
│ └── sharedflowbundle
│ │ ├── policies
│ │ ├── ValidateClient.xml
│ │ ├── SetOAuthVariables.xml
│ │ ├── DecodeBasicAuth.xml
│ │ ├── ExtractExternalToken.xml
│ │ ├── AttachExternalToken.xml
│ │ └── GenerateToken.xml
│ │ ├── sharedflows
│ │ └── default.xml
│ │ ├── authcode-externaltoken.xml
│ │ └── manifests
│ │ └── manifest.xml
└── clientcredentials-token
│ ├── package.json
│ └── sharedflowbundle
│ ├── sharedflows
│ └── default.xml
│ ├── manifests
│ └── manifest.xml
│ ├── policies
│ └── GenerateToken.xml
│ └── clientcredentials-token.xml
├── test
├── fixtures
│ ├── accountAccessConsent.json
│ ├── dynamicRegistration.json
│ ├── eidasCert.txt
│ └── paymentConsent.json
├── OpenData.feature
├── Registration.feature
├── step_definitions
│ ├── apickli-gherkin.js
│ ├── init.js
│ └── ui.js
├── AccountInfo.feature
└── PaymentInitiation.feature
├── .eslintrc.json
├── package.json
├── third_party
└── openbanking.org.uk
│ └── LICENSE
├── CONTRIBUTING.md
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | **/node_modules/**
2 | **/swagger.json
3 |
--------------------------------------------------------------------------------
/docs-src/auth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apigee/openbank/HEAD/docs-src/auth.png
--------------------------------------------------------------------------------
/docs-src/docs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apigee/openbank/HEAD/docs-src/docs.png
--------------------------------------------------------------------------------
/docs/img/36ef8aad1eccf126.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apigee/openbank/HEAD/docs/img/36ef8aad1eccf126.png
--------------------------------------------------------------------------------
/docs/img/886c4504f41c6448.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apigee/openbank/HEAD/docs/img/886c4504f41c6448.png
--------------------------------------------------------------------------------
/docs/img/a3e199e178b20649.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apigee/openbank/HEAD/docs/img/a3e199e178b20649.png
--------------------------------------------------------------------------------
/apiproxies/identity-v1/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "identity-v1",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/apiproxies/mock-tpp-v1/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mock-tpp-v1",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sandboxes-v1",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/support/clients.json:
--------------------------------------------------------------------------------
1 | [{
2 | "client_id": "foo",
3 | "client_secret": "bar",
4 | "redirect_uris": ["https://httpbin.org/get"]
5 | }]
6 |
--------------------------------------------------------------------------------
/sharedflows/verify-eidas-v1/sharedflowbundle/resources/java/eidas-certificate-parser-1.0.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apigee/openbank/HEAD/sharedflows/verify-eidas-v1/sharedflowbundle/resources/java/eidas-certificate-parser-1.0.0.jar
--------------------------------------------------------------------------------
/test/fixtures/accountAccessConsent.json:
--------------------------------------------------------------------------------
1 | {
2 | "Data": {
3 | "Permissions": [
4 | "ReadAccountsBasic"
5 | ],
6 | "ExpirationDateTime": "2019-05-20T14:41:23.436Z",
7 | "TransactionFromDateTime": "2019-05-20T14:41:23.436Z",
8 | "TransactionToDateTime": "2019-05-20T14:41:23.436Z"
9 | },
10 | "Risk": {}
11 | }
12 |
--------------------------------------------------------------------------------
/test/OpenData.feature:
--------------------------------------------------------------------------------
1 | @OpenData
2 | Feature:
3 | As a TPP
4 | I want to access Open Data
5 | So that I can compare products and display locations
6 |
7 | Scenario: Get ATM Data
8 | When I GET /atm-sandbox/open-banking/v2.3/atms
9 | Then response code should be 200
10 | And response body path $.data[0].Brand[0].ATM should be of type array
11 |
12 |
--------------------------------------------------------------------------------
/test/fixtures/dynamicRegistration.json:
--------------------------------------------------------------------------------
1 | {
2 | "client_name": "My Android App",
3 | "jwks_uri": "https://(org)-(env).apigee.net/tpp/v1/my_public_keys.jwks",
4 | "contacts": ["developer@example.com"],
5 | "redirect_uris": ["https://httpbin.org/get"],
6 | "grant_types": ["authorization_code", "implicit", "client_credentials"],
7 | "token_endpoint_auth_method": "client_secret_basic"
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/apiproxies/identity-v1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "identity-v1",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "deploy": "npm i && npx apigeetool deployproxy -u \"$APIGEE_USER\" -p \"$APIGEE_PASS\" -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC"
13 | }
14 |
--------------------------------------------------------------------------------
/apiproxies/mock-tpp-v1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mock-tpp-v1",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "deploy": "npm i && npx apigeetool deployproxy -u \"$APIGEE_USER\" -p \"$APIGEE_PASS\" -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC"
13 | }
14 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mock",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "app.js",
6 | "scripts": {
7 | "start": "node app.js"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "async": "^3.1.0",
14 | "express": "^4.17.1",
15 | "oidc-provider": "^5.5.3",
16 | "swagger-tools": "^0.10.4"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sandboxes-v1",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "deploy": "npm i && npx apigeetool deployproxy -u \"$APIGEE_USER\" -p \"$APIGEE_PASS\" -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
8 | "test": "echo \"Error: no test specified\" && exit 1"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "ISC"
13 | }
14 |
--------------------------------------------------------------------------------
/sharedflows/mock-jwks/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mock-jwks",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sharedflows/cors-error-v1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cors-error-v1",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sharedflows/cors-headers-v1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cors-headers-v1",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sharedflows/cors-options-v1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cors-options-v1",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sharedflows/traffic-mgmt-v1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "traffic-mgmt-v1",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sharedflows/verify-eidas-v1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "verify-eidas-v1",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sharedflows/verifyaccesstoken/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "verifyaccesstoken",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dynamic-registration",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/docs/codelab.json:
--------------------------------------------------------------------------------
1 | {
2 | "environment": "web",
3 | "format": "html",
4 | "prefix": "https://storage.googleapis.com",
5 | "mainga": "UA-49880327-14",
6 | "updated": "2020-02-11T11:14:41Z",
7 | "id": "docs",
8 | "duration": 0,
9 | "title": "Open Banking with Apigee",
10 | "summary": "",
11 | "source": "./docs-src/docs.md",
12 | "theme": "",
13 | "status": null,
14 | "category": null,
15 | "tags": [],
16 | "ga": "UA-145683737-2",
17 | "url": "docs"
18 | }
19 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "authcode-externaltoken",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/sharedflows/clientcredentials-token/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "clientcredentials-token",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "deploy": "npm i && npx apigeetool deploySharedflow -u $APIGEE_USER -p $APIGEE_PASS -o $APIGEE_ORG -e $APIGEE_ENV -n $npm_package_name -V",
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "author": "LaughingBiscuit",
9 | "license": "NONE",
10 | "dependencies": {
11 | "apigeetool": "^0.10.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/test/Registration.feature:
--------------------------------------------------------------------------------
1 | @Registration
2 | Feature:
3 | As a client with an eIDAS cert
4 | I want to obtain credentials programmatically
5 | So that I can use the API
6 |
7 | Scenario: Dynamic Registration
8 | Given I set Content-Type header to application/json
9 | And I pipe contents of file dynamicRegistration.json to body
10 | And I provide a valid eidas cert
11 | When I POST to /identity/v1/connect/register
12 | Then response code should be 200
13 | And response body path $.client_id should be (.*)
14 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/targets/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "es6": true,
4 | "node": true
5 | },
6 | "extends": "eslint:recommended",
7 | "parserOptions": {
8 | "sourceType": "module"
9 | },
10 | "globals": {
11 | "context": false,
12 | "Request": false,
13 | "httpClient": false
14 | },
15 | "rules": {
16 | "indent": [
17 | "error",
18 | 2
19 | ],
20 | "linebreak-style": [
21 | "error",
22 | "unix"
23 | ],
24 | "quotes": [
25 | "error",
26 | "single"
27 | ],
28 | "semi": [
29 | "error",
30 | "never"
31 | ],
32 | "no-console": 0
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/app.yaml:
--------------------------------------------------------------------------------
1 | # Copyright 2019 Google LLC
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # https://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 | runtime: node
15 | runtimeVersion: 12
16 | application: sandbox
17 | env:
18 | - name: NODE_ENV
19 | value: production
20 | - name: LOG_LEVEL
21 | value: 3
22 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/policies/Shared.CORSError.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | cors-error-v1
20 |
21 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/policies/Shared.RaiseCORS.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | cors-options-v1
20 |
21 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/policies/Shared.CORSHeaders.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | cors-headers-v1
20 |
21 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "apigee-banking",
3 | "version": "1.0.0",
4 | "description": "Apigee Banking Reference Implementation",
5 | "scripts": {
6 | "deployAll": "npm run deploySharedFlows && npm run deployProxies",
7 | "deployProxies": "for DIR in $(ls apiproxies); do cd apiproxies/$DIR && npm run deploy && cd ../.. ; done",
8 | "deploySharedFlows": "for DIR in $(ls sharedflows); do cd sharedflows/$DIR && npm run deploy && cd ../.. ; done",
9 | "generateDocs": "plantuml ./docs-src/auth.flow && claat export ./docs-src/docs.md",
10 | "test": "npx cucumber-js test --tags '@OpenData or @AccountInfo or @PaymentInit'"
11 | },
12 | "keywords": [
13 | "apigee",
14 | "banking"
15 | ],
16 | "author": "LaughingBiscuit",
17 | "license": "NONE",
18 | "devDependencies": {
19 | "apickli": "^2.3.1",
20 | "cucumber": "^5.1.0",
21 | "puppeteer": "^1.16.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/manifests/hosted-target-manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/third_party/openbanking.org.uk/LICENSE:
--------------------------------------------------------------------------------
1 | MIT Licence
2 | Copyright 2019 Open Banking Limited
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5 |
6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 |
8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 |
10 | [Open License](https://www.openbanking.org.uk/open-licence)
11 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to Contribute
2 |
3 | We'd love to accept your patches and contributions to this project. There are
4 | just a few small guidelines you need to follow.
5 |
6 | ## Contributor License Agreement
7 |
8 | Contributions to this project must be accompanied by a Contributor License
9 | Agreement. You (or your employer) retain the copyright to your contribution;
10 | this simply gives us permission to use and redistribute your contributions as
11 | part of the project. Head over to to see
12 | your current agreements on file or to sign a new one.
13 |
14 | You generally only need to submit a CLA once, so if you've already submitted one
15 | (even if it was for a different project), you probably don't need to do it
16 | again.
17 |
18 | ## Code reviews
19 |
20 | All submissions, including submissions by project members, require review. We
21 | use GitHub pull requests for this purpose. Consult
22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
23 | information on using pull requests.
24 |
25 | ## Community Guidelines
26 |
27 | This project follows [Google's Open Source Community
28 | Guidelines](https://opensource.google.com/conduct/).
29 |
--------------------------------------------------------------------------------
/test/step_definitions/apickli-gherkin.js:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright 2019 Google LLC
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | https://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
16 | */
17 | module.exports = require('apickli/apickli-gherkin')
18 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/views/pages/ping.ejs:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
pong
20 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/views/partials/foot.ejs:
--------------------------------------------------------------------------------
1 |
17 |
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Apigee Banking
2 |
3 | ## User Guide
4 |
5 | [](https://apigee.github.io/openbank)
6 |
7 | __[Read the User Guide](https://apigee.github.io/openbank)__
8 |
9 | ## Previous Versions
10 |
11 | This is a refactored version of the Apigee Reference Implementation. Improvements include:
12 | - Mocks generated from Official Open Banking OpenAPI Specifications, using Hosted Targets
13 | - Smaller code base, reducing maintenance cost with new OBIE versions
14 | - Drupal 8 Kickstarter Portal
15 | - Shared flows that you can add to your own implementations
16 | - Improved documentation with CodeLabs
17 |
18 | To access the previous version, see [here](https://github.com/apigee/openbank/tree/deprecated)
19 |
20 | ## User Guide Development
21 |
22 | All documentation should be managed in the `docs-src` folder. Codelabs is used to generate the User Guide and plantuml for sequence diagrams. Install them as below.
23 |
24 | ```
25 | # Install claat
26 | go get github.com/googlecodelabs/tools/claat
27 |
28 | # Install plantuml
29 | apt-get install -y plantuml
30 |
31 | # Alternatively, you can download the plantuml jar file
32 | ```
33 |
34 | You can then use the following commands to generate and serve the docs locally.
35 |
36 | ```
37 | npm run generateDocs
38 | npm run serveDocs
39 | ```
40 |
41 | ## Disclaimer
42 |
43 | This is not an officially supported Google Product.
44 |
--------------------------------------------------------------------------------
/sharedflows/cors-error-v1/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | Assign.CORSHeaders
20 |
21 |
22 |
--------------------------------------------------------------------------------
/sharedflows/cors-headers-v1/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | Assign.CORSHeaders
20 |
21 |
22 |
--------------------------------------------------------------------------------
/sharedflows/cors-options-v1/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | RaiseCORSHeaders
20 |
21 |
22 |
--------------------------------------------------------------------------------
/apiproxies/identity-v1/apiproxy/apigee-v1.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/apiproxies/mock-tpp-v1/apiproxy/apigee-v1.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/apigee-v1.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/sharedflows/mock-jwks/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | Assign.JWKS
21 |
22 |
23 |
--------------------------------------------------------------------------------
/test/fixtures/eidasCert.txt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----\nMIIECDCCAvCgAwIBAgIEb8KUejANBgkqhkiG9w0BAQsFADCBlDELMAkGA1UEBhMC\nREUxDzANBgNVBAgMBkhlc3NlbjESMBAGA1UEBwwJRnJhbmtmdXJ0MRUwEwYDVQQK\nDAxBdXRob3JpdHkgQ0ExCzAJBgNVBAsMAklUMSEwHwYDVQQDDBhBdXRob3JpdHkg\nQ0EgRG9tYWluIE5hbWUxGTAXBgkqhkiG9w0BCQEWCmNhQHRlc3QuZGUwHhcNMTgx\nMTEzMDk0MjU4WhcNMTgxMTMwMTAyMzI3WjB6MRMwEQYDVQQDDApkb21haW5OYW1l\nMQwwCgYDVQQKDANvcmcxCzAJBgNVBAsMAm91MRAwDgYDVQQGEwdHZXJtYW55MQ8w\nDQYDVQQIDAZCYXllcm4xEjAQBgNVBAcMCU51cmVtYmVyZzERMA8GA1UEYQwIMTIz\nNDU5ODcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCygUI6R+8LEMgB\n4mVPKCq9a7AW1UuTXSXb4/GehFi+fWmcaUCUqrLamPUZKEelW2LZ92dSb/uFKA56\nYpI0kEcEwjE0DUl/7oZsdPKeSxPfixOpuj9m3V3VZIDbYxgKjnaxWHkobXCIzhHp\n7AQ6cMpPY7i4O+IXK4bY4cqImW/jBiHhV1tkAHCrRyQgb9aRDFN1CqyUdL9XBzC7\noO/GdVlfJPX8YlQz9Dd9PrXL0ORsvms2wRArVFgiDIPNcgJKGIOigHTzb66WIutu\nmBYrMcObXf+9Mb7q2KUeRFizKlO7t9H3vDmKi+nYJLNXDbJLf6+kRJj5EfMOP/MG\nXGluValZAgMBAAGjezB5MHcGCCsGAQUFBwEDBGswaTBnBgYEAIGYJwIwXTBMMBEG\nBwQAgZgnAQEMBlBTUF9BUzARBgcEAIGYJwECDAZQU1BfUEkwEQYHBACBmCcBAwwG\nUFNQX0FJMBEGBwQAgZgnAQQMBlBTUF9JQwwEQXV0aAwHR2VybWFueTANBgkqhkiG\n9w0BAQsFAAOCAQEAesGPHrsobCiPqA49tYzDpgWFm33C+9bTqisRd07bCjWWKLpw\nZsQjxZqTUVSaHedXjxF92JdWgcTtW2jhjYIiEixfaUkoEgpqPfPhDTuqpdw2dD2z\n/N0bdVuxIhxatwA/4Dh0zMO0e3GTmK0iMcRczaPuiCQiDuEaoKy+ZpDzdGfrsmDx\n5wKhIdJ/HoV/fi3gjnUcBUFI3n9MZxinPfIvbouHkRpBtyN8T25NGdpKgLX5P3l9\nyE+a+3BoVXBsDgmkuf5pkcagyWC53vZRwceBKEaRzVELmL+/9ftRm6d/DT54tCiR\nQ1q2Ca1AIXrpFAoDBAvqtQb4lyPnG6BJcwYBUg==\n-----END CERTIFICATE-----\n
--------------------------------------------------------------------------------
/sharedflows/traffic-mgmt-v1/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | Spike-Arrest-1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/apiproxies/identity-v1/apiproxy/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/apiproxies/mock-tpp-v1/apiproxy/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/sharedflows/clientcredentials-token/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | GenerateToken
21 |
22 |
23 |
--------------------------------------------------------------------------------
/sharedflows/verifyaccesstoken/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | VerifyAccessToken
21 |
22 |
23 |
--------------------------------------------------------------------------------
/sharedflows/verify-eidas-v1/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | JavaCallout.EiDAS-CertificateParse
21 |
22 |
23 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/JS.ExtractProducts.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | jsc://ExtractProducts.js
19 |
20 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/resources/jsc/ExtractProducts.js:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright 2019 Google LLC
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | https://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
16 | */
17 | var companyApp = JSON.parse(context.getVariable('createCompanyAppResponse.content'))
18 |
19 | context.setVariable('custom.apiProducts', JSON.stringify(companyApp.credentials[0].apiProducts.map(x => x.apiproduct)))
20 |
--------------------------------------------------------------------------------
/apiproxies/mock-tpp-v1/apiproxy/policies/Shared.JWKS.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Shared.JWKS
19 |
20 |
21 | mock-jwks
22 |
23 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/views/partials/header.ejs:
--------------------------------------------------------------------------------
1 |
17 |
22 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/sharedflowbundle/policies/ValidateClient.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | ValidateClient
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/apiproxies/identity-v1/apiproxy/policies/Shared.VerifyEIDAS.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Shared.VerifyEIDAS
19 |
20 |
21 | verify-eidas-v1
22 |
23 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/proxies/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | Shared.CORSError
21 |
22 | true
23 |
24 |
25 |
26 |
27 | Shared.RaiseCORS
28 | request.verb = "OPTIONS"
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Shared.CORSHeaders
37 |
38 |
39 |
40 |
41 | /
42 | secure
43 |
44 |
45 | default
46 |
47 |
48 |
--------------------------------------------------------------------------------
/sharedflows/traffic-mgmt-v1/sharedflowbundle/policies/Spike-Arrest-1.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Spike-Arrest-1
19 |
20 |
21 | 5ps
22 | false
23 |
24 |
--------------------------------------------------------------------------------
/apiproxies/identity-v1/apiproxy/policies/Shared.DynamicRegistration.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Shared.DynamicRegistration
19 |
20 |
21 | dynamic-registration
22 |
23 |
--------------------------------------------------------------------------------
/apiproxies/identity-v1/apiproxy/policies/Shared.AuthCode.ExternalToken.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Shared.AuthCode.ExternalToken
19 |
20 |
21 | authcode-externaltoken
22 |
23 |
--------------------------------------------------------------------------------
/apiproxies/identity-v1/apiproxy/policies/Shared.ClientCredentials.Token.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Shared.ClientCredentials.Token
19 |
20 |
21 | clientcredentials-token
22 |
23 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/KVM.GetMgmtCredentials.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | environment
19 |
20 |
21 | mgmtCredentials
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/public/styles.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2019 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | .demo-ribbon {
18 | width: 100%;
19 | height: 40vh;
20 | background-color: #3F51B5;
21 | -webkit-flex-shrink: 0;
22 | -ms-flex-negative: 0;
23 | flex-shrink: 0;
24 | }
25 |
26 | .demo-main {
27 | margin-top: -35vh;
28 | -webkit-flex-shrink: 0;
29 | -ms-flex-negative: 0;
30 | flex-shrink: 0;
31 | }
32 |
33 | .demo-header .mdl-layout__header-row {
34 | padding-left: 40px;
35 | }
36 |
37 | .demo-container {
38 | max-width: 1600px;
39 | width: calc(100% - 16px);
40 | margin: 0 auto;
41 | }
42 |
43 | .demo-content {
44 | border-radius: 2px;
45 | padding: 80px 56px;
46 | margin-bottom: 80px;
47 | }
48 |
49 | .demo-layout.is-small-screen .demo-content {
50 | padding: 40px 28px;
51 | }
52 |
53 | .demo-content h3 {
54 | margin-top: 48px;
55 | }
56 |
57 | .demo-footer {
58 | padding-left: 40px;
59 | }
60 |
61 | .demo-footer .mdl-mini-footer--link-list a {
62 | font-size: 13px;
63 | }
64 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/sharedflowbundle/policies/SetOAuthVariables.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | SetOAuthVariables
19 |
20 |
21 |
22 | custom.grantType
23 | password
24 |
25 | true
26 |
27 |
--------------------------------------------------------------------------------
/sharedflows/verifyaccesstoken/sharedflowbundle/policies/VerifyAccessToken.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | VerifyAccessToken
19 |
20 |
21 |
22 | false
23 | VerifyAccessToken
24 | false
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/sharedflowbundle/policies/DecodeBasicAuth.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | DecodeBasicAuth
19 |
20 |
21 |
22 | true
23 | Decode
24 |
25 | request.header.Authorization
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/Extract.ExternalCredentials.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | $.client_id
21 |
22 |
23 | $.client_secret
24 |
25 |
26 | registrationResponse
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/sharedflowbundle/policies/ExtractExternalToken.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | ExtractExternalToken
19 |
20 |
21 | true
22 |
23 |
24 | $.access_token
25 |
26 |
27 | calloutResponse
28 |
29 |
--------------------------------------------------------------------------------
/sharedflows/cors-error-v1/sharedflowbundle/policies/Assign.CORSHeaders.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | error
28 |
29 |
--------------------------------------------------------------------------------
/sharedflows/cors-headers-v1/sharedflowbundle/policies/Assign.CORSHeaders.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | response
28 |
29 |
--------------------------------------------------------------------------------
/sharedflows/mock-jwks/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/cors-error-v1/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/cors-headers-v1/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/cors-options-v1/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/traffic-mgmt-v1/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/clientcredentials-token/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/verifyaccesstoken/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/apiproxies/mock-tpp-v1/apiproxy/proxies/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Shared.JWKS
24 |
25 |
26 | request.verb = "GET" and proxy.pathsuffix = "/my_public_keys.jwks"
27 |
28 |
29 |
30 | /tpp/v1
31 | secure
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/Assign.Response.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Assign.Response
19 |
20 |
21 |
22 |
23 | {
24 | "client_id": "£custom.clientId$",
25 | "client_secret": "£custom.clientSecret$"
26 | }
27 |
28 |
29 | false
30 | response
31 |
32 |
--------------------------------------------------------------------------------
/sharedflows/clientcredentials-token/sharedflowbundle/policies/GenerateToken.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | GenerateToken
19 |
20 |
21 |
22 | false
23 | GenerateAccessToken
24 |
25 | FORM_PARAM
26 |
27 | false
28 |
29 | client_credentials
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/sharedflows/verify-eidas-v1/sharedflowbundle/policies/JavaCallout.EiDAS-CertificateParse.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | JavaCallout.EiDAS-CertificateParse
19 |
20 |
21 | show
22 | flow.certinfo
23 | request.header.SSL-CLIENT-CERT
24 |
25 | com.exco.eidas.EiDASCertificateParserCallout
26 | java://eidas-certificate-parser-1.0.0.jar
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | DecodeBasicAuth
21 |
22 |
23 |
24 | ValidateClient
25 |
26 |
27 |
28 | GenerateToken
29 |
30 |
31 |
32 | ExtractExternalToken
33 |
34 |
35 |
36 | SetOAuthVariables
37 |
38 |
39 |
40 | AttachExternalToken
41 |
42 |
43 |
--------------------------------------------------------------------------------
/apiproxies/identity-v1/apiproxy/policies/add-cors.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Add CORS
19 |
20 |
21 |
22 |
23 |
24 | origin, x-requested-with, accept
25 |
26 |
27 |
28 |
29 | true
30 |
31 |
32 |
--------------------------------------------------------------------------------
/apiproxies/mock-tpp-v1/apiproxy/policies/add-cors.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Add CORS
19 |
20 |
21 |
22 |
23 |
24 | origin, x-requested-with, accept
25 |
26 |
27 |
28 |
29 | true
30 |
31 |
32 |
--------------------------------------------------------------------------------
/test/step_definitions/init.js:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright 2019 Google LLC
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | https://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
16 | */
17 | const apickli = require('apickli')
18 | const {
19 | Before,
20 | Given,
21 | setDefaultTimeout
22 | } = require('cucumber')
23 | const fs = require('fs')
24 | const org = process.env.APIGEE_ORG
25 | const env = process.env.APIGEE_ENV
26 |
27 | Before(function() {
28 | this.apickli = new apickli.Apickli('https',
29 | org + '-' + env + '.apigee.net')
30 | this.apickli.fixturesDirectory = './test/fixtures'
31 | this.apickli.scenarioVariables.clientId = 'foo'
32 | this.apickli.scenarioVariables.clientSecret = 'bar'
33 | })
34 |
35 | Given('I provide a valid eidas cert', function(cb) {
36 | fs.readFile(this.apickli.fixturesDirectory + '/eidasCert.txt',
37 | (err, data) => {
38 | cb(this.apickli.addRequestHeader('SSL-CLIENT-CERT', data))
39 | })
40 | })
41 |
42 | setDefaultTimeout(60 * 1000)
43 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/support/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "features": {
3 | "discovery": true,
4 | "request": true,
5 | "registration": {
6 | "enabled": true,
7 | "initialAccessToken": false
8 | }
9 | },
10 | "format": {
11 | "default": "opaque"
12 | },
13 | "keys": [{
14 | "e": "AQAB",
15 | "n": "zUNZ6v30_8tZGfRiZMY9UUO86rmnNKMVDk4xm4WvVsZO4xS4APgpeReZYu9IfNcEZZ3RGcpvQ5yyL_-OglXQJ6EdLI0FsuyK9PGvYv7DgjonCJBkM9b70zft6-a-Gwy8_GxdzHYiAb0v7089Zruzkk5bN_9tTlzXjUxBpJIaZlFLK1SLH1O88bxCUkiV6YZ6CEoQ_HYkQBJiM88Jz0PkTu_cDnCAlo4o_4geauOqnw5TNFZuTEl8wZ2Smu9rIKvRgLGO643XPl-Lo3_YBm0LwuOQfqqzAtnvU7pOOPNK967fTxGMxumrDhi5VOKIPtFbx3caz81mnKO0RdsQUce0ow",
16 | "d": "PKhlnxsTVrAaEaB1n0AyCJzS7C6W6egzpbmX0VTNPwB1eYe65JZxcxZ1PpZlvnawFvNvQobfIITi52pHC98eF0f2Xh8CiyB54-60HLYawpY6yL4aznL-kimaBrd2gHngM1w2z-AtJoRo8PhitcRMSbUcIc062Qh4ronVcDO413kxBwU0Nbm0xSPl_JsXiD7AacEMLRIPhzx1ofrK8w9wdP7_hvZR3Ezex8WLUP7qH7Nq88WYqPkPfH18drzt-4u_5grEIcMqQSCo9H4-Nc98rpnUwPPG0wyytbGYNl_mETBPfqvRNMLCV-aF7wjCvWOxfhxRm9vFIkdGRqAlxGJO6Q",
17 | "p": "7KiBt_wbfmw-Rkg-mEFLKkoE4fSZYS9BMf1gMBkfwzIgi2JjJtiwC_ELbCZFehBoZZELTRAMx0TB7P1U0eev4M36Fs3zp-6X8VFi8$qXfpRoBRqfjar1z-weTcW4i9PUaBy23sGAR0hGLbSk65TSc5X7OZEg1gh2p__Uh3R7X-c",
18 | "q": "3gn6bIY9U6V8JT9VnHwJ-MylTv275KmwCdV74noqDru3Bq0clJhHNi0cGGz1Eoe6UMlJ_MIhLqc1wdIWvGCM3EdLpQ0TTe9Ja1PUIK2av-z6lNumRCu8IIlMiMIdfRLSuU1NZZ3VQ26R3sMWm4nbLejWmecp3JjSzIJthuNMXeU",
19 | "dp": "fOcul4kyhZXhhDyK9Na5Mheg3hS3guhq01R0GM6Zye7B6G7D__OrbpIIwkqsrpDMWJalzUVkSSOL6mWGB8btN4veq3yFVaOCg_W9cSFYJZF0GQWFIkMRu2xWThvFm97wIwbMqWKdLoIBsAvAYynHrQOCdU6Ycv5CicZnSBp9Jw8",
20 | "dq": "UEdNSpWScL7BTvpCKszSEilzj0a_-2G6qyOLogvHTwJhn0FRtwwDmzveD5q9VNDL9U-Bt6g8tRBxqD0cSUmjRDVmzSsYErJ0WiC57oK2E7RLuSxdRgKGB0F88Wk1njYDCEpBtH7HT5UXmnHwp5XFMCkiBg0FHqQGezig_wcJYl0",
21 | "qi": "h48OH9ffL0nu8rGTRpYOFVEcrXdruuDLZxzeYt7FGOJIes7hvwElmI_oXSOeBwVDKJp84u0KXNsDL1icjfLKg3ShslcGtsX_uqKEaQlLIsMShNCpKqy0sRfi_LdfjhTbtODwye7HELfLEcQAARIrgwq9QicV_6PmveqZ2Wy5oUw",
22 | "kty": "RSA",
23 | "kid": "lThWGW0co9l4atv-H9Cshm-ad6uda4spLy2WtDLHG4w",
24 | "alg": "RS256",
25 | "use": "sig"
26 | }]
27 | }
28 |
--------------------------------------------------------------------------------
/sharedflows/mock-jwks/sharedflowbundle/policies/Assign.JWKS.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Assign.JWKS
19 |
20 |
21 |
22 |
23 | {"keys":[{"e":"AQAB","n":"vMThmxgTfEjyjAOMzN1avb_wiYQ-zJg1NCccQnEV3JSQkWi6Y5VzWF3bBrDHDF_8az7UF4hxXuLguJOrUfIZPWpO7-bUdEREzN9H118Wg0mhJL0_81Vz29XmSD63CA5NDKY2srS3oYH19TK_O6E56B-4Cq5HJAwat7CNMEcr4-DGX1HWAdJIVEkq2dBqrDMpzUoVt3UNLqZvs5FPIprYcQsQKBwhM91MljiUc_Lw_uFXFOUF4bbevlOh5I0x9rZGqdfh4rzybOt1GgXHvV4flLl7dtFqAxZRk6JazEyermS02UYUe1FyjmR6pfFVkmHRNJAKq7iHQYm_LPbX6pvQGw","kty":"RSA","kid":"QgG_5-ALorr1x6eIsc3h3O97E0P-bIxd7Zq1JtBQJ1Y","alg":"RS256","use":"sig"}]}
24 |
25 |
26 | false
27 |
28 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/sharedflowbundle/policies/AttachExternalToken.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | AttachExternalToken
19 |
20 |
21 |
22 | custom.accessToken
23 | false
24 | custom.grantType
25 | GenerateAccessToken
26 | messageid
27 |
28 | FORM_PARAM
29 |
30 | false
31 |
32 | password
33 |
34 |
35 | messageid
36 |
37 |
--------------------------------------------------------------------------------
/sharedflows/cors-options-v1/sharedflowbundle/policies/RaiseCORSHeaders.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Raise.CORSHeaders
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | 200
30 | OK
31 |
32 |
33 | true
34 |
35 |
--------------------------------------------------------------------------------
/test/fixtures/paymentConsent.json:
--------------------------------------------------------------------------------
1 | {
2 | "Data": {
3 | "Initiation": {
4 | "InstructionIdentification": "string",
5 | "EndToEndIdentification": "string",
6 | "LocalInstrument": "UK.OBIE.BACS",
7 | "InstructedAmount": {
8 | "Amount": "5.00",
9 | "Currency": "GBP"
10 | },
11 | "DebtorAccount": {
12 | "SchemeName": "UK.OBIE.BBAN",
13 | "Identification": "string",
14 | "Name": "string",
15 | "SecondaryIdentification": "string"
16 | },
17 | "CreditorAccount": {
18 | "SchemeName": "UK.OBIE.BBAN",
19 | "Identification": "string",
20 | "Name": "string",
21 | "SecondaryIdentification": "string"
22 | },
23 | "CreditorPostalAddress": {
24 | "AddressType": "Business",
25 | "Department": "string",
26 | "SubDepartment": "string",
27 | "StreetName": "string",
28 | "BuildingNumber": "string",
29 | "PostCode": "string",
30 | "TownName": "string",
31 | "CountrySubDivision": "string",
32 | "Country": "GB",
33 | "AddressLine": [
34 | "string"
35 | ]
36 | },
37 | "RemittanceInformation": {
38 | "Unstructured": "string",
39 | "Reference": "string"
40 | },
41 | "SupplementaryData": {
42 | }
43 | },
44 | "Authorisation": {
45 | "AuthorisationType": "Any",
46 | "CompletionDateTime": "2019-06-26T17:58:44.331Z"
47 | },
48 | "SCASupportData": {
49 | "RequestedSCAExemptionType": "BillPayment",
50 | "AppliedAuthenticationApproach": "CA",
51 | "ReferencePaymentOrderId": "string"
52 | }
53 | },
54 | "Risk": {
55 | "PaymentContextCode": "BillPayment",
56 | "MerchantCategoryCode": "CAT",
57 | "MerchantCustomerIdentification": "string",
58 | "DeliveryAddress": {
59 | "AddressLine": [
60 | "string"
61 | ],
62 | "StreetName": "string",
63 | "BuildingNumber": "string",
64 | "PostCode": "string",
65 | "TownName": "string",
66 | "CountrySubDivision": ["string"],
67 | "Country": "GB"
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/sharedflows/mock-jwks/sharedflowbundle/mock-jwks.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1557476883685
20 | davissean@google.com
21 |
22 | Shared-Flow
23 | 1557476883685
24 | davissean@google.com
25 | SHA-512:8219a544686cc2ad1beec4d504d2e32fab3afc1ae3480338e3fd5d5b52f32093a7288bdec6b4c19bc80b3772b2dec769c10cb00ff5a56d1daf8761cee8dbb27a:eu-west-1
26 |
27 | Assign.JWKS
28 |
29 |
30 |
31 | SharedFlow
32 |
33 | default
34 |
35 |
36 |
--------------------------------------------------------------------------------
/test/AccountInfo.feature:
--------------------------------------------------------------------------------
1 | @AccountInfo
2 | Feature:
3 | As a TPP
4 | I want to access Account Information APIs
5 | So that I can view accounts, transactions and balances
6 |
7 | Scenario: Client Credentials Access Token
8 | Given I have basic authentication credentials `clientId` and `clientSecret`
9 | And I set form parameters to
10 | | parameter | value |
11 | | grant_type | client_credentials |
12 | When I POST to /identity/v1/token
13 | Then response code should be 200
14 | And I store the value of body path $.access_token as clientToken in global scope
15 |
16 | Scenario: Create Account Access Consent
17 | Given I set x-fapi-financial-id header to 123
18 | And I set Authorization header to Bearer `clientToken`
19 | And I pipe contents of file accountAccessConsent.json to body
20 | And I set Content-Type header to application/json
21 | When I POST to /ais-sandbox/open-banking/v3.1/aisp/account-access-consents
22 | Then response code should be 201
23 | And response body path $.Data.ConsentId should be (.+)
24 |
25 | Scenario: User Authorizes
26 | Given I navigate to the authorize page
27 | When I sign in and consent
28 | Then I am redirected to the TPP
29 | And I receive an auth code in a query param
30 | And I store the auth code in global scope
31 |
32 | Scenario: Generate Access Token
33 | Given I have basic authentication credentials `clientId` and `clientSecret`
34 | And I set form parameters to
35 | | parameter | value |
36 | | grant_type | authorization_code |
37 | | code | `authCode` |
38 | When I POST to /identity/v1/token
39 | Then response code should be 200
40 | And I store the value of body path $.access_token as userToken in global scope
41 |
42 | Scenario: TPP Accesses Account Information
43 | Given I set Authorization header to Bearer `userToken`
44 | And I set x-fapi-financial-id header to test
45 | When I GET /ais-sandbox/open-banking/v3.1/aisp/accounts
46 | Then response code should be 200
47 | And response body path $.Data.Account should be of type array
48 |
--------------------------------------------------------------------------------
/sharedflows/verify-eidas-v1/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/sharedflows/cors-error-v1/sharedflowbundle/cors-error-v1.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1561573228997
20 | davissean@google.com
21 | undefined
22 | cors-error-v1
23 | 1561573228997
24 | davissean@google.com
25 | SHA-512:63f3c8a87273eb1670620f5a1240ee1dd51541f482ed75756450ebd880dfb1a6eb74012aadd86faca85e09404bc3533c2639d3ed295ecd945293b8f0c285ff6d
26 |
27 | Assign.CORSHeaders
28 |
29 |
30 |
31 | SharedFlow
32 |
33 | default
34 |
35 |
36 |
--------------------------------------------------------------------------------
/sharedflows/traffic-mgmt-v1/sharedflowbundle/traffic-mgmt-v1.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1557476891576
20 | davissean@google.com
21 |
22 | Shared-Flow
23 | 1557476891576
24 | davissean@google.com
25 | SHA-512:477167efd4f8cbb50a2c0cfb0f2220395283c9414eadb9d1f2bad18f227c96c90a9014d64e809559a72deaebefeeaaca046252139e4cce4f9f04007323da1121:eu-west-1
26 |
27 | Spike-Arrest-1
28 |
29 |
30 |
31 | SharedFlow
32 |
33 | default
34 |
35 |
36 |
--------------------------------------------------------------------------------
/sharedflows/cors-options-v1/sharedflowbundle/cors-options-v1.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1561573323782
20 | davissean@google.com
21 | undefined
22 | cors-options-v1
23 | 1561573409301
24 | davissean@google.com
25 | SHA-512:722ade5449baef7b6625586111727bc166e1dcd397d054a2ea1a6e13c792a4f335188ba2dc0312c1629e15e566eea275b9e8c3144137a4470c9a7f62ab3896a2
26 |
27 | RaiseCORSHeaders
28 |
29 |
30 |
31 | SharedFlow
32 |
33 | default
34 |
35 |
36 |
--------------------------------------------------------------------------------
/sharedflows/cors-headers-v1/sharedflowbundle/cors-headers-v1.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1561573228997
20 | davissean@google.com
21 | undefined
22 | cors-headers-v1
23 | 1561573228997
24 | davissean@google.com
25 | SHA-512:63f3c8a87273eb1670620f5a1240ee1dd51541f482ed75756450ebd880dfb1a6eb74012aadd86faca85e09404bc3533c2639d3ed295ecd945293b8f0c285ff6d
26 |
27 | Assign.CORSHeaders
28 |
29 |
30 |
31 | SharedFlow
32 |
33 | default
34 |
35 |
36 |
--------------------------------------------------------------------------------
/sharedflows/verifyaccesstoken/sharedflowbundle/verifyaccesstoken.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1557476900377
20 | davissean@google.com
21 |
22 | Shared-Flow
23 | 1557476900377
24 | davissean@google.com
25 | SHA-512:410faa0d494395e157e6b61f97e023ba0572f8936b408c085892acd6e96cdc8d7f4de60fd8e98026ce26f9c64b69fbc01ea7ded69a485d0bda06522c6001a801:eu-west-1
26 |
27 | VerifyAccessToken
28 |
29 |
30 |
31 | SharedFlow
32 |
33 | default
34 |
35 |
36 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/Extract.RegisterApp.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Extract.RegisterApp
19 |
20 |
21 | false
22 |
23 |
24 | $.redirect_uris[0]
25 |
26 |
27 | $.jwks_uri
28 |
29 |
30 | $.contacts[0]
31 |
32 |
33 | $.client_name
34 |
35 |
36 | request
37 |
38 |
--------------------------------------------------------------------------------
/sharedflows/clientcredentials-token/sharedflowbundle/clientcredentials-token.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1557476864744
20 | davissean@google.com
21 |
22 | Shared-Flow
23 | 1557476864744
24 | davissean@google.com
25 | SHA-512:1db261826fc18a58d850a8c98b5539a34afb38ba0a103208a5e0977f277cee448061d50ff1f5d7e1254623fcf5ba2f9f85a7b4ce55191b5d925a3478153e4d0d:eu-west-1
26 |
27 | GenerateToken
28 |
29 |
30 |
31 | SharedFlow
32 |
33 | default
34 |
35 |
36 |
--------------------------------------------------------------------------------
/test/PaymentInitiation.feature:
--------------------------------------------------------------------------------
1 | @PaymentInit
2 | Feature:
3 | As a TPP
4 | I want to access Payment Initiation APIs
5 | So that I can process payments
6 |
7 | Scenario: Client Credentials Access Token
8 | Given I have basic authentication credentials `clientId` and `clientSecret`
9 | And I set form parameters to
10 | | parameter | value |
11 | | grant_type | client_credentials |
12 | When I POST to /identity/v1/token
13 | Then response code should be 200
14 | And I store the value of body path $.access_token as clientToken in global scope
15 |
16 | Scenario: Create Domestic Payment Consent
17 | Given I set x-fapi-financial-id header to 123
18 | And I set x-idempotency-key header to 123
19 | And I set x-jws-signature header to 123
20 | And I set Authorization header to Bearer `clientToken`
21 | And I set Content-Type header to application/json
22 | And I pipe contents of file paymentConsent.json to body
23 | When I POST to /pis-sandbox/open-banking/v3.1/pisp/domestic-payment-consents
24 | Then response code should be 201
25 | And response body path $.Data.ConsentId should be (.+)
26 |
27 | Scenario: User Authorizes
28 | Given I navigate to the authorize page
29 | When I sign in and consent
30 | Then I am redirected to the TPP
31 | And I receive an auth code in a query param
32 | And I store the auth code in global scope
33 |
34 | Scenario: Generate Access Token
35 | Given I have basic authentication credentials `clientId` and `clientSecret`
36 | And I set form parameters to
37 | | parameter | value |
38 | | grant_type | authorization_code |
39 | | code | `authCode` |
40 | When I POST to /identity/v1/token
41 | Then response code should be 200
42 | And I store the value of body path $.access_token as userToken in global scope
43 |
44 | Scenario: TPP Accesses Account Information
45 | Given I set Authorization header to Bearer `userToken`
46 | And I set x-fapi-financial-id header to test
47 | When I GET /pis-sandbox/open-banking/v3.1/pisp/domestic-payments/123
48 | Then response code should be 200
49 | And response body path $.Data.DomesticPaymentId should be (.+)
50 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/views/partials/head.ejs:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 | Login
23 |
24 |
25 |
26 |
27 |
28 |
29 |
40 |
41 |
--------------------------------------------------------------------------------
/sharedflows/verify-eidas-v1/sharedflowbundle/verify-eidas-v1.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1557818438171
20 | davissean@google.com
21 |
22 | Shared-Flow
23 | 1557818438171
24 | davissean@google.com
25 | SHA-512:d453696cb5b3fe5d2bbc135550f84a9796d49c18f6fc48000c360a22404b96e0944d7ee9fb3e5e2c1442b233a1937cdd91a4cfca62f52c5a7a9d215f31d438f7:eu-west-1
26 |
27 | JavaCallout.EiDAS-CertificateParse
28 |
29 |
30 | java://eidas-certificate-parser-1.0.0.jar
31 |
32 |
33 | SharedFlow
34 |
35 | default
36 |
37 |
38 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/Callout.AssociateCredentials.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 | {private.mgmtCredentials}
22 |
23 |
24 | {
25 | "apiProducts":£custom.apiProducts$
26 | }
27 |
28 | POST
29 |
30 | false
31 |
32 | associateCredentialsResponse
33 |
34 |
35 | https://api.enterprise.apigee.net/v1/o/{organization.name}/companies/{client.received.start.timestamp}/apps/{custom.clientName}/keys/{custom.clientId}
36 |
37 |
38 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/sharedflowbundle/policies/GenerateToken.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | GenerateToken
19 |
20 |
21 |
22 |
23 |
24 | {request.header.Authorization}
25 |
26 |
27 | {request.formparam.code}
28 | {request.formparam.grant_type}
29 |
30 |
31 | false
32 |
33 | calloutResponse
34 |
35 |
36 | https://{organization.name}-{environment.name}.apigee.net/mock-idp/token
37 |
38 |
39 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/sharedflows/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | KVM.GetMgmtCredentials
21 |
22 |
23 |
24 | Extract.RegisterApp
25 |
26 |
27 |
28 | Callout.CreateCompany
29 |
30 |
31 |
32 | Callout.RegisterAppExternal
33 |
34 |
35 | Extract.ExternalCredentials
36 |
37 |
38 |
39 | Callout.CreateCompanyApp
40 |
41 |
42 | JS.ExtractProducts
43 |
44 |
45 | Callout.CreateCredentialPair
46 |
47 |
48 | Callout.AssociateCredentials
49 |
50 |
51 |
52 | Assign.Response
53 |
54 |
55 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/Callout.CreateCredentialPair.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 | {private.mgmtCredentials}
22 |
23 |
24 | {
25 | "consumerKey":"£custom.clientId$",
26 | "consumerSecret":"£custom.clientSecret$"
27 | }
28 |
29 | POST
30 |
31 | false
32 |
33 | createCredentialPairResponse
34 |
35 |
36 | https://api.enterprise.apigee.net/v1/o/{organization.name}/companies/{client.received.start.timestamp}/apps/{custom.clientName}/keys/create
37 |
38 |
39 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/Callout.RegisterAppExternal.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Callout.RegisterAppExternal
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | {
28 | "redirect_uris": ["https://httpbin.org/get"],
29 | "jwks_uri": "https://£organization.name$-£environment.name$.apigee.net/tpp/v1/my_public_keys.jwks"
30 | }
31 |
32 |
33 | false
34 |
35 | registrationResponse
36 |
37 |
38 | https://{organization.name}-{environment.name}.apigee.net/mock-idp/reg
39 |
40 |
41 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/dynamic-registration.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1557483860202
20 | davissean@google.com
21 |
22 | Shared-Flow
23 | 1557483860202
24 | davissean@google.com
25 | SHA-512:e3e7a74413c43bd263ce3c56a01b5598a8e7f815471946fe57d1fcdb6524ba6f9354b0058f1836b00d7e8677c63605b96dd566f7268746adb454557606a101c7:eu-west-1
26 |
27 | Assign.Response
28 | Callout.CreateCompany
29 | Callout.CreateCompanyApp
30 | Callout.RegisterAppExternal
31 | Extract.RegisterApp
32 |
33 |
34 |
35 | SharedFlow
36 |
37 | default
38 |
39 |
40 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/sharedflowbundle/authcode-externaltoken.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 | 1557476854363
20 | davissean@google.com
21 |
22 | Shared-Flow
23 | 1557476854363
24 | davissean@google.com
25 | SHA-512:c50b4ed1dd6522c918a0e270caf9415b0d859698bc8c94c728bba1b3d0464ee98e4cb43d12f442c2b6ee38014a8cc7ce87f11ba396e1f9f7d51820c8e5f57811:eu-west-1
26 |
27 | AttachExternalToken
28 | DecodeBasicAuth
29 | ExtractExternalToken
30 | GenerateToken
31 | SetOAuthVariables
32 | ValidateClient
33 |
34 |
35 |
36 | SharedFlow
37 |
38 | default
39 |
40 |
41 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/Callout.CreateCompanyApp.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Callout.CreateCompanyApp
19 |
20 |
21 |
22 |
23 |
24 | {private.mgmtCredentials}
25 |
26 |
27 | {
28 | "apiProducts": [ "openbanking"],
29 | "name" : "£custom.clientName$",
30 | "callbackUrl" : "£custom.redirectUri$"
31 | }
32 |
33 | POST
34 |
35 | false
36 |
37 | createCompanyAppResponse
38 |
39 |
40 | https://api.enterprise.apigee.net/v1/o/{organization.name}/companies/{client.received.start.timestamp}/apps
41 |
42 |
43 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/policies/Callout.CreateCompany.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | Callout.CreateCompany
19 |
20 |
21 |
22 |
23 |
24 | {private.mgmtCredentials}
25 |
26 |
27 | {
28 | "name": "£client.received.start.timestamp$",
29 | "displayName": "£client.received.start.timestamp$",
30 | "attributes": [{
31 | "name": "ADMIN_EMAIL",
32 | "value": "£custom.developerEmail$"
33 | }]
34 | }
35 |
36 | POST
37 |
38 | false
39 |
40 | createCompanyResponse
41 |
42 |
43 | https://api.enterprise.apigee.net/v1/o/{organization.name}/companies
44 |
45 |
46 |
--------------------------------------------------------------------------------
/apiproxies/identity-v1/apiproxy/proxies/default.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 | request.formparam.grant_type = "authorization_code"
23 | Shared.AuthCode.ExternalToken
24 |
25 |
26 | request.formparam.grant_type = "client_credentials"
27 | Shared.ClientCredentials.Token
28 |
29 |
30 | request.verb = "POST" and proxy.pathsuffix MatchesPath "/token"
31 |
32 |
33 |
34 |
35 | Shared.VerifyEIDAS
36 |
37 |
38 | Shared.DynamicRegistration
39 |
40 |
41 | request.verb = "POST" and proxy.pathsuffix MatchesPath "/connect/register"
42 |
43 |
44 |
45 | /identity/v1
46 | secure
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/sharedflows/dynamic-registration/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/docs-src/auth.flow:
--------------------------------------------------------------------------------
1 | @startuml
2 |
3 | participant User as u
4 | participant App as b
5 | participant "Identity Proxy" as id
6 | participant IdP as idp
7 | participant "Consent Store" as cs
8 | participant "Accounts Service" as as
9 | participant "Data Proxy" as d
10 |
11 | note over u,d: Stage consent
12 | u -> b: Link account
13 | b -> id: POST /token (client credentials)
14 | id -> b: access_token
15 | b -> d: POST /account-access-consents (access_token)
16 | d -> cs: create consent record
17 | cs -> d: ConsentID
18 | d -> b: ConsentID
19 | note over u,d: Initiate Auth Sequence
20 | b -> b: generate request JWT
21 |
22 | b -> id: GET /authorize\n(tpp_client_id, state1, redirect_uri, response_type=code, request)
23 | id -> id: validate client_id,\nredirect_uri
24 | id -> id: retrieve apigee client\ncredentials from KVM
25 | id -> id: generate state2
26 | id -> b: 302 -> /authorize\n(apigee_client_id, state2,\napigee_callback, response_type=code)
27 | note over u,d: User Auth
28 | b -> idp: GET /authorize\n(apigee_client_id, state2,\napigee_callback, response_type=code)
29 | idp -> b: login form
30 | u -> idp: credentials (u, p, otp)
31 | idp -> b: 302 -> /apigee_callback\n(code, state2)
32 | note over u,d: Token Issuance
33 | b -> id: GET /apigee_callback\n(code, state2)
34 | id -> id: extract params from state2
35 | id -> id: retrieve apigee client\ncredentials from KVM
36 | id -> idp: POST /oauth/token (code, client credentials)
37 | idp -> id: access_token, refresh_token,\nid_token, expires_in
38 | id -> id: extract user ID from id_token
39 | id -> as: fetch accounts by user ID
40 | as -> id: list of all appropriate accounts
41 | id -> id: extract intent_id from request jwt (from state2)
42 | id -> cs: lookup intent_id
43 | cs -> id: requested permissions
44 | id -> cs: add user ID and all state2 values\n(e.g. redirect_uri, state1) to consent record
45 | id -> id: extract TPP app name etc. with policy
46 | id -> id: generate signed-JWT\ncontaining intent_id
47 | id -> id: generate consent page html\n(including hidden field for JWT)
48 | id -> b: consent page
49 | u -> b: approve consent
50 | b -> id: POST /consent/submission
51 | id -> id: verify JWT
52 | id -> id: extract intent_id from JWT
53 | id -> cs: update consent to approved and add selected account(s)
54 | cs -> id: redirect_uri, state1
55 | id -> id: generate authorization code\n(add all data/variables as attributes)
56 | id -> b: 302 /redirect_uri\n(code, state1)
57 | b -> id: POST /token\n(code, client credentials)
58 | id -> id: validate client credentials
59 | id -> id: exchange code for tokens
60 | id -> b: 200 access_token, refresh_token, expires_in, state1
61 |
62 | note over u,d: Request for data with token
63 | u -> b: do something
64 | b -> d: request data (access token)
65 | d -> d: validate access token
66 | d -> b: requested data
67 |
68 | @enduml
69 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/views/pages/consent.ejs:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | <% include ../partials/head %>
20 |
21 |
22 |
46 | <% include ../partials/foot %>
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/sharedflows/authcode-externaltoken/sharedflowbundle/manifests/manifest.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/test/step_definitions/ui.js:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright 2019 Google LLC
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | https://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
16 | */
17 | const {
18 | Given,
19 | When,
20 | Then,
21 | After
22 | } = require('cucumber')
23 | const puppeteer = require('puppeteer')
24 | const org = process.env.APIGEE_ORG
25 | const env = process.env.APIGEE_ENV
26 |
27 | Given('I navigate to the authorize page', async function() {
28 | this.browser = await puppeteer.launch()
29 | this.page = await this.browser.newPage()
30 | return await this.page.goto('https://' + org + '-' + env +
31 | '.apigee.net/mock-idp/auth?client_id=' + this.apickli.scenarioVariables.clientId
32 | + '&redirect_uri=https://httpbin.org/get&response_type=code&scope=openid&state=123')
33 | })
34 |
35 | When('I sign in and consent', async function() {
36 | //fill in login page
37 | await this.page.click('#login')
38 | await this.page.keyboard.type('user@example.com')
39 | await this.page.click('#password')
40 | await this.page.keyboard.type('password')
41 |
42 | //submit
43 | await Promise.all([
44 | this.page.click('#submit'),
45 | this.page.waitForNavigation()
46 | ])
47 |
48 | //return submit
49 | return await Promise.all([
50 | this.page.click('#submit'),
51 | this.page.waitForNavigation()
52 | ])
53 |
54 | })
55 |
56 | Then('I am redirected to the TPP', function(cb) {
57 | cb(this.page.url().indexOf('https://httpbin.org/get') === -1)
58 |
59 | })
60 |
61 | Then('I receive an auth code in a query param', function(cb) {
62 | cb(this.page.url().indexOf('code=') === -1)
63 | })
64 |
65 | Then('I store the auth code in global scope', async function() {
66 | this.apickli.setGlobalVariable('authCode',
67 | new URL(this.page.url()).searchParams.get('code'))
68 | })
69 |
70 | After(async function() {
71 | if (this.browser) this.browser.close()
72 | })
73 |
74 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/views/pages/login.ejs:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | <% include ../partials/head %>
20 |
21 |
22 |
46 | <% include ../partials/foot %>
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/app.js:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright 2020 Google LLC
3 |
4 | Licensed under the Apache License, Version 2.0 (the 'License');
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | https://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an 'AS IS' BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
16 | */
17 |
18 | /* eslint no-console:off */
19 | const express = require('express')
20 | const http = require('http')
21 | const path = require('path')
22 | const fs = require('fs')
23 | const swaggerTools = require('swagger-tools')
24 | const async = require('async')
25 | const Provider = require('oidc-provider')
26 | const configuration = require('./support/config')
27 | const routes = require('./support/routes')
28 | const clients = require('./support/clients')
29 |
30 | const app = express()
31 | const serverPort = process.env.PORT || 9000
32 | const specDir = './specs/'
33 | const specs = fs.readdirSync(specDir)
34 |
35 |
36 | const oidc = new Provider('https://localhost:9000/', configuration)
37 | app.set('views', path.join(__dirname, 'views'))
38 | app.set('view engine', 'ejs')
39 | app.use(express.static('public'))
40 |
41 | const initializeSandbox = (spec, cb) => {
42 | const basepath = '/' + path.parse(spec).name + '/'
43 | swaggerTools.initializeMiddleware(require(specDir + spec), function(middleware) {
44 | app.use(basepath, middleware.swaggerMetadata())
45 | app.use(basepath, middleware.swaggerValidator())
46 | app.use(basepath, middleware.swaggerRouter({
47 | useStubs: true
48 | }))
49 | cb(null)
50 | })
51 | }
52 |
53 | const initializeIdentity = (cb) => {
54 | oidc.initialize({
55 | clients: clients
56 | })
57 | .then(() => {
58 | console.log(oidc)
59 | routes(app, oidc)
60 | app.use('/mock-idp/', oidc.callback)
61 | app.enable('trust proxy')
62 | oidc.proxy = true
63 |
64 | cb(null)
65 | })
66 | }
67 |
68 | const functions = specs.map((spec => (cb) => initializeSandbox(spec, cb)))
69 | functions.push(initializeIdentity)
70 |
71 | async.waterfall(functions,
72 | (err) => {
73 | if (err) {
74 | console.log(err)
75 | } else {
76 | http.createServer(app).listen(serverPort)
77 | console.log('Run server on port: ' + serverPort)
78 | }
79 | }
80 | )
81 |
--------------------------------------------------------------------------------
/apiproxies/sandboxes-v1/apiproxy/resources/hosted/support/routes.js:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright 2019 Google LLC
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | https://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
16 | */
17 | const {
18 | urlencoded
19 | } = require('express')
20 | const body = urlencoded({
21 | extended: false
22 | })
23 |
24 | module.exports = (app, provider) => {
25 |
26 | //check that the application is up
27 | app.get('/mock-idp/ping', (req, res) => {
28 | res.render('pages/ping')
29 | })
30 |
31 | //get login page
32 | app.get('/mock-idp/interaction/:grant', async (req, res, next) => {
33 | try {
34 | const details = await provider.interactionDetails(req)
35 |
36 | //validate that some consent id is provided
37 | console.log(JSON.stringify(details))
38 |
39 | return res.render('pages/login', {
40 | details
41 | })
42 | } catch (err) {
43 | return next(err)
44 | }
45 | })
46 |
47 |
48 |
49 | //submit login
50 | app.post('/mock-idp/interaction/:grant/login', body, async (req, res, next) => {
51 | res.set('Pragma', 'no-cache')
52 | res.set('Cache-Control', 'no-cache, no-store')
53 | try {
54 |
55 | const result = {
56 | account: 'username'
57 | }
58 | await provider.setProviderSession(req, res, result)
59 | res.status(302).set({
60 | Location: '/mock-idp/interaction/' + req.params.grant + '/consent'
61 | }).send()
62 | } catch (err) {
63 | next(err)
64 | }
65 | })
66 |
67 | //get consent
68 | app.get('/mock-idp/interaction/:grant/consent', body, async (req, res, next) => {
69 | try {
70 | const details = await provider.interactionDetails(req)
71 | return res.render('pages/consent', {
72 | details,
73 | })
74 | } catch (err) {
75 | return next(err)
76 | }
77 | })
78 |
79 | //submit consent
80 | app.post('/mock-idp/interaction/:grant/consent', body, async (req, res, next) => {
81 | res.set('Pragma', 'no-cache')
82 | res.set('Cache-Control', 'no-cache, no-store')
83 | try {
84 | const result = {
85 | login: {
86 | account: 'username',
87 | acr: 'urn:mace:incommon:iap:bronze',
88 | amr: ['pwd'],
89 | remember: false,
90 | ts: Math.floor(Date.now() / 1000),
91 | },
92 | }
93 | if (req.body.consent) result.consent = {}
94 |
95 | const redirectTo = await provider.interactionResult(req, res, result)
96 | const redirectToRelative = redirectTo.replace(/http(s?):\/\/(.*):(\d{4})/g, '')
97 | res.status(302).set({
98 | Location: redirectToRelative
99 | }).send()
100 | } catch (err) {
101 | next(err)
102 | }
103 | })
104 | }
105 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright 2016 Google Inc. All Rights Reserved.
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------