@connectid-tools/rp-nodejs-sdk 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/package.json +1 -1
- package/{src/relying-party-client-sdk.js → relying-party-client-sdk.js} +1 -1
- package/{src/utils → utils}/user-agent.d.ts +1 -1
- package/{src/utils → utils}/user-agent.js +1 -1
- package/src/conformance/config.json +0 -60
- package/src/conformance/conformance.test.d.ts +0 -1
- package/src/conformance/conformance.test.js +0 -101
- package/src/conformance/variant.json +0 -1
- package/src/integration/integration.test.d.ts +0 -1
- package/src/integration/integration.test.js +0 -30
- package/src/tests/cert-utils.test.d.ts +0 -1
- package/src/tests/cert-utils.test.js +0 -13
- package/src/tests/functional-utils.test.d.ts +0 -1
- package/src/tests/functional-utils.test.js +0 -13
- package/src/tests/participant-filters.test.d.ts +0 -1
- package/src/tests/participant-filters.test.js +0 -151
- package/src/tests/pushed-authorisation-request-endpoint.test.d.ts +0 -1
- package/src/tests/pushed-authorisation-request-endpoint.test.js +0 -159
- package/src/tests/relying-party-client-sdk.test.d.ts +0 -1
- package/src/tests/relying-party-client-sdk.test.js +0 -313
- package/src/tests/request-utils.test.d.ts +0 -1
- package/src/tests/request-utils.test.js +0 -16
- package/src/tests/system-information.test.d.ts +0 -1
- package/src/tests/system-information.test.js +0 -16
- package/src/tests/user-agent.test.d.ts +0 -1
- package/src/tests/user-agent.test.js +0 -23
- package/src/tests/validator.test.d.ts +0 -1
- package/src/tests/validator.test.js +0 -38
- /package/{src/config.d.ts → config.d.ts} +0 -0
- /package/{src/config.js → config.js} +0 -0
- /package/{src/conformance → conformance}/api/conformance-api.d.ts +0 -0
- /package/{src/conformance → conformance}/api/conformance-api.js +0 -0
- /package/{src/conformance → conformance}/conformance-config.d.ts +0 -0
- /package/{src/conformance → conformance}/conformance-config.js +0 -0
- /package/{src/crypto → crypto}/crypto-loader.d.ts +0 -0
- /package/{src/crypto → crypto}/crypto-loader.js +0 -0
- /package/{src/crypto → crypto}/jwt-helper.d.ts +0 -0
- /package/{src/crypto → crypto}/jwt-helper.js +0 -0
- /package/{src/crypto → crypto}/pkce-helper.d.ts +0 -0
- /package/{src/crypto → crypto}/pkce-helper.js +0 -0
- /package/{src/endpoints → endpoints}/participants-endpoint.d.ts +0 -0
- /package/{src/endpoints → endpoints}/participants-endpoint.js +0 -0
- /package/{src/endpoints → endpoints}/pushed-authorisation-request-endpoint.d.ts +0 -0
- /package/{src/endpoints → endpoints}/pushed-authorisation-request-endpoint.js +0 -0
- /package/{src/endpoints → endpoints}/retrieve-token-endpoint.d.ts +0 -0
- /package/{src/endpoints → endpoints}/retrieve-token-endpoint.js +0 -0
- /package/{src/endpoints → endpoints}/userinfo-endpoint.d.ts +0 -0
- /package/{src/endpoints → endpoints}/userinfo-endpoint.js +0 -0
- /package/{src/fapi → fapi}/fapi-utils.d.ts +0 -0
- /package/{src/fapi → fapi}/fapi-utils.js +0 -0
- /package/{src/filter → filter}/participant-filters.d.ts +0 -0
- /package/{src/filter → filter}/participant-filters.js +0 -0
- /package/{src/http → http}/http-client-extensions.d.ts +0 -0
- /package/{src/http → http}/http-client-extensions.js +0 -0
- /package/{src/http → http}/http-client-factory.d.ts +0 -0
- /package/{src/http → http}/http-client-factory.js +0 -0
- /package/{src/logger.d.ts → logger.d.ts} +0 -0
- /package/{src/logger.js → logger.js} +0 -0
- /package/{src/model → model}/callback-params.d.ts +0 -0
- /package/{src/model → model}/callback-params.js +0 -0
- /package/{src/model → model}/claims.d.ts +0 -0
- /package/{src/model → model}/claims.js +0 -0
- /package/{src/model → model}/consolidated-token-set.d.ts +0 -0
- /package/{src/model → model}/consolidated-token-set.js +0 -0
- /package/{src/model → model}/discovery-service.d.ts +0 -0
- /package/{src/model → model}/discovery-service.js +0 -0
- /package/{src/model → model}/issuer-metadata.d.ts +0 -0
- /package/{src/model → model}/issuer-metadata.js +0 -0
- /package/{src/model → model}/jwks.d.ts +0 -0
- /package/{src/model → model}/jwks.js +0 -0
- /package/{src/model → model}/token-response.d.ts +0 -0
- /package/{src/model → model}/token-response.js +0 -0
- /package/{src/model → model}/token-set.d.ts +0 -0
- /package/{src/model → model}/token-set.js +0 -0
- /package/{src/relying-party-client-sdk.d.ts → relying-party-client-sdk.d.ts} +0 -0
- /package/{src/test-data → test-data}/large-participants-test-data.d.ts +0 -0
- /package/{src/test-data → test-data}/large-participants-test-data.js +0 -0
- /package/{src/test-data → test-data}/participants-test-data.d.ts +0 -0
- /package/{src/test-data → test-data}/participants-test-data.js +0 -0
- /package/{src/test-data → test-data}/sandbox-participants-test-data.d.ts +0 -0
- /package/{src/test-data → test-data}/sandbox-participants-test-data.js +0 -0
- /package/{src/types.d.ts → types.d.ts} +0 -0
- /package/{src/types.js → types.js} +0 -0
- /package/{src/utils → utils}/cert-utils.d.ts +0 -0
- /package/{src/utils → utils}/cert-utils.js +0 -0
- /package/{src/utils → utils}/functional-utils.d.ts +0 -0
- /package/{src/utils → utils}/functional-utils.js +0 -0
- /package/{src/utils → utils}/request-utils.d.ts +0 -0
- /package/{src/utils → utils}/request-utils.js +0 -0
- /package/{src/utils → utils}/system-information.d.ts +0 -0
- /package/{src/utils → utils}/system-information.js +0 -0
- /package/{src/validator.d.ts → validator.d.ts} +0 -0
- /package/{src/validator.js → validator.js} +0 -0
package/README.md
CHANGED
|
@@ -389,7 +389,11 @@ The required function parameters are:
|
|
|
389
389
|
|
|
390
390
|
# Release Notes
|
|
391
391
|
|
|
392
|
-
### 5.0.
|
|
392
|
+
### 5.0.1 (Jan 16, 2026)
|
|
393
|
+
|
|
394
|
+
* Fixed packaging structure which caused conflicts when including the library.
|
|
395
|
+
|
|
396
|
+
### 5.0.0 (Jan 15, 2026)
|
|
393
397
|
|
|
394
398
|
**Major architectural refactoring - Breaking Changes**
|
|
395
399
|
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ export default class RelyingPartyClientSdk {
|
|
|
27
27
|
throw new Error('Either ca_pem or ca_pem_content must be provided');
|
|
28
28
|
}
|
|
29
29
|
this.logger = getLogger(this.config.data.log_level);
|
|
30
|
-
this.logger.info(`Creating RelyingPartyClientSdk - version
|
|
30
|
+
this.logger.info(`Creating RelyingPartyClientSdk - version 5.0.1`);
|
|
31
31
|
// Validate and set purpose
|
|
32
32
|
if (this.config.data.purpose) {
|
|
33
33
|
const purposeValidation = validatePurpose(this.config.data.purpose);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const packageJsonVersion = "5.0.
|
|
1
|
+
export declare const packageJsonVersion = "5.0.1";
|
|
2
2
|
export declare const buildUserAgent: (clientId: string) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { getSystemInformation } from './system-information.js';
|
|
2
2
|
// important: Update this every time the package version changes
|
|
3
|
-
export const packageJsonVersion = '5.0.
|
|
3
|
+
export const packageJsonVersion = '5.0.1';
|
|
4
4
|
export const buildUserAgent = (clientId) => `cid-rp-nodejs-sdk/${packageJsonVersion} ${getSystemInformation()} +${clientId}`;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"alias": "conformancetest",
|
|
3
|
-
"client": {
|
|
4
|
-
"certificate": "-----BEGIN CERTIFICATE-----\nMIIGbjCCBVagAwIBAgIUf1OixaHH1iH+CVnP/HuYkNduJMYwDQYJKoZIhvcNAQEL\nBQAwdzELMAkGA1UEBhMCQVUxKDAmBgNVBAoTH2VmdHBvcyBEaWdpdGFsIElkZW50\naXR5IFB0eSBMdGQxEjAQBgNVBAsTCWNvbm5lY3RpZDEqMCgGA1UEAxMhY29ubmVj\ndGlkIFNBTkRCT1ggSXNzdWluZyBDQSAtIEcxMB4XDTI1MDYzMDA5NDYwMFoXDTI2\nMDczMDA5NDYwMFowfzELMAkGA1UEBhMCQVUxEjAQBgNVBAoTCWNvbm5lY3RpZDEt\nMCsGA1UECxMkYWI4MzcyNDAtOTYxOC00OTUzLTk2NmUtOTBmZDFmYTYzOTk5MS0w\nKwYD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bnMgdXNpbmcgZWZ0cG9zIERpZ2l0YWwgSWRlbnRpdHkgUHR5IEx0\nZCBzZXJ2aWNlcywgYXMgcHJvdmlkZWQgYnkgdGhlIGJ1c2luZXNzIGZyb20gdGlt\nZSB0byB0aW1lLiBJdHMgcmVjZWlwdCwgcG9zc2Vzc2lvbiBvciB1c2UgY29uc3Rp\ndHV0ZXMgYWNjZXB0YW5jZSBvZiB0aGUgZWZ0cG9zIERpZ2l0YWwgSWRlbnRpdHkg\nUHR5IEx0ZCBDZXJ0aWZpY2F0ZSBQb2xpY3kgYW5kIHJlbGF0ZWQgZG9jdW1lbnRz\nIHRoZXJlaW4uMEMGCCsGAQUFBwIBFjdodHRwOi8vcmVwb3NpdG9yeS5wa2kuc2Fu\nZGJveC5jb25uZWN0aWQuY29tLmF1L3BvbGljaWVzMA0GCSqGSIb3DQEBCwUAA4IB\nAQBSi9yE4wF7iTym+HVqKzGfCP2cl7HWJey0zEMUnmLW6s0FcHlxuU5Qw7+L2OTD\nIOCEKwyBNddCC/gnlXkrqC0/71JLbOrtEdZls9DsO1P+BQG3OuDnlo3xSaPNVRXM\naCB3lrl4MGo3q9du2rOivlD0/aof8D6aLapkOsNgtwJLW4ntnpOgRTxPgI8HHfXr\nsmUmmdz2RiJ8UjYffl8or9XSlBz4nOsLrPPUy+T/eiLZsooEvmqvz+ptlX49e+pl\npfMWZX8UBNZbp4wd3lw89A/BMBsSLCmQ/prJyw5FDEMvxTg9wUhs/+pLFpaCFc6J\nX5lsYKc5Hf4Dll4t8Hb/fhjV\n-----END CERTIFICATE-----",
|
|
5
|
-
"client_id": "https://rp.directory.sandbox.connectid.com.au/openid_relying_party/280518db-9807-4824-b080-324d94b45f6a",
|
|
6
|
-
"jwks": {
|
|
7
|
-
"keys": [
|
|
8
|
-
{
|
|
9
|
-
"kty": "RSA",
|
|
10
|
-
"use": "sig",
|
|
11
|
-
"x5c": [
|
|
12
|
-
"MIIGTzCCBTegAwIBAgIUGFmcYfeY/2xuP2RR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|
-
"n": "t2eb7rTIFqQHzFmzLrWvDl5qqVqFOg5uugiJqKLdh4XYTpOE-Io2aZ7VB21NZNy89oV4o4_RdQwVcFOR94Oybimp8Pubjz89Wi2da4R7W-zSPkD8eehaAuFTzMPNWbS3hwXWt2oew19KtL35Hkkz6VCyTVauejZEXMmhWVM-Y4HslUZGcM9zgVW6juLRWlEdbRft5vQl2SSwPOuGz_S_f-ME2CRugQ89Uo19qqF1ptXlJwlZaq2QQFMd_3ioGpLJkSRjU4n8ugXG7myGMXy3IcArdFt5WQz5JwVWSru2oVL6tFZW1b8IgPtTZ48PVQz_e-Y5vKq7sCcTI0Lgrxie2w",
|
|
15
|
-
"e": "AQAB",
|
|
16
|
-
"kid": "lHf9shwoF1wEES2sB9TBafbs0AVrLiU-1_ntzCrBo8A",
|
|
17
|
-
"x5u": "https://keystore.directory.sandbox.connectid.com.au/ab837240-9618-4953-966e-90fd1fa63999/280518db-9807-4824-b080-324d94b45f6a/lHf9shwoF1wEES2sB9TBafbs0AVrLiU-1_ntzCrBo8A.pem",
|
|
18
|
-
"x5t#S256": "lHf9shwoF1wEES2sB9TBafbs0AVrLiU-1_ntzCrBo8A",
|
|
19
|
-
"x5dn": "CN=280518db-9807-4824-b080-324d94b45f6a,OU=ab837240-9618-4953-966e-90fd1fa63999,O=connectid,C=AU"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"kty": "RSA",
|
|
23
|
-
"use": "sig",
|
|
24
|
-
"x5c": [
|
|
25
|
-
"MIIGTzCCBTegAwIBAgIUZHU0UKT4j2dX8RABTZJThsk1CJAwDQYJKoZIhvcNAQELBQAwdzELMAkGA1UEBhMCQVUxKDAmBgNVBAoTH2VmdHBvcyBEaWdpdGFsIElkZW50aXR5IFB0eSBMdGQxEjAQBgNVBAsTCWNvbm5lY3RpZDEqMCgGA1UEAxMhY29ubmVjdGlkIFNBTkRCT1ggSXNzdWluZyBDQSAtIEcxMB4XDTI0MTExODIzNTAwMFoXDTI1MTIxODI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zoIyiptd0y1KiXXCoIxEbd3Y5b_Dx5aG2YTVzidB0V-RUDoAKJYQbJMVYzlq30P3TkXWD5qwIa6GZr_CZpw6SncbkNqZMDQzgqFhd8J0KczVThXf-qlc4LNh0g0wbYjNcidQ6FDCHJESzDiZwECXT_XFc_w",
|
|
28
|
-
"e": "AQAB",
|
|
29
|
-
"kid": "6kWTo-i7nrIJrdl6jxfDyT0Nprw-aRT0mcZvxvXtKVE",
|
|
30
|
-
"x5u": "https://keystore.directory.sandbox.connectid.com.au/ab837240-9618-4953-966e-90fd1fa63999/280518db-9807-4824-b080-324d94b45f6a/6kWTo-i7nrIJrdl6jxfDyT0Nprw-aRT0mcZvxvXtKVE.pem",
|
|
31
|
-
"x5t#S256": "6kWTo-i7nrIJrdl6jxfDyT0Nprw-aRT0mcZvxvXtKVE",
|
|
32
|
-
"x5dn": "CN=280518db-9807-4824-b080-324d94b45f6a,OU=ab837240-9618-4953-966e-90fd1fa63999,O=connectid,C=AU"
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
"redirect_uri": "https://tpp.localhost/cb"
|
|
37
|
-
},
|
|
38
|
-
"consent": {},
|
|
39
|
-
"description": "NodeJS Conformance Test Template",
|
|
40
|
-
"server": {
|
|
41
|
-
"jwks": {
|
|
42
|
-
"keys": [
|
|
43
|
-
{
|
|
44
|
-
"p": "9ROiJdNH4qHPe4K92GpxUpQY2T2EP2KjbdOp16TFaL6DmXdZLaJzaYEpinR4NtSnuEpO2nl441_kma1JP99p6VdtmLUvTRUeCEUJXdFh_bqhc0INfGHRuXNBeLLQFcrRRS5Vhi50IM_NqYmpO1GEshxNYfKCweTCTkEwsJzIZkM",
|
|
45
|
-
"kty": "RSA",
|
|
46
|
-
"q": "nluxAF8DH-LhGz8qB3qzVhBaD7y5JB_pZ3SMaYPCV92yWXRysgNvYx2CyaWOtrIPabfzTBauR1XXEiLccxzQRy2f8bQ7pwJZtQJJtmC4UwCnNnIcdQ1WsjzzHMq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gtqukZE",
|
|
55
|
-
"n": "l5nlgOnp5m-klhQGYjcxytnu-vM6CpPFyhzuLII31Y4JT2sJjpItN4DOWRVs5sWL7aj_otQNYWrBz9JJOUJJ2oGIQDq2UBn9nHDTKqCWCZ8r2Gtq9U7z-mFfHx8f67hY6KFmeuMdVcqCBcNN76ZHtCkvRiziglvtYkMpovWF2cGqeyCuunlTr0clMe2N_iA0wOgLwiYDBtvqLi8DBshRcGzTHHlncW-OLdspu0saOb2igGMEaBAuzY2EsL0E2jZODB5bfPfA3WDuo7Swi2FVqDuaudm3pJofOr02lDidJNQCOBJRJhHVH867vFK12_xtgCDAydWn9qNub19nDwl1Pw"
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import RelyingPartyClientSdk from '../relying-party-client-sdk.js';
|
|
2
|
-
import { conformanceConfig } from './conformance-config.js';
|
|
3
|
-
import config from './config.json';
|
|
4
|
-
import variant from './variant.json';
|
|
5
|
-
import packageJson from '../../package.json';
|
|
6
|
-
import { parse } from 'url';
|
|
7
|
-
import { ConformanceApi } from './api/conformance-api.js';
|
|
8
|
-
import winston from 'winston';
|
|
9
|
-
import { describe, before, it } from 'node:test';
|
|
10
|
-
import assert from 'node:assert';
|
|
11
|
-
const alias = 'conformance-nodejs-' + Date.now();
|
|
12
|
-
const conformanceEnv = process.env.CONFORMANCE_ENV || 'production';
|
|
13
|
-
const conformanceApiToken = process.env.CONFORMANCE_API_TOKEN || '';
|
|
14
|
-
const conformanceNodeVersion = process.env.CONFORMANCE_NODE_VERSION || 'unknown';
|
|
15
|
-
const participantsEnv = conformanceEnv === 'production' ? '' : conformanceEnv;
|
|
16
|
-
conformanceConfig.data.registry_participants_uri = `https://api.sandbox.connectid.com.au/oidf-conformance/participants?alias=a/${alias}&env=${participantsEnv}`;
|
|
17
|
-
const rpClient = new RelyingPartyClientSdk(conformanceConfig);
|
|
18
|
-
const conformanceEnvUrls = new Map([
|
|
19
|
-
['staging', 'https://staging.certification.openid.net/'],
|
|
20
|
-
['production', 'https://www.certification.openid.net/']
|
|
21
|
-
]);
|
|
22
|
-
const conformanceBaseUrl = conformanceEnvUrls.get(conformanceEnv);
|
|
23
|
-
console.log(`Selected environment ${conformanceEnv}, baseUrl: ${conformanceBaseUrl}`);
|
|
24
|
-
const conformanceApi = new ConformanceApi(conformanceApiToken, conformanceBaseUrl);
|
|
25
|
-
describe('Conformance Test', { timeout: 600000 }, () => {
|
|
26
|
-
let planInfo;
|
|
27
|
-
before(async () => {
|
|
28
|
-
const planName = 'fapi2-message-signing-id1-client-test-plan';
|
|
29
|
-
config.description = `NodeJS SDK ${packageJson.version} (NodeJS v${conformanceNodeVersion})`;
|
|
30
|
-
config.alias = alias;
|
|
31
|
-
planInfo = await conformanceApi.createPlan(planName, JSON.stringify(variant), config);
|
|
32
|
-
});
|
|
33
|
-
it('should execute the conformance test', async () => {
|
|
34
|
-
const testModules = planInfo.modules.map((module) => module.testModule);
|
|
35
|
-
for (const testName of testModules) {
|
|
36
|
-
console.log(`Executing test ${testName}`);
|
|
37
|
-
// We are mimicking an application log here.
|
|
38
|
-
const logger = createTestLogger(testName);
|
|
39
|
-
rpClient.logger = logger;
|
|
40
|
-
const testInstance = await conformanceApi.createTestFromPlan(planInfo.id, testName);
|
|
41
|
-
let testInformation = await conformanceApi.getTestInformation(testInstance.id);
|
|
42
|
-
logger.info(`Executing version ${testInformation.version} of ${testName}`);
|
|
43
|
-
console.log(`See ${conformanceBaseUrl}log-detail.html?log=${testInstance.id}`);
|
|
44
|
-
const idps = await rpClient.getParticipants();
|
|
45
|
-
const authorisationServerId = idps[0].AuthorisationServers[0].AuthorisationServerId;
|
|
46
|
-
logger.info(`Sending PAR to ${authorisationServerId}`);
|
|
47
|
-
const essentialClaims = ['given_name', 'middle_name', 'family_name', 'phone_number', 'email', 'address', 'birthdate', 'txn'];
|
|
48
|
-
const parResponse = await rpClient.sendPushedAuthorisationRequest(authorisationServerId, essentialClaims);
|
|
49
|
-
const response = await fetch(parResponse.authUrl, {
|
|
50
|
-
redirect: 'manual',
|
|
51
|
-
});
|
|
52
|
-
if (response.status !== 303) {
|
|
53
|
-
console.error(`Expected 303, got ${response.status}`);
|
|
54
|
-
throw new Error(`Expected 303, got ${response.status}`);
|
|
55
|
-
}
|
|
56
|
-
const location = response.headers.get('location');
|
|
57
|
-
if (!location) {
|
|
58
|
-
throw new Error('No location header');
|
|
59
|
-
}
|
|
60
|
-
const locationObj = parse(location, true);
|
|
61
|
-
logger.info(`Executing ${testName}`);
|
|
62
|
-
try {
|
|
63
|
-
logger.info('Getting tokens');
|
|
64
|
-
await rpClient.retrieveTokens(authorisationServerId, locationObj.query, parResponse.codeVerifier, parResponse.state, parResponse.nonce);
|
|
65
|
-
logger.info('Tokens successfully retrieved');
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
logger.error('An error occured while getting tokens:' + getErrorMessage(e));
|
|
69
|
-
console.log(e);
|
|
70
|
-
}
|
|
71
|
-
while (testInformation.status !== 'FINISHED') {
|
|
72
|
-
await delay(250);
|
|
73
|
-
testInformation = await conformanceApi.getTestInformation(testInstance.id);
|
|
74
|
-
}
|
|
75
|
-
logger.info(`Test finished with result: ${testInformation.result}, status: ${testInformation.status}`);
|
|
76
|
-
console.log('Full test information:', JSON.stringify(testInformation, null, 2));
|
|
77
|
-
assert.ok(['WARNING', 'PASSED'].includes(testInformation.result));
|
|
78
|
-
if (testInformation.result === 'WARNING') {
|
|
79
|
-
console.log(`*** A warning occurred while executing ${testName}, please check the logs!!! ***`);
|
|
80
|
-
}
|
|
81
|
-
// TODO: download the logs and store them in Github
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
function delay(time) {
|
|
86
|
-
// @ts-ignore
|
|
87
|
-
return new Promise((resolve) => setTimeout(resolve, time));
|
|
88
|
-
}
|
|
89
|
-
function getErrorMessage(error) {
|
|
90
|
-
if (error instanceof Error)
|
|
91
|
-
return error.message;
|
|
92
|
-
return String(error);
|
|
93
|
-
}
|
|
94
|
-
function createTestLogger(testName) {
|
|
95
|
-
return winston.createLogger({
|
|
96
|
-
level: 'info',
|
|
97
|
-
format: winston.format.simple(),
|
|
98
|
-
defaultMeta: { service: 'conformance-test' },
|
|
99
|
-
transports: [new winston.transports.File({ filename: `logs/${testName}.log` })],
|
|
100
|
-
});
|
|
101
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "client_auth_type": "private_key_jwt", "fapi_request_method": "signed_non_repudiation", "fapi_client_type": "oidc", "sender_constrain": "mtls", "fapi_profile": "connectid_au", "fapi_response_mode": "plain_response" }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import jsonPackage from '../../package.json';
|
|
2
|
-
import { describe, it } from 'node:test';
|
|
3
|
-
import assert from 'node:assert';
|
|
4
|
-
import { config } from '../config.js';
|
|
5
|
-
import RelyingPartyClientSdk from '../relying-party-client-sdk.js';
|
|
6
|
-
describe('RelyingPartyClientSdk', () => {
|
|
7
|
-
it('should retrieve user agent and match details', async () => {
|
|
8
|
-
const version = jsonPackage.version;
|
|
9
|
-
const newConfig = {
|
|
10
|
-
...config,
|
|
11
|
-
data: {
|
|
12
|
-
...config.data,
|
|
13
|
-
registry_participants_uri: 'https://api.sandbox.connectid.com.au/useragent-responder/participants',
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
const participants = await new RelyingPartyClientSdk(newConfig).getParticipants();
|
|
17
|
-
const regex = /(.*?)\/(.*?)\s(\(.*?\))\s(\+.*)/;
|
|
18
|
-
const organisationName = participants[0].OrganisationName;
|
|
19
|
-
const match = organisationName.match(regex);
|
|
20
|
-
assert.ok(match, `Organisation name '${organisationName}' failed to match pattern '${regex.source}'`);
|
|
21
|
-
const namePart = match[1];
|
|
22
|
-
const versionPart = match[2];
|
|
23
|
-
const platformPart = match[3].trim();
|
|
24
|
-
const clientIdPart = match[4];
|
|
25
|
-
assert.strictEqual(namePart, 'cid-rp-nodejs-sdk');
|
|
26
|
-
assert.strictEqual(versionPart, version);
|
|
27
|
-
assert.match(platformPart, /\(.+; .+; .+\)/);
|
|
28
|
-
assert.strictEqual(clientIdPart, '+https://rp.directory.sandbox.connectid.com.au/openid_relying_party/280518db-9807-4824-b080-324d94b45f6a');
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from 'node:test';
|
|
2
|
-
import assert from 'node:assert';
|
|
3
|
-
import { getCertificate } from '../utils/cert-utils.js';
|
|
4
|
-
test('should use content when certificate content and path are passed', () => {
|
|
5
|
-
assert.strictEqual(getCertificate('.gitignore', 'abcdefg'), 'abcdefg');
|
|
6
|
-
});
|
|
7
|
-
test('should use path when content is falsy', () => {
|
|
8
|
-
assert.ok(getCertificate('.gitignore', '').toString().includes('# These are some examples of commonly ignored file patterns.'));
|
|
9
|
-
// @ts-ignore
|
|
10
|
-
assert.ok(getCertificate('.gitignore', 0).toString().includes('# These are some examples of commonly ignored file patterns.'));
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
assert.ok(getCertificate('.gitignore', null).toString().includes('# These are some examples of commonly ignored file patterns.'));
|
|
13
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import test from 'node:test';
|
|
2
|
-
import { partition } from '../utils/functional-utils.js';
|
|
3
|
-
import assert from 'node:assert';
|
|
4
|
-
test('should partition list', () => {
|
|
5
|
-
const [odd, even] = partition([1, 2, 3, 4, 5], (input) => input % 2 == 1);
|
|
6
|
-
assert.deepEqual(odd, [1, 3, 5]);
|
|
7
|
-
assert.deepEqual(even, [2, 4]);
|
|
8
|
-
});
|
|
9
|
-
test('should partition empty list', () => {
|
|
10
|
-
const [odd, even] = partition([], (input) => input % 2 == 1);
|
|
11
|
-
assert.deepEqual(odd, []);
|
|
12
|
-
assert.deepEqual(even, []);
|
|
13
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import ParticipantFilter from '../filter/participant-filters.js';
|
|
2
|
-
import { participantsTestData } from '../test-data/participants-test-data.js';
|
|
3
|
-
import { describe, it } from 'node:test';
|
|
4
|
-
import assert from 'node:assert';
|
|
5
|
-
const participantsFilter = new ParticipantFilter();
|
|
6
|
-
describe('removeOutOfDateCertifications', () => {
|
|
7
|
-
it('should remove all certifications as they are all after the specified date', () => {
|
|
8
|
-
const filteredParticipants = participantsFilter.removeOutOfDateCertifications(getParticipantsTestData(), new Date('2005-01-01'));
|
|
9
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[0].AuthorisationServerCertifications.length, 0);
|
|
10
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[1].AuthorisationServerCertifications.length, 0);
|
|
11
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers[0].AuthorisationServerCertifications.length, 0);
|
|
12
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers[0].AuthorisationServerCertifications.length, 0);
|
|
13
|
-
});
|
|
14
|
-
it('should keep all certification as they span the specified date', () => {
|
|
15
|
-
const filteredParticipants = participantsFilter.removeOutOfDateCertifications(getParticipantsTestData(), new Date('2024-01-01'));
|
|
16
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[0].AuthorisationServerCertifications.length, 4);
|
|
17
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[1].AuthorisationServerCertifications.length, 4);
|
|
18
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers[0].AuthorisationServerCertifications.length, 4);
|
|
19
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers[0].AuthorisationServerCertifications.length, 1);
|
|
20
|
-
});
|
|
21
|
-
it('should keep all certification that span the specified date', () => {
|
|
22
|
-
const filteredParticipants = participantsFilter.removeOutOfDateCertifications(getParticipantsTestData(), new Date('2024-05-20'));
|
|
23
|
-
const testData = getParticipantsTestData();
|
|
24
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[0].AuthorisationServerCertifications.length, 3);
|
|
25
|
-
assert.ok(!filteredParticipants[0].AuthorisationServers[0].AuthorisationServerCertifications.includes(testData[0].AuthorisationServers[0].AuthorisationServerCertifications[0]));
|
|
26
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[1].AuthorisationServerCertifications.length, 2);
|
|
27
|
-
assert.ok(!filteredParticipants[0].AuthorisationServers[1].AuthorisationServerCertifications.includes(testData[0].AuthorisationServers[1].AuthorisationServerCertifications[0]));
|
|
28
|
-
assert.ok(!filteredParticipants[0].AuthorisationServers[1].AuthorisationServerCertifications.includes(testData[0].AuthorisationServers[1].AuthorisationServerCertifications[1]));
|
|
29
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers[0].AuthorisationServerCertifications.length, 1);
|
|
30
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers[0].AuthorisationServerCertifications.length, 0);
|
|
31
|
-
});
|
|
32
|
-
it('should remove all certifications as they are all before the specified date', () => {
|
|
33
|
-
const filteredParticipants = participantsFilter.removeOutOfDateCertifications(getParticipantsTestData(), new Date('2025-01-01'));
|
|
34
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[0].AuthorisationServerCertifications.length, 0);
|
|
35
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[1].AuthorisationServerCertifications.length, 0);
|
|
36
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers[0].AuthorisationServerCertifications.length, 0);
|
|
37
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers[0].AuthorisationServerCertifications.length, 0);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
describe('removeUnofficialCertifications', () => {
|
|
41
|
-
it('should remove certifications that do not have status "Certified"', () => {
|
|
42
|
-
const filteredParticipants = participantsFilter.removeUnofficialCertifications(getParticipantsTestData());
|
|
43
|
-
const testData = getParticipantsTestData();
|
|
44
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[0].AuthorisationServerCertifications.length, 3);
|
|
45
|
-
assert.ok(!filteredParticipants[0].AuthorisationServers[0].AuthorisationServerCertifications.includes(testData[0].AuthorisationServers[0].AuthorisationServerCertifications[3]));
|
|
46
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers[1].AuthorisationServerCertifications.length, 3);
|
|
47
|
-
assert.ok(!filteredParticipants[0].AuthorisationServers[1].AuthorisationServerCertifications.includes(testData[0].AuthorisationServers[1].AuthorisationServerCertifications[2]));
|
|
48
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers[0].AuthorisationServerCertifications.length, 0);
|
|
49
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers[0].AuthorisationServerCertifications.length, 1);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
describe('removeInactiveAuthServers', () => {
|
|
53
|
-
it('should remove Auth Servers that do not have the Redirect:FAPI certification', () => {
|
|
54
|
-
const filteredParticipants = participantsFilter.removeInactiveAuthServers(getParticipantsTestData());
|
|
55
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers.length, 2);
|
|
56
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers.length, 0);
|
|
57
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers.length, 0);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
describe('removeParticipantsWithoutAuthServers', () => {
|
|
61
|
-
it('should remove Participants that do not have any auth servers', () => {
|
|
62
|
-
const participants = getParticipantsTestData();
|
|
63
|
-
participants[1].AuthorisationServers = [];
|
|
64
|
-
const filteredParticipants = participantsFilter.removeParticipantsWithoutAuthServers(participants);
|
|
65
|
-
assert.strictEqual(filteredParticipants.length, 2);
|
|
66
|
-
assert.ok(filteredParticipants.includes(participants[0]));
|
|
67
|
-
assert.ok(filteredParticipants.includes(participants[2]));
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
describe('filterAuthServersForSupportedClaims', () => {
|
|
71
|
-
it('should filter auth servers that do not have the over25 required claims', () => {
|
|
72
|
-
const filteredParticipants = participantsFilter.filterAuthServersForSupportedClaims(getParticipantsTestData(), ['over25']);
|
|
73
|
-
const testData = getParticipantsTestData();
|
|
74
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers.length, 1);
|
|
75
|
-
assert.deepStrictEqual(filteredParticipants[0].AuthorisationServers[0], testData[0].AuthorisationServers[0]);
|
|
76
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers.length, 0);
|
|
77
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers.length, 0);
|
|
78
|
-
});
|
|
79
|
-
it('should filter auth servers that match multiple required claims', () => {
|
|
80
|
-
const filteredParticipants = participantsFilter.filterAuthServersForSupportedClaims(getParticipantsTestData(), ['address', 'over18']);
|
|
81
|
-
const testData = getParticipantsTestData();
|
|
82
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers.length, 0);
|
|
83
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers.length, 1);
|
|
84
|
-
assert.deepStrictEqual(filteredParticipants[1].AuthorisationServers[0], testData[1].AuthorisationServers[0]);
|
|
85
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers.length, 0);
|
|
86
|
-
});
|
|
87
|
-
it('should find auth servers with the name claim when asking for a name component', () => {
|
|
88
|
-
const filteredParticipants = participantsFilter.filterAuthServersForSupportedClaims(getParticipantsTestData(), ['given_name']);
|
|
89
|
-
const testData = getParticipantsTestData();
|
|
90
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers.length, 1);
|
|
91
|
-
assert.deepStrictEqual(filteredParticipants[0].AuthorisationServers[0], testData[0].AuthorisationServers[0]);
|
|
92
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers.length, 0);
|
|
93
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers.length, 0);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
describe('removeFallbackIdentityServiceProvider', () => {
|
|
97
|
-
it('should filter out any manual verification auth servers', () => {
|
|
98
|
-
const filteredParticipants = participantsFilter.removeFallbackIdentityServiceProvider(getParticipantsTestData());
|
|
99
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers.length, 2);
|
|
100
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers.length, 1);
|
|
101
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers.length, 0);
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
describe('filterForFallbackIdentityServiceProviders', () => {
|
|
105
|
-
it('should return any auth servers that have the fallback provider certification', () => {
|
|
106
|
-
const filteredParticipants = participantsFilter.filterForFallbackIdentityServiceProviders(getParticipantsTestData());
|
|
107
|
-
const testData = getParticipantsTestData();
|
|
108
|
-
assert.strictEqual(filteredParticipants.length, 3);
|
|
109
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers.length, 0);
|
|
110
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers.length, 0);
|
|
111
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers.length, 1);
|
|
112
|
-
assert.deepStrictEqual(filteredParticipants[2], testData[2]);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
describe('filterForRequiredCertifications', () => {
|
|
116
|
-
it('should return any auth servers that have the TDIF provider certification', () => {
|
|
117
|
-
const certificationFilters = [{ profileVariant: 'Identity Provider', profileType: 'TDIF Accreditation' }];
|
|
118
|
-
const filteredParticipants = participantsFilter.filterForRequiredCertifications(getParticipantsTestData(), certificationFilters);
|
|
119
|
-
const testData = getParticipantsTestData();
|
|
120
|
-
assert.deepStrictEqual(filteredParticipants[0].AuthorisationServers[0], testData[0].AuthorisationServers[1]);
|
|
121
|
-
assert.deepStrictEqual(filteredParticipants[1].AuthorisationServers[0], testData[1].AuthorisationServers[0]);
|
|
122
|
-
assert.strictEqual(filteredParticipants.length, 3);
|
|
123
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers.length, 1);
|
|
124
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers.length, 1);
|
|
125
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers.length, 0);
|
|
126
|
-
});
|
|
127
|
-
it('should return no auth servers when no auth servers have the requested certification', () => {
|
|
128
|
-
const certificationFilters = [{ profileType: 'Bad Profile', profileVariant: 'Bad Variant' }];
|
|
129
|
-
const filteredParticipants = participantsFilter.filterForRequiredCertifications(getParticipantsTestData(), certificationFilters);
|
|
130
|
-
assert.strictEqual(filteredParticipants.length, 3);
|
|
131
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers.length, 0);
|
|
132
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers.length, 0);
|
|
133
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers.length, 0);
|
|
134
|
-
});
|
|
135
|
-
it('should return only auth servers that have all matching certifications', () => {
|
|
136
|
-
const certificationFilters = [
|
|
137
|
-
{ profileType: 'TDIF Accreditation', profileVariant: 'Identity Provider' },
|
|
138
|
-
{ profileType: 'Channel', profileVariant: 'web' },
|
|
139
|
-
];
|
|
140
|
-
const filteredParticipants = participantsFilter.filterForRequiredCertifications(getParticipantsTestData(), certificationFilters);
|
|
141
|
-
const testData = getParticipantsTestData();
|
|
142
|
-
assert.deepStrictEqual(filteredParticipants[0].AuthorisationServers[0], testData[0].AuthorisationServers[1]);
|
|
143
|
-
assert.strictEqual(filteredParticipants.length, 3);
|
|
144
|
-
assert.strictEqual(filteredParticipants[0].AuthorisationServers.length, 1);
|
|
145
|
-
assert.strictEqual(filteredParticipants[1].AuthorisationServers.length, 0);
|
|
146
|
-
assert.strictEqual(filteredParticipants[2].AuthorisationServers.length, 0);
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
function getParticipantsTestData() {
|
|
150
|
-
return JSON.parse(JSON.stringify(participantsTestData));
|
|
151
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { PushedAuthorisationRequestEndpoint } from '../endpoints/pushed-authorisation-request-endpoint.js';
|
|
2
|
-
import { config } from '../config.js';
|
|
3
|
-
import { Agent } from 'undici';
|
|
4
|
-
import { describe, it } from 'node:test';
|
|
5
|
-
import assert from 'node:assert';
|
|
6
|
-
describe('generateClaimsRequest', () => {
|
|
7
|
-
function createEndpoint(sdkConfig = config) {
|
|
8
|
-
const httpClient = new Agent();
|
|
9
|
-
const jwtHelper = {}; // Mock
|
|
10
|
-
const logger = {
|
|
11
|
-
info: () => { },
|
|
12
|
-
debug: () => { },
|
|
13
|
-
warn: () => { },
|
|
14
|
-
error: () => { },
|
|
15
|
-
};
|
|
16
|
-
const participantsEndpoint = {}; // Mock
|
|
17
|
-
return new PushedAuthorisationRequestEndpoint(sdkConfig, httpClient, jwtHelper, logger, participantsEndpoint);
|
|
18
|
-
}
|
|
19
|
-
it('should return name, birthdate essential claims', () => {
|
|
20
|
-
const endpoint = createEndpoint();
|
|
21
|
-
const claimsRequest = endpoint.generateClaimsRequest(['name', 'birthdate'], []);
|
|
22
|
-
const expected = {
|
|
23
|
-
id_token: {
|
|
24
|
-
name: { essential: true },
|
|
25
|
-
birthdate: { essential: true },
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
assert.deepEqual(claimsRequest, expected);
|
|
29
|
-
});
|
|
30
|
-
it('should return name essential, given_name essential, birthdate voluntary, email voluntary claims', () => {
|
|
31
|
-
const endpoint = createEndpoint();
|
|
32
|
-
const claimsRequest = endpoint.generateClaimsRequest(['name', 'given_name'], ['birthdate', 'email']);
|
|
33
|
-
const expected = {
|
|
34
|
-
id_token: {
|
|
35
|
-
name: { essential: true },
|
|
36
|
-
given_name: { essential: true },
|
|
37
|
-
email: { essential: false },
|
|
38
|
-
birthdate: { essential: false },
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
assert.deepEqual(claimsRequest, expected);
|
|
42
|
-
});
|
|
43
|
-
it('should return essential when claims are in both lists', () => {
|
|
44
|
-
const endpoint = createEndpoint();
|
|
45
|
-
const claimsRequest = endpoint.generateClaimsRequest(['name', 'given_name'], ['name', 'birthdate']);
|
|
46
|
-
const expected = {
|
|
47
|
-
id_token: {
|
|
48
|
-
name: { essential: true },
|
|
49
|
-
given_name: { essential: true },
|
|
50
|
-
birthdate: { essential: false },
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
assert.deepEqual(claimsRequest, expected);
|
|
54
|
-
});
|
|
55
|
-
it('should return only voluntary claims', () => {
|
|
56
|
-
const endpoint = createEndpoint();
|
|
57
|
-
const claimsRequest = endpoint.generateClaimsRequest([], ['name', 'birthdate']);
|
|
58
|
-
const expected = {
|
|
59
|
-
id_token: {
|
|
60
|
-
name: { essential: false },
|
|
61
|
-
birthdate: { essential: false },
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
assert.deepEqual(claimsRequest, expected);
|
|
65
|
-
});
|
|
66
|
-
it('should create essential extended claims', () => {
|
|
67
|
-
const endpoint = createEndpoint();
|
|
68
|
-
const claimsRequest = endpoint.generateClaimsRequest(['over18', 'over65'], []);
|
|
69
|
-
const expected = {
|
|
70
|
-
id_token: {
|
|
71
|
-
verified_claims: {
|
|
72
|
-
verification: {
|
|
73
|
-
trust_framework: { value: 'au_connectid' },
|
|
74
|
-
},
|
|
75
|
-
claims: {
|
|
76
|
-
over18: { essential: true },
|
|
77
|
-
over65: { essential: true },
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
assert.deepEqual(claimsRequest, expected);
|
|
83
|
-
});
|
|
84
|
-
it('should create essential and voluntary extended claims', () => {
|
|
85
|
-
const endpoint = createEndpoint();
|
|
86
|
-
const claimsRequest = endpoint.generateClaimsRequest(['over18'], ['over65']);
|
|
87
|
-
const expected = {
|
|
88
|
-
id_token: {
|
|
89
|
-
verified_claims: {
|
|
90
|
-
verification: {
|
|
91
|
-
trust_framework: { value: 'au_connectid' },
|
|
92
|
-
},
|
|
93
|
-
claims: {
|
|
94
|
-
over18: { essential: true },
|
|
95
|
-
over65: { essential: false },
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
assert.deepEqual(claimsRequest, expected);
|
|
101
|
-
});
|
|
102
|
-
it('should create extended claims and normal essential claims', () => {
|
|
103
|
-
const endpoint = createEndpoint();
|
|
104
|
-
const claimsRequest = endpoint.generateClaimsRequest(['given_name', 'over18'], []);
|
|
105
|
-
const expected = {
|
|
106
|
-
id_token: {
|
|
107
|
-
given_name: { essential: true },
|
|
108
|
-
verified_claims: {
|
|
109
|
-
verification: {
|
|
110
|
-
trust_framework: { value: 'au_connectid' },
|
|
111
|
-
},
|
|
112
|
-
claims: {
|
|
113
|
-
over18: { essential: true },
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
assert.deepEqual(claimsRequest, expected);
|
|
119
|
-
});
|
|
120
|
-
it('should create extended claims and normal essential and voluntary claims', () => {
|
|
121
|
-
const endpoint = createEndpoint();
|
|
122
|
-
const claimsRequest = endpoint.generateClaimsRequest(['given_name', 'over18'], ['last_name', 'over65']);
|
|
123
|
-
const expected = {
|
|
124
|
-
id_token: {
|
|
125
|
-
given_name: { essential: true },
|
|
126
|
-
last_name: { essential: false },
|
|
127
|
-
verified_claims: {
|
|
128
|
-
verification: {
|
|
129
|
-
trust_framework: { value: 'au_connectid' },
|
|
130
|
-
},
|
|
131
|
-
claims: {
|
|
132
|
-
over18: { essential: true },
|
|
133
|
-
over65: { essential: false },
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
assert.deepEqual(claimsRequest, expected);
|
|
139
|
-
});
|
|
140
|
-
it('should create extended claims with beneficiary account', () => {
|
|
141
|
-
const endpoint = createEndpoint();
|
|
142
|
-
const claimsRequest = endpoint.generateClaimsRequest(['beneficiary_account_au', 'beneficiary_account_au_payid'], ['beneficiary_account_international']);
|
|
143
|
-
const expected = {
|
|
144
|
-
id_token: {
|
|
145
|
-
verified_claims: {
|
|
146
|
-
verification: {
|
|
147
|
-
trust_framework: { value: 'au_connectid' },
|
|
148
|
-
},
|
|
149
|
-
claims: {
|
|
150
|
-
beneficiary_account_au: { essential: true },
|
|
151
|
-
beneficiary_account_au_payid: { essential: true },
|
|
152
|
-
beneficiary_account_international: { essential: false },
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
};
|
|
157
|
-
assert.deepEqual(claimsRequest, expected);
|
|
158
|
-
});
|
|
159
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|