@verii/server-credentialing-hub 2.0.0
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/LICENSE +202 -0
- package/README.md +13 -0
- package/package.json +87 -0
- package/src/assets/templates/app-redirect.hbs +22 -0
- package/src/config/config.js +118 -0
- package/src/config/index.js +19 -0
- package/src/controllers/app-redirect/controller.js +85 -0
- package/src/controllers/openid4vc/autohooks.js +22 -0
- package/src/controllers/openid4vc/oauth-controller.js +96 -0
- package/src/controllers/openid4vc/openid4vc-metadata-controller.js +66 -0
- package/src/controllers/openid4vc/openid4vci-controller.js +125 -0
- package/src/controllers/openid4vp/autohooks.js +22 -0
- package/src/controllers/openid4vp/openid4vp-controller.js +177 -0
- package/src/controllers/operator/autohooks.js +31 -0
- package/src/controllers/operator/credentials/credentials-controller.js +212 -0
- package/src/controllers/operator/credentials/schemas/credential.schema.js +46 -0
- package/src/controllers/operator/credentials/schemas/index.js +7 -0
- package/src/controllers/operator/credentials/schemas/new-credential.schema.json +23 -0
- package/src/controllers/operator/depots/depots-controller.js +154 -0
- package/src/controllers/operator/depots/schemas/depot.schema.js +34 -0
- package/src/controllers/operator/depots/schemas/index.js +24 -0
- package/src/controllers/operator/depots/schemas/new-depot.schema.json +30 -0
- package/src/controllers/operator/issue-links/issue-links-controller.js +74 -0
- package/src/controllers/operator/issuer-services/issuer-services-controller.js +200 -0
- package/src/controllers/operator/issuer-services/schemas/index.js +7 -0
- package/src/controllers/operator/issuer-services/schemas/issuer-service.schema.js +26 -0
- package/src/controllers/operator/issuer-services/schemas/new-issuer-service.schema.js +137 -0
- package/src/controllers/operator/presentation-links/presentation-links-controller.js +76 -0
- package/src/controllers/operator/presentations/presentations-controller.js +174 -0
- package/src/controllers/operator/presentations/schemas/base-presentation.schema.js +39 -0
- package/src/controllers/operator/presentations/schemas/credential-verification.schema.js +83 -0
- package/src/controllers/operator/presentations/schemas/index.js +23 -0
- package/src/controllers/operator/presentations/schemas/presentation-verification.schema.js +42 -0
- package/src/controllers/operator/presentations/schemas/presentation.schema.js +53 -0
- package/src/controllers/operator/presentations/schemas/w3c-presentation.js +52 -0
- package/src/controllers/operator/relying-party-services/relying-party-services-controller.js +202 -0
- package/src/controllers/operator/relying-party-services/schemas/index.js +7 -0
- package/src/controllers/operator/relying-party-services/schemas/new-relying-party-service.schema.js +91 -0
- package/src/controllers/operator/relying-party-services/schemas/relying-party-service.schema.js +26 -0
- package/src/controllers/operator/tenants/schemas/index.js +33 -0
- package/src/controllers/operator/tenants/schemas/jwk.schema.json +56 -0
- package/src/controllers/operator/tenants/schemas/key-metadata.schema.json +12 -0
- package/src/controllers/operator/tenants/schemas/new-key-metadata.schema.json +42 -0
- package/src/controllers/operator/tenants/schemas/new-key.schema.json +12 -0
- package/src/controllers/operator/tenants/schemas/new-tenant.schema.json +33 -0
- package/src/controllers/operator/tenants/schemas/secret-key.schema.json +33 -0
- package/src/controllers/operator/tenants/schemas/tenant.schema.json +44 -0
- package/src/controllers/operator/tenants/tenants-controller.js +165 -0
- package/src/controllers/root-controller.js +43 -0
- package/src/controllers/vn-api/schemas/index.js +25 -0
- package/src/controllers/vn-api/schemas/presentation-submission.schema.json +41 -0
- package/src/controllers/vn-api/schemas/velocity-presentation-submission.response.200.schema.json +36 -0
- package/src/controllers/vn-api/schemas/velocity-presentation-submission.schema.json +31 -0
- package/src/controllers/vn-api/vn-api-presentation-controller.js +158 -0
- package/src/controllers/vn-api/vn-issuing-controller.js +295 -0
- package/src/entities/credential-types/fetchers/fetch-credential-type-descriptors.js +36 -0
- package/src/entities/credential-types/fetchers/index.js +19 -0
- package/src/entities/credential-types/index.js +19 -0
- package/src/entities/credentials/domain/canonicalize-credentials.js +70 -0
- package/src/entities/credentials/domain/credential-errors.js +25 -0
- package/src/entities/credentials/domain/credential-format.js +21 -0
- package/src/entities/credentials/domain/index.js +22 -0
- package/src/entities/credentials/domain/validate-credential.js +74 -0
- package/src/entities/credentials/facades/anchor-verii-credentials-facade.js +45 -0
- package/src/entities/credentials/facades/build-verii-issuer.js +44 -0
- package/src/entities/credentials/facades/index.js +22 -0
- package/src/entities/credentials/facades/issue-verii-credentials-facade.js +62 -0
- package/src/entities/credentials/facades/sign-verii-credentials-facade.js +56 -0
- package/src/entities/credentials/factories/credential-factory.js +53 -0
- package/src/entities/credentials/factories/index.js +19 -0
- package/src/entities/credentials/index.js +23 -0
- package/src/entities/credentials/orchestrators/create-credentials.js +118 -0
- package/src/entities/credentials/orchestrators/index.js +19 -0
- package/src/entities/credentials/repo/finders-extension.js +94 -0
- package/src/entities/credentials/repo/index.js +19 -0
- package/src/entities/credentials/repo/repo.js +62 -0
- package/src/entities/credentials/repo/update-issued-credential.js +60 -0
- package/src/entities/depots/domain/depot-errors.js +23 -0
- package/src/entities/depots/domain/index.js +20 -0
- package/src/entities/depots/domain/validate-depot.js +38 -0
- package/src/entities/depots/factories/depot-factory.js +50 -0
- package/src/entities/depots/factories/index.js +19 -0
- package/src/entities/depots/index.js +22 -0
- package/src/entities/depots/orchestrators/create-depot.js +31 -0
- package/src/entities/depots/orchestrators/delete-depot.js +43 -0
- package/src/entities/depots/orchestrators/index.js +20 -0
- package/src/entities/depots/repo/find-depot-by-preauth-code.js +30 -0
- package/src/entities/depots/repo/find-depots-extension.js +34 -0
- package/src/entities/depots/repo/index.js +19 -0
- package/src/entities/depots/repo/refresh-preauth-code.js +30 -0
- package/src/entities/depots/repo/repo.js +61 -0
- package/src/entities/exchanges/adapters/index.js +17 -0
- package/src/entities/exchanges/adapters/sign-exchange-response.js +37 -0
- package/src/entities/exchanges/domain/authorize-exchange.js +29 -0
- package/src/entities/exchanges/domain/build-exchange-event.js +19 -0
- package/src/entities/exchanges/domain/build-presentation-request.js +174 -0
- package/src/entities/exchanges/domain/exchange-errors.js +28 -0
- package/src/entities/exchanges/domain/exchange-protocols.js +29 -0
- package/src/entities/exchanges/domain/exchange-states.js +53 -0
- package/src/entities/exchanges/domain/exchange-types.js +22 -0
- package/src/entities/exchanges/domain/generate-issuing-challenge.js +48 -0
- package/src/entities/exchanges/domain/index.js +32 -0
- package/src/entities/exchanges/domain/validate-message-settings.js +33 -0
- package/src/entities/exchanges/domain/validate-new-exchange.js +25 -0
- package/src/entities/exchanges/domain/validate-preauth.js +45 -0
- package/src/entities/exchanges/domain/validate-referenced-service.js +33 -0
- package/src/entities/exchanges/domain/verify-issuing-challenge.js +42 -0
- package/src/entities/exchanges/domain/verify-proof-of-key-possession.js +128 -0
- package/src/entities/exchanges/factories/index.js +19 -0
- package/src/entities/exchanges/factories/init-exchange-factory.js +58 -0
- package/src/entities/exchanges/hooks/exchange-error-hook.js +30 -0
- package/src/entities/exchanges/hooks/index.js +17 -0
- package/src/entities/exchanges/index.js +24 -0
- package/src/entities/exchanges/orchestrators/authenticate.js +67 -0
- package/src/entities/exchanges/orchestrators/credential-offer-request.js +70 -0
- package/src/entities/exchanges/orchestrators/get-credential-manifest.js +84 -0
- package/src/entities/exchanges/orchestrators/get-presentation-request.js +114 -0
- package/src/entities/exchanges/orchestrators/index.js +24 -0
- package/src/entities/exchanges/orchestrators/issue-credentials.js +132 -0
- package/src/entities/exchanges/orchestrators/post-presentation.js +58 -0
- package/src/entities/exchanges/repo/exchange-state-repo-extension.js +78 -0
- package/src/entities/exchanges/repo/index.js +19 -0
- package/src/entities/exchanges/repo/repo.js +52 -0
- package/src/entities/issuer-services/domain/index.js +20 -0
- package/src/entities/issuer-services/domain/issuer-services-errors.js +23 -0
- package/src/entities/issuer-services/domain/validate-issuer-service.js +23 -0
- package/src/entities/issuer-services/factories/index.js +19 -0
- package/src/entities/issuer-services/factories/issuer-service-factory.js +44 -0
- package/src/entities/issuer-services/index.js +21 -0
- package/src/entities/issuer-services/repo/find-issuer-services-extension.js +30 -0
- package/src/entities/issuer-services/repo/index.js +19 -0
- package/src/entities/issuer-services/repo/repo.js +59 -0
- package/src/entities/keys/adapters/index.js +19 -0
- package/src/entities/keys/adapters/load-primary-account.js +39 -0
- package/src/entities/keys/domain/cih-key-purposes.js +23 -0
- package/src/entities/keys/domain/get-key-with-purpose.js +22 -0
- package/src/entities/keys/domain/index.js +22 -0
- package/src/entities/keys/domain/key-errors.js +25 -0
- package/src/entities/keys/domain/normalize-tenant-key.js +33 -0
- package/src/entities/keys/domain/validate-tenant-keys.js +78 -0
- package/src/entities/keys/factories/index.js +19 -0
- package/src/entities/keys/factories/key-factory.js +61 -0
- package/src/entities/keys/index.js +22 -0
- package/src/entities/keys/plugins/index.js +17 -0
- package/src/entities/keys/plugins/kms-plugin.js +61 -0
- package/src/entities/links/domain/build-deep-link-url.js +58 -0
- package/src/entities/links/domain/build-openid4vci-credential-offer-link.js +31 -0
- package/src/entities/links/domain/build-openid4vp-authorization-request-link.js +36 -0
- package/src/entities/links/domain/build-redirect-url.js +29 -0
- package/src/entities/links/domain/build-vn-api-issuing-link.js +54 -0
- package/src/entities/links/domain/build-vn-api-presentation-link.js +49 -0
- package/src/entities/links/domain/index.js +28 -0
- package/src/entities/links/domain/is-preauth-code-auth.js +19 -0
- package/src/entities/links/domain/link-errors.js +23 -0
- package/src/entities/links/domain/validate-issue-link.js +39 -0
- package/src/entities/links/domain/validate-presentation-link.js +39 -0
- package/src/entities/links/index.js +20 -0
- package/src/entities/links/orchestrators/index.js +17 -0
- package/src/entities/links/orchestrators/refresh-links.js +139 -0
- package/src/entities/openid4vci/domain/index.js +20 -0
- package/src/entities/openid4vci/domain/openid4vci-errors.js +24 -0
- package/src/entities/openid4vci/domain/to-credential-configuration-id.js +21 -0
- package/src/entities/openid4vci/index.js +21 -0
- package/src/entities/openid4vci/orchestrators/create-access-token.js +85 -0
- package/src/entities/openid4vci/orchestrators/create-credential.js +108 -0
- package/src/entities/openid4vci/orchestrators/get-authorization-server-metadata.js +22 -0
- package/src/entities/openid4vci/orchestrators/get-credential-issuer-metadata.js +22 -0
- package/src/entities/openid4vci/orchestrators/handle-notification.js +94 -0
- package/src/entities/openid4vci/orchestrators/index.js +24 -0
- package/src/entities/openid4vci/plugins/index.js +19 -0
- package/src/entities/openid4vci/plugins/openid4vci-plugin.js +427 -0
- package/src/entities/openid4vp/domain/index.js +21 -0
- package/src/entities/openid4vp/domain/openid4vp-request-id.js +47 -0
- package/src/entities/openid4vp/domain/presentation-request-expiry.js +37 -0
- package/src/entities/openid4vp/domain/wallet-metadata.js +30 -0
- package/src/entities/openid4vp/index.js +21 -0
- package/src/entities/openid4vp/orchestrators/create-authorization-request.js +183 -0
- package/src/entities/openid4vp/orchestrators/index.js +20 -0
- package/src/entities/openid4vp/orchestrators/post-authorization-response.js +353 -0
- package/src/entities/openid4vp/plugins/index.js +19 -0
- package/src/entities/openid4vp/plugins/openid4vp-plugin.js +174 -0
- package/src/entities/presentations/domain/index.js +20 -0
- package/src/entities/presentations/domain/presentation-format.js +20 -0
- package/src/entities/presentations/domain/validate-presentation.js +178 -0
- package/src/entities/presentations/factories/index.js +19 -0
- package/src/entities/presentations/factories/presentation-factory.js +96 -0
- package/src/entities/presentations/index.js +21 -0
- package/src/entities/presentations/orchestrators/index.js +19 -0
- package/src/entities/presentations/orchestrators/verify-presentation.js +131 -0
- package/src/entities/presentations/repo/add-verification.js +31 -0
- package/src/entities/presentations/repo/finders-extension.js +50 -0
- package/src/entities/presentations/repo/index.js +19 -0
- package/src/entities/presentations/repo/repo.js +58 -0
- package/src/entities/relying-party-services/factories/index.js +19 -0
- package/src/entities/relying-party-services/factories/relying-party-service-factory.js +43 -0
- package/src/entities/relying-party-services/index.js +20 -0
- package/src/entities/relying-party-services/repo/find-relying-party-services-extension.js +30 -0
- package/src/entities/relying-party-services/repo/index.js +19 -0
- package/src/entities/relying-party-services/repo/repo.js +55 -0
- package/src/entities/service-configurations/domain/canonicalize-service-configuration.js +12 -0
- package/src/entities/service-configurations/domain/index.js +22 -0
- package/src/entities/service-configurations/domain/service-configuration-errors.js +24 -0
- package/src/entities/service-configurations/domain/validate-service-configuration.js +31 -0
- package/src/entities/service-configurations/domain/validate-update-service-configuration.js +19 -0
- package/src/entities/service-configurations/index.js +20 -0
- package/src/entities/service-configurations/orchestrators/create-service-configuration.js +34 -0
- package/src/entities/service-configurations/orchestrators/delete-service-configuration.js +41 -0
- package/src/entities/service-configurations/orchestrators/index.js +21 -0
- package/src/entities/service-configurations/orchestrators/update-service-configuration.js +40 -0
- package/src/entities/tenants/adapters/index.js +20 -0
- package/src/entities/tenants/adapters/load-tenant-did-doc.js +47 -0
- package/src/entities/tenants/adapters/load-tenant-profile.js +40 -0
- package/src/entities/tenants/domain/index.js +20 -0
- package/src/entities/tenants/domain/tenant-errors.js +29 -0
- package/src/entities/tenants/domain/validate-new-tenant.js +49 -0
- package/src/entities/tenants/factories/index.js +19 -0
- package/src/entities/tenants/factories/tenant-factory.js +41 -0
- package/src/entities/tenants/index.js +24 -0
- package/src/entities/tenants/orchestrators/create-tenant.js +116 -0
- package/src/entities/tenants/orchestrators/delete-tenant.js +45 -0
- package/src/entities/tenants/orchestrators/find-tenants.js +22 -0
- package/src/entities/tenants/orchestrators/index.js +21 -0
- package/src/entities/tenants/plugins/index.js +3 -0
- package/src/entities/tenants/plugins/tenant-loader-plugin.js +64 -0
- package/src/entities/tenants/repo/index.js +19 -0
- package/src/entities/tenants/repo/insert-tenant-extension.js +36 -0
- package/src/entities/tenants/repo/repo.js +51 -0
- package/src/entities/tokens/domains/access-token.js +74 -0
- package/src/entities/tokens/domains/index.js +19 -0
- package/src/entities/tokens/index.js +19 -0
- package/src/index.js +3 -0
- package/src/init-server.js +88 -0
- package/src/main.js +25 -0
- package/src/schemas/index.js +20 -0
- package/src/schemas/oauth-error-response.schema.js +27 -0
- package/src/standalone.js +8 -0
- package/src/start-app-server.js +27 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
module.exports = {
|
|
18
|
+
...require('./build-verii-issuer'),
|
|
19
|
+
...require('./anchor-verii-credentials-facade'),
|
|
20
|
+
...require('./issue-verii-credentials-facade'),
|
|
21
|
+
...require('./sign-verii-credentials-facade'),
|
|
22
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
mongoAllocationListQueries,
|
|
20
|
+
issueVeriiCredentials,
|
|
21
|
+
} = require('@verii/verii-issuing');
|
|
22
|
+
const { mongoDb } = require('@spencejs/spence-mongo-repos');
|
|
23
|
+
const { keyBy } = require('lodash/fp');
|
|
24
|
+
const newError = require('http-errors');
|
|
25
|
+
const { buildVeriiIssuer } = require('./build-verii-issuer');
|
|
26
|
+
|
|
27
|
+
const issueVeriiCredentialsFacade = async (
|
|
28
|
+
approvedCredentialsContent,
|
|
29
|
+
credentialSubjectId,
|
|
30
|
+
credentialTypeMetadatas,
|
|
31
|
+
issuerService,
|
|
32
|
+
context,
|
|
33
|
+
) => {
|
|
34
|
+
const { tenant } = context;
|
|
35
|
+
|
|
36
|
+
// eslint-disable-next-line better-mutation/no-mutation
|
|
37
|
+
context.allocationListQueries = mongoAllocationListQueries(
|
|
38
|
+
mongoDb(),
|
|
39
|
+
'allocations',
|
|
40
|
+
);
|
|
41
|
+
// eslint-disable-next-line better-mutation/no-mutation
|
|
42
|
+
context.caoDid = context.tenant.caoDid;
|
|
43
|
+
|
|
44
|
+
return issueVeriiCredentials(
|
|
45
|
+
approvedCredentialsContent,
|
|
46
|
+
credentialSubjectId,
|
|
47
|
+
keyBy('credentialType', credentialTypeMetadatas),
|
|
48
|
+
buildVeriiIssuer(tenant, issuerService),
|
|
49
|
+
context,
|
|
50
|
+
).catch((e) => {
|
|
51
|
+
switch (e.errorCode) {
|
|
52
|
+
case 'career_issuing_not_permitted':
|
|
53
|
+
case 'identity_issuing_not_permitted':
|
|
54
|
+
case 'contact_issuing_not_permitted':
|
|
55
|
+
throw newError(502, e);
|
|
56
|
+
default:
|
|
57
|
+
throw e;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
module.exports = { issueVeriiCredentialsFacade };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
mongoAllocationListQueries,
|
|
20
|
+
signVeriiCredentials,
|
|
21
|
+
} = require('@verii/verii-issuing');
|
|
22
|
+
const { mongoDb } = require('@spencejs/spence-mongo-repos');
|
|
23
|
+
const { keyBy } = require('lodash/fp');
|
|
24
|
+
const { buildVeriiIssuer } = require('./build-verii-issuer');
|
|
25
|
+
|
|
26
|
+
const signVeriiCredentialsFacade = async (
|
|
27
|
+
credentialContentList,
|
|
28
|
+
credentialSubjectId,
|
|
29
|
+
credentialTypeMetadatas,
|
|
30
|
+
issuerService,
|
|
31
|
+
context,
|
|
32
|
+
) => {
|
|
33
|
+
const { tenant } = context;
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line better-mutation/no-mutation
|
|
36
|
+
context.allocationListQueries = mongoAllocationListQueries(
|
|
37
|
+
mongoDb(),
|
|
38
|
+
'allocations',
|
|
39
|
+
);
|
|
40
|
+
// eslint-disable-next-line better-mutation/no-mutation
|
|
41
|
+
context.caoDid = context.tenant.caoDid;
|
|
42
|
+
|
|
43
|
+
const result = await signVeriiCredentials(
|
|
44
|
+
credentialContentList,
|
|
45
|
+
credentialSubjectId,
|
|
46
|
+
keyBy('credentialType', credentialTypeMetadatas),
|
|
47
|
+
buildVeriiIssuer(tenant, issuerService),
|
|
48
|
+
context,
|
|
49
|
+
);
|
|
50
|
+
return {
|
|
51
|
+
credentialMetadata: result?.[0]?.metadata,
|
|
52
|
+
vcJwt: result?.[0]?.vcJwt,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
module.exports = { signVeriiCredentialsFacade };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const { register } = require('@spencejs/spence-factories');
|
|
18
|
+
const { ObjectId } = require('mongodb');
|
|
19
|
+
const { hashOffer } = require('@verii/verii-issuing');
|
|
20
|
+
const { credentialRepoPlugin } = require('../repo');
|
|
21
|
+
const { initTenantFactory } = require('../../tenants');
|
|
22
|
+
const { initDepotFactory } = require('../../depots');
|
|
23
|
+
|
|
24
|
+
const DefaultContent = () => ({
|
|
25
|
+
type: ['Employment'],
|
|
26
|
+
credentialSubject: {
|
|
27
|
+
legalEmployer: { name: 'ExampleEmployer', identifier: 'did:example.com' },
|
|
28
|
+
roleName: 'CEO',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const initCredentialFactory = (app) =>
|
|
33
|
+
register(
|
|
34
|
+
'credential',
|
|
35
|
+
credentialRepoPlugin(app)({ config: app.config }),
|
|
36
|
+
async (overrides, { getOrBuild }) => {
|
|
37
|
+
const tenant = await getOrBuild('tenant', initTenantFactory(app));
|
|
38
|
+
const depot = await getOrBuild('depot', initDepotFactory(app));
|
|
39
|
+
const content = await getOrBuild('content', DefaultContent);
|
|
40
|
+
const contentHash = hashOffer(content);
|
|
41
|
+
return {
|
|
42
|
+
credentialReference: 'cred1',
|
|
43
|
+
content,
|
|
44
|
+
contentHash,
|
|
45
|
+
typeMetadata: { credentialType: 'Employment' },
|
|
46
|
+
tenantId: new ObjectId(tenant._id),
|
|
47
|
+
depotId: new ObjectId(depot._id),
|
|
48
|
+
...overrides(),
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
module.exports = { initCredentialFactory };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
...require('./credential-factory'),
|
|
19
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
module.exports = {
|
|
18
|
+
...require('./domain'),
|
|
19
|
+
...require('./facades'),
|
|
20
|
+
...require('./factories'),
|
|
21
|
+
...require('./orchestrators'),
|
|
22
|
+
...require('./repo'),
|
|
23
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
const { map, forEach, findIndex, flow, uniq } = require('lodash/fp');
|
|
18
|
+
const newError = require('http-errors');
|
|
19
|
+
const { getCredentialTypeMetadata } = require('@verii/common-fetchers');
|
|
20
|
+
const { initHttpClient } = require('@verii/http-client');
|
|
21
|
+
const { extractCredentialType } = require('@verii/vc-checks');
|
|
22
|
+
const {
|
|
23
|
+
initCanonicalizeCredentials,
|
|
24
|
+
initValidateCredential,
|
|
25
|
+
CredentialErrors,
|
|
26
|
+
} = require('../domain');
|
|
27
|
+
|
|
28
|
+
const createCredentials = async (credentialItems, context) => {
|
|
29
|
+
const { repos } = context;
|
|
30
|
+
|
|
31
|
+
const depotIds = flow(map('depotId'), uniq)(credentialItems);
|
|
32
|
+
const credentials = map('credential', credentialItems);
|
|
33
|
+
const credentialTypes = flow(
|
|
34
|
+
map(({ content }) => extractCredentialType(content)),
|
|
35
|
+
uniq,
|
|
36
|
+
)(credentials);
|
|
37
|
+
|
|
38
|
+
const [depots, relatedCredentials, credentialTypeMetadatas] =
|
|
39
|
+
await Promise.all([
|
|
40
|
+
repos.depots.findDepots(null, depotIds),
|
|
41
|
+
repos.credentials.findByRelatedResources(credentials),
|
|
42
|
+
getCredentialTypeMetadataWithErrorHandling(credentialTypes, context),
|
|
43
|
+
]);
|
|
44
|
+
const schemas = await Promise.all(
|
|
45
|
+
map(
|
|
46
|
+
(credentialType) => loadSchemaWithErrorHandling(credentialType, context),
|
|
47
|
+
credentialTypeMetadatas,
|
|
48
|
+
),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const validateCredential = initValidateCredential(
|
|
52
|
+
depots,
|
|
53
|
+
credentialTypeMetadatas,
|
|
54
|
+
schemas,
|
|
55
|
+
context,
|
|
56
|
+
);
|
|
57
|
+
const canonicalizeCredential = initCanonicalizeCredentials(
|
|
58
|
+
relatedCredentials,
|
|
59
|
+
credentialTypeMetadatas,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const canonicalizedCredentials = flow(
|
|
63
|
+
map((item) => ({
|
|
64
|
+
...item,
|
|
65
|
+
metadataIdx: findIndex(
|
|
66
|
+
{
|
|
67
|
+
credentialType: extractCredentialType(item.credential.content),
|
|
68
|
+
},
|
|
69
|
+
credentialTypeMetadatas,
|
|
70
|
+
),
|
|
71
|
+
})),
|
|
72
|
+
forEach(validateCredential),
|
|
73
|
+
map(canonicalizeCredential),
|
|
74
|
+
)(credentialItems);
|
|
75
|
+
|
|
76
|
+
return repos.credentials.insertMany(canonicalizedCredentials);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const loadSchema = async (credentialTypeMetadata, context) => {
|
|
80
|
+
const client = initHttpClient({
|
|
81
|
+
requestTimeout: context.config.requestTimeout,
|
|
82
|
+
traceIdHeader: context.config.traceIdHeader,
|
|
83
|
+
rejectUnauthorized: true,
|
|
84
|
+
})(context);
|
|
85
|
+
const response = await client.get(credentialTypeMetadata.schemaUrl);
|
|
86
|
+
return response.json();
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const getCredentialTypeMetadataWithErrorHandling = async (
|
|
90
|
+
credentialTypes,
|
|
91
|
+
context,
|
|
92
|
+
) => {
|
|
93
|
+
try {
|
|
94
|
+
return await getCredentialTypeMetadata(credentialTypes, context);
|
|
95
|
+
} catch (error) {
|
|
96
|
+
context.log.error('Error loading credential types', error);
|
|
97
|
+
throw newError(
|
|
98
|
+
502,
|
|
99
|
+
CredentialErrors.CREDENTIAL_TYPES_METADATA_UPSTREAM_ERROR,
|
|
100
|
+
{
|
|
101
|
+
errorCode: CredentialErrors.CREDENTIAL_TYPES_METADATA_UPSTREAM_ERROR,
|
|
102
|
+
},
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const loadSchemaWithErrorHandling = async (credentialTypeMetadata, context) => {
|
|
108
|
+
try {
|
|
109
|
+
return await loadSchema(credentialTypeMetadata, context);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
context.log.error(error, { msg: 'schema loading error' });
|
|
112
|
+
throw newError(502, CredentialErrors.SCHEMA_UPSTREAM_ERROR, {
|
|
113
|
+
errorCode: CredentialErrors.SCHEMA_UPSTREAM_ERROR,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
module.exports = { createCredentials };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
module.exports = {
|
|
18
|
+
...require('./create-credentials'),
|
|
19
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const { flow, flatMapDeep, compact, map, uniq, isEmpty } = require('lodash/fp');
|
|
19
|
+
const { ObjectId } = require('mongodb');
|
|
20
|
+
|
|
21
|
+
const findersExtension = (parent) => ({
|
|
22
|
+
search: async ({ credentialIds }) => {
|
|
23
|
+
const filter = {};
|
|
24
|
+
if (!isEmpty(credentialIds)) {
|
|
25
|
+
filter._id = {
|
|
26
|
+
$in: map((credentialId) => new ObjectId(credentialId), credentialIds),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return parent.find({ filter });
|
|
30
|
+
},
|
|
31
|
+
findByDepotId: async ({
|
|
32
|
+
depotId,
|
|
33
|
+
omitContentHashes,
|
|
34
|
+
credentialTypes,
|
|
35
|
+
claimable,
|
|
36
|
+
}) => {
|
|
37
|
+
const filter = {
|
|
38
|
+
depotId: new ObjectId(depotId),
|
|
39
|
+
};
|
|
40
|
+
if (!isEmpty(omitContentHashes)) {
|
|
41
|
+
filter.contentHash = { $nin: omitContentHashes };
|
|
42
|
+
}
|
|
43
|
+
if (!isEmpty(credentialTypes)) {
|
|
44
|
+
filter['content.type'] = { $in: credentialTypes };
|
|
45
|
+
}
|
|
46
|
+
if (claimable === true) {
|
|
47
|
+
filter.rejectedAt = { $exists: false };
|
|
48
|
+
filter.acceptedAt = { $exists: false };
|
|
49
|
+
}
|
|
50
|
+
return parent.find({ filter });
|
|
51
|
+
},
|
|
52
|
+
findByRelatedResources: async (credentials) => {
|
|
53
|
+
const identifiers = flow(
|
|
54
|
+
flatMapDeep(({ content }) => [
|
|
55
|
+
map('id', content.relatedResource),
|
|
56
|
+
map('id', content.replaces),
|
|
57
|
+
]),
|
|
58
|
+
compact,
|
|
59
|
+
uniq,
|
|
60
|
+
)(credentials);
|
|
61
|
+
|
|
62
|
+
if (isEmpty(identifiers)) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return parent.find(
|
|
67
|
+
{
|
|
68
|
+
filter: {
|
|
69
|
+
did: { $in: identifiers },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 1,
|
|
74
|
+
did: 1,
|
|
75
|
+
content: 1,
|
|
76
|
+
digestSRI: 1,
|
|
77
|
+
linkCode: 1,
|
|
78
|
+
},
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
findNonFinal: async (credentialIds) =>
|
|
82
|
+
parent.find({
|
|
83
|
+
filter: {
|
|
84
|
+
_id: { $in: credentialIds },
|
|
85
|
+
rejectedAt: { $exists: false },
|
|
86
|
+
acceptedAt: { $exists: false },
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
89
|
+
extensions: parent.extensions.concat(['findersExtension']),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
module.exports = {
|
|
93
|
+
findersExtension,
|
|
94
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
module.exports = {
|
|
18
|
+
credentialRepoPlugin: require('./repo'),
|
|
19
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
repoFactory,
|
|
19
|
+
autoboxIdsExtension,
|
|
20
|
+
} = require('@spencejs/spence-mongo-repos');
|
|
21
|
+
const { multitenantExtension } = require('@verii/spencer-mongo-extensions');
|
|
22
|
+
const { findersExtension } = require('./finders-extension');
|
|
23
|
+
const { updateExtensions } = require('./update-issued-credential');
|
|
24
|
+
|
|
25
|
+
module.exports = (app, options, next = () => {}) => {
|
|
26
|
+
next();
|
|
27
|
+
return repoFactory(
|
|
28
|
+
{
|
|
29
|
+
name: 'credentials',
|
|
30
|
+
entityName: 'credential',
|
|
31
|
+
defaultProjection: {
|
|
32
|
+
_id: 1,
|
|
33
|
+
did: 1,
|
|
34
|
+
credentialReference: 1,
|
|
35
|
+
content: 1,
|
|
36
|
+
contentHash: 1,
|
|
37
|
+
digestSRI: 1,
|
|
38
|
+
tags: 1,
|
|
39
|
+
acceptedAt: 1,
|
|
40
|
+
jwtVc: 1,
|
|
41
|
+
rejectedAt: 1,
|
|
42
|
+
failedAt: 1,
|
|
43
|
+
deletedAt: 1,
|
|
44
|
+
rejectedReason: 1,
|
|
45
|
+
typeMetadata: 1,
|
|
46
|
+
openid4vcMetadata: 1,
|
|
47
|
+
error: 1,
|
|
48
|
+
depotId: 1,
|
|
49
|
+
tenantId: 1,
|
|
50
|
+
createdAt: 1,
|
|
51
|
+
updatedAt: 1,
|
|
52
|
+
},
|
|
53
|
+
extensions: [
|
|
54
|
+
autoboxIdsExtension,
|
|
55
|
+
multitenantExtension(),
|
|
56
|
+
findersExtension,
|
|
57
|
+
updateExtensions,
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
app,
|
|
61
|
+
);
|
|
62
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const { calcSha384 } = require('@verii/crypto');
|
|
19
|
+
const { buildExchangeEvent } = require('../../exchanges/domain');
|
|
20
|
+
|
|
21
|
+
const updateExtensions = (parent, context) => ({
|
|
22
|
+
updateIssuedCredential: async (
|
|
23
|
+
credentialId,
|
|
24
|
+
credentialDid,
|
|
25
|
+
jwtVc,
|
|
26
|
+
credentialSubjectId,
|
|
27
|
+
isAccepted,
|
|
28
|
+
exchange,
|
|
29
|
+
) => {
|
|
30
|
+
const digestSRI = `sha384-${calcSha384(jwtVc)}`;
|
|
31
|
+
const $set = {
|
|
32
|
+
did: credentialDid,
|
|
33
|
+
credentialSubjectId,
|
|
34
|
+
digestSRI,
|
|
35
|
+
};
|
|
36
|
+
if (isAccepted) {
|
|
37
|
+
$set.acceptedAt = new Date();
|
|
38
|
+
}
|
|
39
|
+
if (exchange) {
|
|
40
|
+
$set.exchange = exchange;
|
|
41
|
+
}
|
|
42
|
+
if (context.config.autocleanFinalizedOfferPii) {
|
|
43
|
+
$set.content = {};
|
|
44
|
+
} else {
|
|
45
|
+
$set.jwtVc = jwtVc;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return parent.update(credentialId, $set);
|
|
49
|
+
},
|
|
50
|
+
addExchangeState: async (credentialId, state, props) =>
|
|
51
|
+
parent.collection().updateOne(
|
|
52
|
+
{ _id: credentialId },
|
|
53
|
+
{
|
|
54
|
+
$set: props,
|
|
55
|
+
$push: { 'exchange.events': buildExchangeEvent(state) },
|
|
56
|
+
},
|
|
57
|
+
),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
module.exports = { updateExtensions };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
const DepotErrors = {
|
|
18
|
+
REFERENCED_SERVICE_NOT_FOUND: 'referenced_service_not_found',
|
|
19
|
+
RELATED_CREDENTIAL_UNDELETED: 'related_credential_undeleted',
|
|
20
|
+
INVALID_AUTH_VALUES: 'invalid_auth_values',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
module.exports = { DepotErrors };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Velocity Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
module.exports = {
|
|
18
|
+
...require('./depot-errors'),
|
|
19
|
+
...require('./validate-depot'),
|
|
20
|
+
};
|