@velocitycareerlabs/server-webwallet 1.25.0-dev-build.12642c864
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/.localdev.env +57 -0
- package/.standalone.env +22 -0
- package/LICENSE +248 -0
- package/README.md +11 -0
- package/jest.config.js +20 -0
- package/migrate-mongo.config.js +23 -0
- package/package.json +72 -0
- package/src/config/config.js +74 -0
- package/src/controllers/accounts/autohooks.js +28 -0
- package/src/controllers/accounts/controller.js +209 -0
- package/src/controllers/accounts/schemas/index.js +6 -0
- package/src/controllers/accounts/schemas/webwallet-accounts-request.schema.js +25 -0
- package/src/controllers/accounts/schemas/webwallet-accounts-response.schema.js +72 -0
- package/src/controllers/accounts/schemas/webwallet-accounts-update-request.schema.js +23 -0
- package/src/controllers/accounts/schemas/webwallet-test-personas-response.schema.js +110 -0
- package/src/controllers/consent/autohooks.js +14 -0
- package/src/controllers/consent/controller.js +91 -0
- package/src/controllers/consent/schemas/index.js +3 -0
- package/src/controllers/consent/schemas/webwallet-consent-response.schema.js +23 -0
- package/src/controllers/credentials/autohooks.js +36 -0
- package/src/controllers/credentials/controller.js +92 -0
- package/src/controllers/credentials/schemas/index.js +4 -0
- package/src/controllers/credentials/schemas/webwallet-credential-categories-response.schema.js +21 -0
- package/src/controllers/credentials/schemas/webwallet-credentials-response.schema.js +29 -0
- package/src/controllers/disclosures/autohooks.js +21 -0
- package/src/controllers/disclosures/controller.js +168 -0
- package/src/controllers/disclosures/schemas/index.js +7 -0
- package/src/controllers/disclosures/schemas/webwallet-accept-presentation-request-body.schema.js +28 -0
- package/src/controllers/disclosures/schemas/webwallet-accept-presentation-response.schema.js +16 -0
- package/src/controllers/disclosures/schemas/webwallet-get-disclosures-response.schema.js +18 -0
- package/src/controllers/disclosures/schemas/webwallet-get-presentation-request-query.schema.js +21 -0
- package/src/controllers/disclosures/schemas/webwallet-get-presentation-request-response.schema.js +16 -0
- package/src/controllers/feedback/autohooks.js +11 -0
- package/src/controllers/feedback/controller.js +48 -0
- package/src/controllers/issuing/common-schemas/index.js +10 -0
- package/src/controllers/issuing/common-schemas/webwallet-get-credential-manifest-query.schema.js +27 -0
- package/src/controllers/issuing/common-schemas/webwallet-get-credential-manifest-response.schema.js +31 -0
- package/src/controllers/issuing/deep-link/autohooks.js +51 -0
- package/src/controllers/issuing/deep-link/controller.js +192 -0
- package/src/controllers/issuing/deep-link/schemas/index.js +6 -0
- package/src/controllers/issuing/deep-link/schemas/webwallet-deep-link-accept-offers-request.schema.js +30 -0
- package/src/controllers/issuing/deep-link/schemas/webwallet-deep-link-accept-offers-response.schema.js +36 -0
- package/src/controllers/issuing/deep-link/schemas/webwallet-deep-link-offers-request.schema.js +28 -0
- package/src/controllers/issuing/deep-link/schemas/webwallet-deep-link-offers-response.schema.js +48 -0
- package/src/controllers/issuing/identity-credentials/autohooks.js +42 -0
- package/src/controllers/issuing/identity-credentials/controller.js +188 -0
- package/src/controllers/issuing/identity-credentials/schemas/index.js +6 -0
- package/src/controllers/issuing/identity-credentials/schemas/webwallet-identity-credentials-confirm-body.schema.js +20 -0
- package/src/controllers/issuing/identity-credentials/schemas/webwallet-identity-credentials-confirm-response.schema.js +37 -0
- package/src/controllers/issuing/identity-credentials/schemas/webwallet-identity-credentials-request-code-body.schema.js +14 -0
- package/src/controllers/issuing/identity-credentials/schemas/webwallet-identity-credentials-request-code-params.schema.js +19 -0
- package/src/controllers/linkedin/autohooks.js +16 -0
- package/src/controllers/linkedin/controller.js +276 -0
- package/src/controllers/linkedin/schemas/index.js +3 -0
- package/src/controllers/linkedin/schemas/webwallet-linkedin-me-response.schema.js +14 -0
- package/src/controllers/root/controller.js +29 -0
- package/src/entities/.gitkeep +0 -0
- package/src/entities/accounts/constants.js +5 -0
- package/src/entities/accounts/domains/extract-auth0-id-token-or-access-token.js +22 -0
- package/src/entities/accounts/domains/index.js +5 -0
- package/src/entities/accounts/domains/validate-account-permissions.js +36 -0
- package/src/entities/accounts/domains/validate-logo-size.js +25 -0
- package/src/entities/accounts/index.js +5 -0
- package/src/entities/accounts/repos/accounts.repo.js +63 -0
- package/src/entities/credentials/domains/index.js +3 -0
- package/src/entities/credentials/domains/offer-to-credential-mongo-dto.js +43 -0
- package/src/entities/credentials/index.js +6 -0
- package/src/entities/credentials/orchestrators/index.js +3 -0
- package/src/entities/credentials/orchestrators/load-additional-render-info.js +65 -0
- package/src/entities/credentials/repos/credentials.repo.js +132 -0
- package/src/entities/credentials/schemas/index.js +4 -0
- package/src/entities/credentials/schemas/webwallet-credential-response.schema.js +138 -0
- package/src/entities/credentials/schemas/webwallet-credentials-response.schemas.js +95 -0
- package/src/entities/credentials/schemas/webwallet-display-descriptor-response.schema.js +106 -0
- package/src/entities/disclosures/index.js +4 -0
- package/src/entities/disclosures/repos/disclosures.repo.js +31 -0
- package/src/entities/disclosures/schemas/index.js +10 -0
- package/src/entities/disclosures/schemas/webwallet-disclosure.schema.js +39 -0
- package/src/entities/disclosures/schemas/webwallet-presentation-request-field.schema.js +45 -0
- package/src/entities/disclosures/schemas/webwallet-presentation-request-filter.schema.js +30 -0
- package/src/entities/disclosures/schemas/webwallet-presentation-request-format.schema.js +36 -0
- package/src/entities/disclosures/schemas/webwallet-presentation-request-input-descriptors.schema.js +111 -0
- package/src/entities/disclosures/schemas/webwallet-presentation-request-schema.schema.js +14 -0
- package/src/entities/disclosures/schemas/webwallet-presentation-request-submission-requirements.schema.js +37 -0
- package/src/entities/disclosures/schemas/webwallet-presentation-request.schema.js +79 -0
- package/src/entities/index.js +6 -0
- package/src/entities/issuing/domain/constants.js +8 -0
- package/src/entities/issuing/domain/does-user-have-fresh-pending-verification.js +26 -0
- package/src/entities/issuing/domain/get-credentials-from-offers.js +18 -0
- package/src/entities/issuing/domain/index.js +5 -0
- package/src/entities/issuing/index.js +5 -0
- package/src/entities/issuing/orchestrators/build-issuing-input-credentials.js +35 -0
- package/src/entities/issuing/orchestrators/generate-offers-by-deep-link.js +74 -0
- package/src/entities/issuing/orchestrators/get-identity-issuer.js +35 -0
- package/src/entities/issuing/orchestrators/get-identity-offers-by-deeplink.js +74 -0
- package/src/entities/issuing/orchestrators/index.js +6 -0
- package/src/entities/issuing/schemas/index.js +9 -0
- package/src/entities/issuing/schemas/webwallet-credential-manifest.schema.js +198 -0
- package/src/errors/error-codes.js +12 -0
- package/src/fetchers/career-wallet/create-account-fetcher.js +7 -0
- package/src/fetchers/career-wallet/create-did-fetcher.js +17 -0
- package/src/fetchers/career-wallet/get-app-config.js +11 -0
- package/src/fetchers/career-wallet/get-consents.js +13 -0
- package/src/fetchers/career-wallet/get-credential-categories.js +7 -0
- package/src/fetchers/career-wallet/get-personas.js +7 -0
- package/src/fetchers/career-wallet/index.js +12 -0
- package/src/fetchers/career-wallet/post-consent.js +9 -0
- package/src/fetchers/career-wallet/send-feedback.js +14 -0
- package/src/fetchers/career-wallet/sign-fetcher.js +14 -0
- package/src/fetchers/career-wallet/verify-id-credential-confirm-code.js +19 -0
- package/src/fetchers/career-wallet/verify-id-credential-request-code.js +20 -0
- package/src/fetchers/index.js +4 -0
- package/src/fetchers/lib-api/get-credential-display-schema.js +12 -0
- package/src/fetchers/lib-api/index.js +3 -0
- package/src/fetchers/linkedin/create-linkedin-post.js +45 -0
- package/src/fetchers/linkedin/get-access-token.js +26 -0
- package/src/fetchers/linkedin/get-linkedin-user-email.js +13 -0
- package/src/fetchers/linkedin/get-linkedin-user-id.js +16 -0
- package/src/fetchers/linkedin/index.js +9 -0
- package/src/fetchers/linkedin/register-image-to-upload.js +30 -0
- package/src/fetchers/linkedin/revoke-linkedin-access.js +20 -0
- package/src/fetchers/linkedin/upload-image-to-linkedin.js +16 -0
- package/src/index.js +15 -0
- package/src/init-server.js +108 -0
- package/src/plugins/crypto-services/index.js +5 -0
- package/src/plugins/crypto-services/jwt-sign-service-impl.js +72 -0
- package/src/plugins/crypto-services/jwt-verify-service-impl.js +21 -0
- package/src/plugins/crypto-services/key-service-impl.js +28 -0
- package/src/plugins/fetch-errors-handler-plugin.js +64 -0
- package/src/plugins/index.js +4 -0
- package/src/plugins/vnf-sdk-plugin.js +53 -0
- package/src/standalone.js +8 -0
- package/test/accounts-controller.test.js +618 -0
- package/test/consent-controller.test.js +185 -0
- package/test/credentials-controller.test.js +307 -0
- package/test/crypro-services/jwt-sign-service-impl.test.js +83 -0
- package/test/crypro-services/jwt-verify-service-impl.test.js +27 -0
- package/test/crypro-services/key-service-impl.test.js +76 -0
- package/test/crypro-services/mocks/index.js +4 -0
- package/test/crypro-services/mocks/jwt-mock.js +15 -0
- package/test/crypro-services/mocks/public-jwk.js +14 -0
- package/test/disclosures-controller/disclosure-credentials.test.js +428 -0
- package/test/disclosures-controller/get-disclosures.test.js +169 -0
- package/test/disclosures-controller/mocks/get-credential-manifest.js +20 -0
- package/test/disclosures-controller/mocks/index.js +6 -0
- package/test/disclosures-controller/mocks/presentation-request.js +32 -0
- package/test/disclosures-controller/mocks/presentation-submission.js +21 -0
- package/test/disclosures-controller/mocks/submission-result.js +19 -0
- package/test/factories/accounts.js +25 -0
- package/test/factories/credentials.js +66 -0
- package/test/factories/disclosures.js +106 -0
- package/test/feedback-controller.test.js +125 -0
- package/test/fetch-errors-handler-plugin.test.js +97 -0
- package/test/filter-deleted-credentials-extension.test.js +82 -0
- package/test/helpers/.env.test +10 -0
- package/test/helpers/nock-consent-add.js +16 -0
- package/test/helpers/nock-consents-get.js +15 -0
- package/test/helpers/nock-feedback.js +9 -0
- package/test/helpers/nock-linkedin-access-token.js +9 -0
- package/test/helpers/nock-linkedin-email.js +15 -0
- package/test/helpers/nock-linkedin-image-register.js +28 -0
- package/test/helpers/nock-linkedin-me.js +13 -0
- package/test/helpers/nock-linkedin-post.js +37 -0
- package/test/helpers/nock-linkedin-revoke.js +9 -0
- package/test/helpers/nock-test-personas.js +13 -0
- package/test/helpers/webwallet-build-fastify.js +17 -0
- package/test/issuing-controller/issuing-by-deeplink-empty-offers.test.js +142 -0
- package/test/issuing-controller/issuing-by-deeplink-failed-offers.test.js +142 -0
- package/test/issuing-controller/issuing-by-deeplink.test.js +492 -0
- package/test/issuing-controller/issuing-identity-credentials.test.js +377 -0
- package/test/issuing-controller/mocks/accept-offers-response.js +90 -0
- package/test/issuing-controller/mocks/accepted-credentials.js +47 -0
- package/test/issuing-controller/mocks/credential-manifest-presentation.js +72 -0
- package/test/issuing-controller/mocks/credential-manifest.js +45 -0
- package/test/issuing-controller/mocks/identity-issuing/accept-offers.js +22 -0
- package/test/issuing-controller/mocks/identity-issuing/confirm-verification-code.js +5 -0
- package/test/issuing-controller/mocks/identity-issuing/get-app-config.js +52 -0
- package/test/issuing-controller/mocks/identity-issuing/get-organization.js +118 -0
- package/test/issuing-controller/mocks/identity-issuing/index.js +6 -0
- package/test/issuing-controller/mocks/index.js +6 -0
- package/test/issuing-controller/mocks/issuers.js +126 -0
- package/test/issuing-controller/mocks/offers.js +48 -0
- package/test/issuing-controller/mocks/schema.js +107 -0
- package/test/linkedin-controller.test.js +452 -0
- package/test/mocks/credential-categories.js +115 -0
- package/test/mocks/credentials.js +15 -0
- package/test/mocks/didjwk.js +25 -0
- package/test/mocks/index.js +7 -0
- package/test/mocks/issuers.js +88 -0
- package/test/mocks/jwk.js +53 -0
- package/test/mocks/schema.js +107 -0
- package/test/root.test.js +42 -0
- package/test/vcl-sdk-plugin.test.js +86 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const {
|
|
2
|
+
autoboxIdsExtension,
|
|
3
|
+
repoFactory,
|
|
4
|
+
} = require('@spencejs/spence-mongo-repos');
|
|
5
|
+
|
|
6
|
+
module.exports = (app, _, next = () => {}) => {
|
|
7
|
+
next();
|
|
8
|
+
return repoFactory(
|
|
9
|
+
{
|
|
10
|
+
name: 'credentials',
|
|
11
|
+
entityName: 'credentials',
|
|
12
|
+
defaultProjection: {
|
|
13
|
+
_id: 1,
|
|
14
|
+
/**
|
|
15
|
+
* @type {Array<string>}
|
|
16
|
+
*/
|
|
17
|
+
type: 1,
|
|
18
|
+
/**
|
|
19
|
+
* @type {string}
|
|
20
|
+
*/
|
|
21
|
+
did: 1,
|
|
22
|
+
/**
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
auth0UserId: 1,
|
|
26
|
+
/**
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
userDid: 1,
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {Object} CredentialStatus
|
|
32
|
+
* @property {string} type
|
|
33
|
+
* @property {string} id
|
|
34
|
+
* @property {number} statusListIndex
|
|
35
|
+
* @property {string} statusListCredential
|
|
36
|
+
*/
|
|
37
|
+
credentialStatus: 1,
|
|
38
|
+
/**
|
|
39
|
+
* @typedef {Object} LinkCodeCommitment
|
|
40
|
+
* @property {string} type
|
|
41
|
+
* @property {string} value
|
|
42
|
+
*/
|
|
43
|
+
linkCodeCommitment: 1,
|
|
44
|
+
/**
|
|
45
|
+
* @typedef {Object} Issuer
|
|
46
|
+
* @property {string} id
|
|
47
|
+
*/
|
|
48
|
+
issuer: 1,
|
|
49
|
+
/**
|
|
50
|
+
* @typedef {Object} ContentHash
|
|
51
|
+
* @property {string} type
|
|
52
|
+
* @property {string} value
|
|
53
|
+
*/
|
|
54
|
+
contentHash: 1,
|
|
55
|
+
/**
|
|
56
|
+
* @type {string}
|
|
57
|
+
*/
|
|
58
|
+
credentialSchema: 1,
|
|
59
|
+
/**
|
|
60
|
+
* @type {number}
|
|
61
|
+
*/
|
|
62
|
+
vnfProtocolVersion: 1,
|
|
63
|
+
/**
|
|
64
|
+
* @type {Array<string>}
|
|
65
|
+
*/
|
|
66
|
+
context: 1,
|
|
67
|
+
/**
|
|
68
|
+
* @typedef {Object} CredentialSubject
|
|
69
|
+
* @property {object} hasCredential
|
|
70
|
+
* @property {string} hasCredential.id
|
|
71
|
+
* @property {string} hasCredential.type
|
|
72
|
+
* @property {string} hasCredential.name
|
|
73
|
+
* @property {string} hasCredential.description
|
|
74
|
+
* @property {string} hasCredential.image
|
|
75
|
+
* @property {string} hasCredential.criteria
|
|
76
|
+
* @property {string} hasCredential.issuer
|
|
77
|
+
* @property {string} type
|
|
78
|
+
* @property {Array<string>} @context
|
|
79
|
+
*/
|
|
80
|
+
credentialSubject: 1,
|
|
81
|
+
/**
|
|
82
|
+
* @type {number}
|
|
83
|
+
*/
|
|
84
|
+
jti: 1,
|
|
85
|
+
/**
|
|
86
|
+
* @type {string}
|
|
87
|
+
*/
|
|
88
|
+
iss: 1,
|
|
89
|
+
/**
|
|
90
|
+
* Original encoded credential JWT
|
|
91
|
+
* @type {string}
|
|
92
|
+
*/
|
|
93
|
+
encodedCredential: 1,
|
|
94
|
+
/**
|
|
95
|
+
* @type {Date}
|
|
96
|
+
*/
|
|
97
|
+
createdAt: 1,
|
|
98
|
+
/**
|
|
99
|
+
* @type {Date}
|
|
100
|
+
*/
|
|
101
|
+
deletedAt: 1,
|
|
102
|
+
/**
|
|
103
|
+
* @type {Date}
|
|
104
|
+
*/
|
|
105
|
+
updatedAt: 1,
|
|
106
|
+
/**
|
|
107
|
+
* @typedef {Object} RelatedResource
|
|
108
|
+
* @property {string} id
|
|
109
|
+
* @property {string} mediaType
|
|
110
|
+
*/
|
|
111
|
+
/**
|
|
112
|
+
* @type {Array<RelatedResource>}
|
|
113
|
+
*/
|
|
114
|
+
relatedResource: 1,
|
|
115
|
+
},
|
|
116
|
+
extensions: [autoboxIdsExtension, filterDeletedCredentialsExtension],
|
|
117
|
+
},
|
|
118
|
+
app
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const filterDeletedCredentialsExtension = (parent) => {
|
|
123
|
+
return {
|
|
124
|
+
prepFilter: (filter) => {
|
|
125
|
+
return parent.prepFilter({
|
|
126
|
+
...filter,
|
|
127
|
+
deletedAt: filter.deletedAt ?? { $exists: false },
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
extensions: parent.extensions.concat(['filterDeletedCredentialsExtension']),
|
|
131
|
+
};
|
|
132
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
const webWalletCredentialResponseSchema = {
|
|
2
|
+
$id: 'https://velocitycareerlabs.io/webwallet-credential-response.schema.json',
|
|
3
|
+
title: 'webwallet-credential-response',
|
|
4
|
+
description: 'credential response from webwallet',
|
|
5
|
+
type: 'object',
|
|
6
|
+
properties: {
|
|
7
|
+
id: {
|
|
8
|
+
type: 'string',
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: 'array',
|
|
12
|
+
items: {
|
|
13
|
+
type: 'string',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
did: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
},
|
|
19
|
+
auth0UserId: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
},
|
|
22
|
+
userDid: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
},
|
|
25
|
+
credentialStatus: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
additionalProperties: true,
|
|
28
|
+
},
|
|
29
|
+
linkCodeCommitment: {
|
|
30
|
+
type: 'object',
|
|
31
|
+
additionalProperties: true,
|
|
32
|
+
},
|
|
33
|
+
issuer: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
id: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
contentHash: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
additionalProperties: true,
|
|
44
|
+
},
|
|
45
|
+
credentialSchema: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
additionalProperties: true,
|
|
48
|
+
},
|
|
49
|
+
vnfProtocolVersion: {
|
|
50
|
+
type: 'number',
|
|
51
|
+
},
|
|
52
|
+
context: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
items: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
credentialSubject: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
properties: {
|
|
61
|
+
hasCredential: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
additionalProperties: true,
|
|
64
|
+
},
|
|
65
|
+
type: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
},
|
|
68
|
+
'@context': {
|
|
69
|
+
oneOf: [
|
|
70
|
+
{
|
|
71
|
+
type: 'string',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'array',
|
|
75
|
+
items: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
additionalProperties: true,
|
|
83
|
+
},
|
|
84
|
+
jti: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
},
|
|
87
|
+
iss: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
},
|
|
90
|
+
encodedCredential: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
},
|
|
93
|
+
createdAt: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
},
|
|
96
|
+
updatedAt: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
},
|
|
99
|
+
relatedResource: {
|
|
100
|
+
type: 'array',
|
|
101
|
+
items: {
|
|
102
|
+
type: 'object',
|
|
103
|
+
additionalProperties: true,
|
|
104
|
+
properties: {
|
|
105
|
+
id: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
},
|
|
108
|
+
mediaType: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
required: [
|
|
116
|
+
'id',
|
|
117
|
+
'type',
|
|
118
|
+
'did',
|
|
119
|
+
'auth0UserId',
|
|
120
|
+
'userDid',
|
|
121
|
+
'credentialStatus',
|
|
122
|
+
'issuer',
|
|
123
|
+
'contentHash',
|
|
124
|
+
'credentialSchema',
|
|
125
|
+
'vnfProtocolVersion',
|
|
126
|
+
'context',
|
|
127
|
+
'credentialSubject',
|
|
128
|
+
'jti',
|
|
129
|
+
'iss',
|
|
130
|
+
'encodedCredential',
|
|
131
|
+
'createdAt',
|
|
132
|
+
'updatedAt',
|
|
133
|
+
],
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
module.exports = {
|
|
137
|
+
webWalletCredentialResponseSchema,
|
|
138
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const webWalletCredentialResponseSchema = {
|
|
2
|
+
$id: 'https://velocitycareerlabs.io/webwallet-credential-response.schema.json',
|
|
3
|
+
title: 'webwallet-credentials-response',
|
|
4
|
+
description: 'credentials response from webwallet',
|
|
5
|
+
type: 'object',
|
|
6
|
+
properties: {
|
|
7
|
+
type: {
|
|
8
|
+
type: 'array',
|
|
9
|
+
items: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
did: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
},
|
|
16
|
+
auth0UserId: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
},
|
|
19
|
+
credentialStatus: {
|
|
20
|
+
type: 'object',
|
|
21
|
+
additionalProperties: true,
|
|
22
|
+
},
|
|
23
|
+
linkCodeCommitment: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
additionalProperties: true,
|
|
26
|
+
},
|
|
27
|
+
issuer: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
id: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
contentHash: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
additionalProperties: true,
|
|
38
|
+
},
|
|
39
|
+
credentialSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
additionalProperties: true,
|
|
42
|
+
},
|
|
43
|
+
vnfProtocolVersion: {
|
|
44
|
+
type: 'number',
|
|
45
|
+
},
|
|
46
|
+
context: {
|
|
47
|
+
type: 'array',
|
|
48
|
+
items: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
credentialSubject: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
hasCredential: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
additionalProperties: true,
|
|
58
|
+
},
|
|
59
|
+
type: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
},
|
|
62
|
+
'@context': {
|
|
63
|
+
type: 'array',
|
|
64
|
+
items: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
additionalProperties: true,
|
|
70
|
+
},
|
|
71
|
+
jti: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
},
|
|
74
|
+
iss: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
},
|
|
77
|
+
createdAt: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
},
|
|
80
|
+
updatedAt: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
},
|
|
83
|
+
relatedResource: {
|
|
84
|
+
type: 'array',
|
|
85
|
+
items: {
|
|
86
|
+
type: 'object',
|
|
87
|
+
additionalProperties: true,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
module.exports = {
|
|
94
|
+
webWalletCredentialResponseSchema,
|
|
95
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
const webWalletDisplayDescriptorResponseSchema = {
|
|
2
|
+
$id: 'https://velocitycareerlabs.io/webwallet-display-descriptor-response.schema.json',
|
|
3
|
+
title: 'webwallet-display-descriptor-response',
|
|
4
|
+
description: 'display descriptor response from webwallet',
|
|
5
|
+
type: 'object',
|
|
6
|
+
properties: {
|
|
7
|
+
title: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
path: { type: 'array', items: { type: 'string' } },
|
|
11
|
+
schema: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
title: { type: 'string' },
|
|
15
|
+
format: { type: 'string' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
fallback: { type: 'string', default: '-' },
|
|
19
|
+
text: { type: 'string' },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
subtitle: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
path: { type: 'array', items: { type: 'string' } },
|
|
26
|
+
schema: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: {
|
|
29
|
+
title: { type: 'string' },
|
|
30
|
+
format: { type: 'string' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
fallback: { type: 'string', default: '-' },
|
|
34
|
+
text: { type: 'string' },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
summary_detail: {
|
|
38
|
+
type: 'object',
|
|
39
|
+
properties: {
|
|
40
|
+
path: { type: 'array', items: { type: 'string' } },
|
|
41
|
+
schema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
title: { type: 'string' },
|
|
45
|
+
format: { type: 'string' },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
fallback: { type: 'string', default: '-' },
|
|
49
|
+
text: { type: 'string' },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
description: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
path: { type: 'array', items: { type: 'string' } },
|
|
56
|
+
schema: {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {
|
|
59
|
+
title: { type: 'string' },
|
|
60
|
+
format: { type: 'string' },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
fallback: { type: 'string', default: '-' },
|
|
64
|
+
text: { type: 'string' },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
logo: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
path: { type: 'array', items: { type: 'string' } },
|
|
71
|
+
schema: {
|
|
72
|
+
type: 'object',
|
|
73
|
+
properties: {
|
|
74
|
+
title: { type: 'string' },
|
|
75
|
+
format: { type: 'string' },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
fallback: { type: 'string', default: '-' },
|
|
79
|
+
text: { type: 'string' },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
properties: {
|
|
83
|
+
type: 'array',
|
|
84
|
+
items: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
label: { type: 'string' },
|
|
88
|
+
path: { type: 'array', items: { type: 'string' } },
|
|
89
|
+
schema: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
properties: {
|
|
92
|
+
title: { type: 'string' },
|
|
93
|
+
format: { type: 'string' },
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
fallback: { type: 'string', default: '-' },
|
|
97
|
+
text: { type: 'string' },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
module.exports = {
|
|
105
|
+
webWalletDisplayDescriptorResponseSchema,
|
|
106
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const {
|
|
2
|
+
autoboxIdsExtension,
|
|
3
|
+
repoFactory,
|
|
4
|
+
} = require('@spencejs/spence-mongo-repos');
|
|
5
|
+
|
|
6
|
+
module.exports = (app, _, next = () => {}) => {
|
|
7
|
+
next();
|
|
8
|
+
return repoFactory(
|
|
9
|
+
{
|
|
10
|
+
name: 'disclosures',
|
|
11
|
+
entityName: 'disclosures',
|
|
12
|
+
defaultProjection: {
|
|
13
|
+
_id: 1,
|
|
14
|
+
auth0UserId: 1,
|
|
15
|
+
userDid: 1,
|
|
16
|
+
jti: 1,
|
|
17
|
+
presentationDefinitionId: 1,
|
|
18
|
+
submissionId: 1,
|
|
19
|
+
encodedJwt: 1,
|
|
20
|
+
presentation: 1,
|
|
21
|
+
token: 1,
|
|
22
|
+
sharedCredentials: 1,
|
|
23
|
+
type: 1,
|
|
24
|
+
createdAt: 1,
|
|
25
|
+
updatedAt: 1,
|
|
26
|
+
},
|
|
27
|
+
extensions: [autoboxIdsExtension],
|
|
28
|
+
},
|
|
29
|
+
app
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
...require('./webwallet-presentation-request-schema.schema'),
|
|
3
|
+
...require('./webwallet-presentation-request-field.schema'),
|
|
4
|
+
...require('./webwallet-presentation-request-filter.schema'),
|
|
5
|
+
...require('./webwallet-presentation-request-format.schema'),
|
|
6
|
+
...require('./webwallet-presentation-request-submission-requirements.schema'),
|
|
7
|
+
...require('./webwallet-presentation-request-input-descriptors.schema'),
|
|
8
|
+
...require('./webwallet-presentation-request.schema'),
|
|
9
|
+
...require('./webwallet-disclosure.schema'),
|
|
10
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const webWalletDisclosureSchema = {
|
|
2
|
+
$id: 'https://velocitycareerlabs.io/webwallet-disclosure.schema.json',
|
|
3
|
+
title: 'webwallet-disclosure',
|
|
4
|
+
description: 'The schema of the accepted presentation request (disclosure)',
|
|
5
|
+
type: 'object',
|
|
6
|
+
properties: {
|
|
7
|
+
id: { type: 'string' },
|
|
8
|
+
jti: { type: 'string' },
|
|
9
|
+
submissionId: { type: 'string' },
|
|
10
|
+
presentationDefinitionId: { type: 'string' },
|
|
11
|
+
encodedJwt: { type: 'string' },
|
|
12
|
+
presentation: {
|
|
13
|
+
$ref: 'https://velocitycareerlabs.io/presentation-request.schema.json',
|
|
14
|
+
},
|
|
15
|
+
token: { type: 'string' },
|
|
16
|
+
sharedCredentials: {
|
|
17
|
+
type: 'array',
|
|
18
|
+
items: { type: 'string' },
|
|
19
|
+
},
|
|
20
|
+
type: { type: 'string', enum: ['public', 'linkedin'] },
|
|
21
|
+
createdAt: { type: 'string' },
|
|
22
|
+
updatedAt: { type: 'string' },
|
|
23
|
+
},
|
|
24
|
+
required: [
|
|
25
|
+
'id',
|
|
26
|
+
'jti',
|
|
27
|
+
'submissionId',
|
|
28
|
+
'presentationDefinitionId',
|
|
29
|
+
'encodedJwt',
|
|
30
|
+
'presentation',
|
|
31
|
+
'token',
|
|
32
|
+
'createdAt',
|
|
33
|
+
'updatedAt',
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
module.exports = {
|
|
38
|
+
webWalletDisclosureSchema,
|
|
39
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const webWalletPresentationRequestFieldSchema = {
|
|
2
|
+
$id: 'https://velocitycareerlabs.io/webwallet-presentation-request-field.schema.json',
|
|
3
|
+
type: 'object',
|
|
4
|
+
oneOf: [
|
|
5
|
+
{
|
|
6
|
+
properties: {
|
|
7
|
+
id: { type: 'string' },
|
|
8
|
+
path: {
|
|
9
|
+
type: 'array',
|
|
10
|
+
items: { type: 'string' },
|
|
11
|
+
},
|
|
12
|
+
purpose: { type: 'string' },
|
|
13
|
+
filter: {
|
|
14
|
+
$ref: 'https://velocitycareerlabs.io/webwallet-presentation-request-filter.schema.json',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
required: ['path'],
|
|
18
|
+
additionalProperties: false,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
properties: {
|
|
22
|
+
id: { type: 'string' },
|
|
23
|
+
path: {
|
|
24
|
+
type: 'array',
|
|
25
|
+
items: { type: 'string' },
|
|
26
|
+
},
|
|
27
|
+
purpose: { type: 'string' },
|
|
28
|
+
filter: {
|
|
29
|
+
$ref: 'https://velocitycareerlabs.io/webwallet-presentation-request-filter.schema.json',
|
|
30
|
+
},
|
|
31
|
+
predicate: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
enum: ['required', 'preferred'],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
required: ['path', 'filter', 'predicate'],
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
module.exports = {
|
|
44
|
+
webWalletPresentationRequestFieldSchema,
|
|
45
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const webWalletPresentationRequestFilterSchema = {
|
|
2
|
+
$id: 'https://velocitycareerlabs.io/webwallet-presentation-request-filter.schema.json',
|
|
3
|
+
type: 'object',
|
|
4
|
+
properties: {
|
|
5
|
+
type: { type: 'string' },
|
|
6
|
+
format: { type: 'string' },
|
|
7
|
+
pattern: { type: 'string' },
|
|
8
|
+
minimum: { type: ['number', 'string'] },
|
|
9
|
+
minLength: { type: 'integer' },
|
|
10
|
+
maxLength: { type: 'integer' },
|
|
11
|
+
exclusiveMinimum: { type: ['number', 'string'] },
|
|
12
|
+
exclusiveMaximum: { type: ['number', 'string'] },
|
|
13
|
+
maximum: { type: ['number', 'string'] },
|
|
14
|
+
const: { type: ['number', 'string'] },
|
|
15
|
+
enum: {
|
|
16
|
+
type: 'array',
|
|
17
|
+
items: { type: ['number', 'string'] },
|
|
18
|
+
},
|
|
19
|
+
not: {
|
|
20
|
+
type: 'object',
|
|
21
|
+
minProperties: 1,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
required: ['type'],
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
module.exports = {
|
|
29
|
+
webWalletPresentationRequestFilterSchema,
|
|
30
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const webWalletPresentationRequestFormatSchema = {
|
|
2
|
+
$id: 'https://velocitycareerlabs.io/webwallet-presentation-request-format.schema.json',
|
|
3
|
+
type: 'object',
|
|
4
|
+
patternProperties: {
|
|
5
|
+
'^jwt$|^jwt_vc$|^jwt_vp$': {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
alg: {
|
|
9
|
+
type: 'array',
|
|
10
|
+
minItems: 1,
|
|
11
|
+
items: { type: 'string' },
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
required: ['alg'],
|
|
15
|
+
additionalProperties: false,
|
|
16
|
+
},
|
|
17
|
+
'^ldp_vc$|^ldp_vp$|^ldp$': {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
proof_type: {
|
|
21
|
+
type: 'array',
|
|
22
|
+
minItems: 1,
|
|
23
|
+
items: { type: 'string' },
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ['proof_type'],
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
},
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
},
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
module.exports = {
|
|
35
|
+
webWalletPresentationRequestFormatSchema,
|
|
36
|
+
};
|