Skip to content

Commit

Permalink
test(integration-tests): auth choice port
Browse files Browse the repository at this point in the history
  • Loading branch information
golobitch committed May 2, 2024
1 parent e7b2286 commit 5618d67
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/integration/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type TestConfig = Config & {
type EnvConfig = {
OPEN_PAYMENTS_URL: string
AUTH_SERVER_DOMAIN: string
AUTH_CHOICE_SERVER: string
INTEGRATION_SERVER_PORT: string
WALLET_ADDRESS_URL: string
GRAPHQL_URL: string
Expand All @@ -23,6 +24,7 @@ type EnvConfig = {
const REQUIRED_KEYS: (keyof EnvConfig)[] = [
'OPEN_PAYMENTS_URL',
'AUTH_SERVER_DOMAIN',
'AUTH_CHOICE_SERVER',
'INTEGRATION_SERVER_PORT',
'WALLET_ADDRESS_URL',
'GRAPHQL_URL',
Expand Down Expand Up @@ -59,6 +61,7 @@ const createConfig = (name: string): TestConfig => {
publicHost: env.OPEN_PAYMENTS_URL,
testnetAutoPeerUrl: '',
authServerDomain: env.AUTH_SERVER_DOMAIN,
authChoiceServer: env.AUTH_CHOICE_SERVER,
integrationServerPort: parseInt(env.INTEGRATION_SERVER_PORT),
walletAddressUrl: env.WALLET_ADDRESS_URL,
graphqlUrl: env.GRAPHQL_URL,
Expand Down
5 changes: 4 additions & 1 deletion test/integration/lib/test-actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ async function _startAndAcceptInteraction(
assert(interactId)

// Accept
const url = new URL(senderWalletAddress.authServer);
url.port = "3109"

const acceptResponse = await fetch(
`${senderWalletAddress.authServer}/grant/${interactId}/${nonce}/accept`,
`${url.toString()}grant/${interactId}/${nonce}/accept`,
{
method: 'POST',
headers: {
Expand Down
1 change: 1 addition & 0 deletions test/integration/testenv/cloud-nine-wallet/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
OPEN_PAYMENTS_URL=https://cloud-nine-wallet-test-backend:3100
AUTH_SERVER_DOMAIN=http://cloud-nine-wallet-test-auth:3106
AUTH_CHOICE_SERVER=http://cloud-nine-wallet-test-auth:3109
INTEGRATION_SERVER_PORT=8888
WALLET_ADDRESS_URL=https://cloud-nine-wallet-test-backend:3100/.well-known/pay
GRAPHQL_URL=http://cloud-nine-wallet-test-backend:3101/graphql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ services:
environment:
NODE_ENV: ${NODE_ENV:-development}
AUTH_SERVER_DOMAIN: http://cloud-nine-wallet-test-auth:3106
AUTH_CHOICE_SERVER: http://cloud-nine-wallet-test-auth:3109
AUTH_DATABASE_URL: postgresql://cloud_nine_wallet_test_auth:cloud_nine_wallet_test_auth@shared-database/cloud_nine_wallet_test_auth
INTROSPECTION_PORT: 3107
AUTH_PORT: 3106
Expand Down
1 change: 1 addition & 0 deletions test/integration/testenv/happy-life-bank/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
OPEN_PAYMENTS_URL=https://happy-life-bank-test-backend:4100
AUTH_SERVER_DOMAIN=http://happy-life-bank-test-auth:4106
AUTH_CHOICE_SERVER=http://happy-life-bank-test-auth:4109
INTEGRATION_SERVER_PORT=8889
WALLET_ADDRESS_URL=https://happy-life-bank-test-backend:4100/accounts/pfry
GRAPHQL_URL=http://happy-life-bank-test-backend:4101/graphql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:
NODE_ENV: development
AUTH_DATABASE_URL: postgresql://happy_life_bank_test_auth:happy_life_bank_test_auth@shared-database/happy_life_bank_test_auth
AUTH_SERVER_DOMAIN: http://happy-life-bank-test-auth:4106
AUTH_CHOICE_SERVER: http://happy-life-bank-test-auth:4109
INTROSPECTION_PORT: 4107
ADMIN_PORT: 4103
AUTH_PORT: 4106
Expand Down

0 comments on commit 5618d67

Please sign in to comment.