This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #254 from DRK3/GNAPBDDTests
test: BDD tests showing EDV+GNAP and EDV+no auth
- Loading branch information
Showing
19 changed files
with
2,161 additions
and
160 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 |
---|---|---|
|
@@ -6,19 +6,37 @@ | |
# | ||
set -e | ||
|
||
echo "Running EDV integration tests..." | ||
|
||
PWD=`pwd` | ||
cd test/bdd | ||
|
||
# TODO (#220): Reduce BDD test running time by only starting storage containers as needed. | ||
|
||
echo "Running EDV integration tests using MongoDB + GNAP authorization..." | ||
|
||
export EDV_DATABASE_TYPE=mongodb | ||
export EDV_DATABASE_URL=mongodb://mongodb.example.com:27017 | ||
export EDV_AUTH_TYPE=GNAP | ||
go test -count=1 -v -cover . -p 1 -timeout=20m -race | ||
|
||
echo "Running EDV integration tests using MongoDB + ZCAP authorization..." | ||
|
||
export EDV_DATABASE_TYPE=mongodb | ||
export EDV_DATABASE_URL=mongodb://mongodb.example.com:27017 | ||
export EDV_AUTH_TYPE=ZCAP | ||
go test -count=1 -v -cover . -p 1 -timeout=20m -race | ||
|
||
echo "Running EDV integration tests using MongoDB + no authorization..." | ||
|
||
export EDV_DATABASE_TYPE=mongodb | ||
export EDV_DATABASE_URL=mongodb://mongodb.example.com:27017 | ||
export EDV_AUTH_TYPE=none | ||
go test -count=1 -v -cover . -p 1 -timeout=20m -race | ||
|
||
echo "Running EDV integration tests using CouchDB + GNAP authorization..." | ||
|
||
export EDV_DATABASE_TYPE=couchdb | ||
export EDV_DATABASE_URL=admin:[email protected]:5984 | ||
export EDV_AUTH_TYPE=GNAP | ||
go test -count=1 -v -cover . -p 1 -timeout=20m -race | ||
|
||
cd $PWD |
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
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,13 @@ | ||
{ | ||
"access-types": [ | ||
{ | ||
"reference": "example-token-type", | ||
"permission": "NeedsConsent", | ||
"expires-in": 3600, | ||
"access": { | ||
"type": "https://trustbloc.net/definitions/example/access-token", | ||
"subject-keys": ["sub"] | ||
} | ||
} | ||
] | ||
} |
36 changes: 36 additions & 0 deletions
36
test/bdd/fixtures/edv-rest/hydra-config/hydra_configure.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
echo "Creating client for auth..." | ||
# will use --skip-tls-verify because hydra doesn't trust self-signed certificate | ||
# remove it when using real certificate | ||
hydra clients create \ | ||
--endpoint https://oidc.provider.example.com:5556 \ | ||
--id auth \ | ||
--secret auth-secret \ | ||
--grant-types authorization_code,refresh_token \ | ||
--response-types code,id_token \ | ||
--scope openid,profile,email \ | ||
--skip-tls-verify \ | ||
--callbacks https://auth.trustbloc.local:8070/oauth2/callback | ||
|
||
echo "Finished creating oidc client!" | ||
|
||
echo "Creating oidc client for gnap flow..." | ||
# will use --skip-tls-verify because hydra doesn't trust self-signed certificate | ||
# remove it when using real certificate | ||
hydra clients create \ | ||
--endpoint https://oidc.provider.example.com:5556 \ | ||
--id auth1 \ | ||
--secret auth-secret \ | ||
--grant-types authorization_code,refresh_token \ | ||
--response-types code,id_token \ | ||
--scope openid,profile,email \ | ||
--skip-tls-verify \ | ||
--callbacks https://auth.trustbloc.local:8070/oidc/callback | ||
|
||
echo "Finished creating oidc client for gnap flow!" |
Oops, something went wrong.