-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Single Sign-on with OpenID Connect
- Loading branch information
alxndrsn
committed
Aug 25, 2023
1 parent
b9d5e4c
commit cc4b222
Showing
67 changed files
with
5,789 additions
and
644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Ignore everything | ||
* | ||
|
||
# Explicitly whitelist _necessary_ **source files** | ||
!/package.json | ||
!/package-lock.json | ||
!/Makefile | ||
!/lib/ | ||
!/config/ | ||
!/test/ | ||
|
||
!/oidc-tester/odk-central-backend-config.json | ||
!/oidc-tester/certs/*.pem | ||
!/oidc-tester/fake-oidc-server/accounts.json | ||
!/oidc-tester/fake-oidc-server/index.js | ||
!/oidc-tester/fake-oidc-server/package.json | ||
!/oidc-tester/fake-oidc-server/package-lock.json | ||
!/oidc-tester/playwright-tests/package.json | ||
!/oidc-tester/playwright-tests/package-lock.json | ||
!/oidc-tester/playwright-tests/playwright.config.js | ||
!/oidc-tester/playwright-tests/src/**/*.js | ||
!/oidc-tester/scripts/*.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: OIDC e2e tests | ||
|
||
on: push | ||
|
||
jobs: | ||
oidc-e2e-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- run: sudo apt-get install -y curl | ||
- run: make test-oidc-e2e | ||
- name: Archive playwright screenshots | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Playwright Screenshots | ||
path: oidc-tester/playwright-results/**/*.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: OIDC integration tests | ||
|
||
on: push | ||
|
||
jobs: | ||
oidc-integration-test: | ||
# TODO should we use the same container as circle & central? | ||
runs-on: ubuntu-latest | ||
services: | ||
# see: https://docs.github.com/en/[email protected]/actions/using-containerized-services/creating-postgresql-service-containers | ||
postgres: | ||
image: postgres:14.6 | ||
env: | ||
POSTGRES_PASSWORD: odktest | ||
ports: | ||
- 5432:5432 | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- run: npm ci --legacy-peer-deps | ||
- run: make fake-oidc-server-ci > fake-oidc-server.log & | ||
- run: node lib/bin/create-docker-databases.js | ||
- run: TEST_AUTH=oidc NODE_CONFIG_ENV=oidc-integration-test make test-integration | ||
- name: Fake OIDC Server Logs | ||
if: always() | ||
run: "! [[ -f ./fake-oidc-server.log ]] || cat ./fake-oidc-server.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Node.js CI | ||
name: Soak Test | ||
|
||
on: push | ||
|
||
|
@@ -8,7 +8,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [16.19.1] | ||
node-version: [18] | ||
services: | ||
# see: https://docs.github.com/en/[email protected]/actions/using-containerized-services/creating-postgresql-service-containers | ||
postgres: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Full Standard Test Suite | ||
|
||
on: push | ||
|
||
jobs: | ||
standard-tests: | ||
# TODO should we use the same container as circle & central? | ||
runs-on: ubuntu-latest | ||
services: | ||
# see: https://docs.github.com/en/[email protected]/actions/using-containerized-services/creating-postgresql-service-containers | ||
postgres: | ||
image: postgres:14.6 | ||
env: | ||
POSTGRES_PASSWORD: odktest | ||
ports: | ||
- 5432:5432 | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
- run: npm ci --legacy-peer-deps | ||
- run: node lib/bin/create-docker-databases.js | ||
- run: make test-full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"default": { | ||
"env": { | ||
"oidcProviderName": "OpenID Connect" | ||
}, | ||
"oidc": { | ||
"_description": "local test server: from https://www.npmjs.com/package/oidc-provider", | ||
"issuerUrl": "http://localhost:9898", | ||
"clientId": "odk-central-backend-dev", | ||
"clientSecret": "super-top-secret", | ||
"enabled": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"default": { | ||
"env": { | ||
"oidcProviderName": "Auth0" | ||
}, | ||
"oidc": { | ||
"_description": "auth0: https://manage.auth0.com/dashboard/us/odk-oidc-dev/", | ||
"issuerUrl": "https://odk-oidc-dev.us.auth0.com", | ||
"clientId": "ZKKpcW8TpKymVLbD1dbDVExj7SU4Zxbn", | ||
"clientSecret": "7tuVT7OsjRHfmUiwYYyWNT8YArMNlmvvv70tqlChkjtVHW0Xsp0mvVAyKIfCgUn5", | ||
"enabled": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"default": { | ||
"env": { | ||
"oidcProviderName": "Broken provider" | ||
}, | ||
"oidc": { | ||
"_description": "broken config: fiddle with this config to test out different init failure modes", | ||
"issuerUrl": "http://example.com", | ||
"clientId": "this is required; should be reported during client init if this line commented out", | ||
"clientSecret": "this is required; should be reported during client init if this line commented out", | ||
"enabled": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"default": { | ||
"env": { | ||
"oidcProviderName": "Google" | ||
}, | ||
"oidc": { | ||
"_description": "google: from https://console.cloud.google.com/apis/credentials", | ||
"issuerUrl": "https://accounts.google.com", | ||
"clientId": "564021877275-o5q3i8j44190d93d9mldd3rti1fncn3u.apps.googleusercontent.com", | ||
"clientSecret": "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", | ||
"enabled": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"default": { | ||
"env": { | ||
"oidcProviderName": "OpenID Connect" | ||
}, | ||
"oidc": { | ||
"enabled": true, | ||
"issuerUrl": "http://localhost:9898", | ||
"clientId": "odk-central-backend-dev", | ||
"clientSecret": "super-top-secret" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.