@virtru/dsp-sdk 0.3.1 → 0.4.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/.rush/temp/chunked-rush-logs/dsp-sdk._phase_build.chunks.jsonl +9 -20
- package/.rush/temp/chunked-rush-logs/dsp-sdk._phase_test.chunks.jsonl +29 -46
- package/.rush/temp/package-deps__phase_build.json +31 -17
- package/.rush/temp/shrinkwrap-deps.json +925 -131
- package/CHANGELOG.json +28 -0
- package/CHANGELOG.md +15 -1
- package/README.md +10 -0
- package/config/jest.config.json +6 -0
- package/config/rig.json +8 -0
- package/dist/src/gen/config/v1/tagging_pb.d.ts +88 -4
- package/dist/src/gen/config/v1/tagging_pb.js +60 -5
- package/dist/src/gen/policyimportexport/v1/policy_import_export_pb.d.ts +6 -0
- package/dist/src/gen/policyimportexport/v1/policy_import_export_pb.js +2 -1
- package/dist/src/gen/virtru/common/common_pb.d.ts +10 -10
- package/dist/src/gen/virtru/common/common_pb.js +29 -13
- package/dist/src/gen/virtru/policy/certificates/v1/certificates_pb.d.ts +14 -14
- package/dist/src/gen/virtru/policy/certificates/v1/certificates_pb.js +40 -16
- package/dist/src/gen/virtru/policy/objects_pb.d.ts +5 -5
- package/dist/src/gen/virtru/policy/objects_pb.js +26 -12
- package/dist/src/lib/client.js +1 -1
- package/dist/src/lib/utils.js +9 -6
- package/dist/tests/dsp.test.js +1 -4
- package/lib-commonjs/src/gen/buf/validate/validate_pb.js +487 -0
- package/lib-commonjs/src/gen/config/v1/config_pb.js +142 -0
- package/lib-commonjs/src/gen/config/v1/kas_config_pb.js +72 -0
- package/lib-commonjs/src/gen/config/v1/meta_pb.js +36 -0
- package/lib-commonjs/src/gen/config/v1/outlook_config_pb.js +67 -0
- package/lib-commonjs/src/gen/config/v1/secureviewer_config_pb.js +67 -0
- package/lib-commonjs/src/gen/config/v1/tagging_pb.js +246 -0
- package/lib-commonjs/src/gen/google/api/annotations_pb.js +33 -0
- package/lib-commonjs/src/gen/google/api/http_pb.js +44 -0
- package/lib-commonjs/src/gen/policyimportexport/v1/policy_import_export_pb.js +93 -0
- package/lib-commonjs/src/gen/shared/v1/shared_pb.js +95 -0
- package/lib-commonjs/src/gen/tagging/pdp/v2/tagging_pb.js +277 -0
- package/lib-commonjs/src/gen/version/v1/version_pb.js +40 -0
- package/lib-commonjs/src/gen/virtru/common/common_pb.js +76 -0
- package/lib-commonjs/src/gen/virtru/policy/certificates/v1/certificates_pb.js +77 -0
- package/lib-commonjs/src/gen/virtru/policy/objects_pb.js +143 -0
- package/lib-commonjs/src/index.js +48 -0
- package/lib-commonjs/src/lib/client.js +66 -0
- package/lib-commonjs/src/lib/consts.js +10 -0
- package/lib-commonjs/src/lib/dsp.js +49 -0
- package/lib-commonjs/src/lib/utils.js +402 -0
- package/lib-commonjs/tests/dsp-client.test.js +75 -0
- package/lib-commonjs/tests/dsp.test.js +94 -0
- package/lib-commonjs/tests/mocks/create-export-artifacts.js +17 -0
- package/lib-commonjs/tests/mocks/tagging-pdp-tag.js +15 -0
- package/lib-commonjs/tests/mocks/well-known-configuration.js +16 -0
- package/lib-commonjs/tests/setup-msw.js +33 -0
- package/package.json +12 -6
- package/src/gen/config/formatters/testdata/v1/test_pb.ts +1 -0
- package/src/gen/config/v1/config_connect.ts +111 -0
- package/src/gen/config/v1/tagging_pb.ts +106 -5
- package/src/gen/helloworld/v1/helloworld_connect.ts +49 -0
- package/src/gen/helloworld/v1/helloworld_pb.ts +6 -0
- package/src/gen/kas/nanotdf/v1/nanotdf_rewrap_connect.ts +39 -0
- package/src/gen/kas/nanotdf/v1/nanotdf_rewrap_pb.ts +207 -0
- package/src/gen/policyimportexport/v1/policy_import_export_connect.ts +56 -0
- package/src/gen/policyimportexport/v1/policy_import_export_pb.ts +10 -2
- package/src/gen/shared/v1/shared_connect.ts +61 -0
- package/src/gen/shared/v2/shared_connect.ts +39 -0
- package/src/gen/tagging/pdp/v2/externalprocessors/processor_connect.ts +156 -0
- package/src/gen/tagging/pdp/v2/tagging_connect.ts +73 -0
- package/src/gen/version/v1/version_connect.ts +31 -0
- package/src/gen/virtru/common/common_pb.ts +55 -33
- package/src/gen/virtru/policy/certificates/v1/certificates_pb.ts +188 -143
- package/src/gen/virtru/policy/objects_pb.ts +34 -16
- package/src/gen/web-admin/v1/config_connect.ts +52 -0
- package/src/lib/client.ts +5 -1
- package/src/lib/utils.test.ts +76 -40
- package/src/lib/utils.ts +54 -29
- package/temp/build/lint/_eslint-5eVG3S6w.json +30 -0
- package/temp/test/jest/haste-map-b055a9550e6d9f9b43d8ad29b1607278-49d19aee56a0732eca9c014a51272338-8710993d07b75a801b0956e67ffc46fa +0 -0
- package/tests/dsp.test.ts +2 -6
- package/update-protos.sh +63 -0
- package/vitest.config.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { GenFile, GenMessage, GenService } from
|
|
2
|
-
import type { MetadataMutable, PageRequest, PageResponse } from
|
|
3
|
-
import type { Algorithm, Certificate, KeyMode, KeyStatus } from
|
|
4
|
-
import type { Message } from
|
|
1
|
+
import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv1';
|
|
2
|
+
import type { MetadataMutable, PageRequest, PageResponse } from '../../../common/common_pb';
|
|
3
|
+
import type { Algorithm, Certificate, KeyMode, KeyStatus } from '../../objects_pb';
|
|
4
|
+
import type { Message } from '@bufbuild/protobuf';
|
|
5
5
|
/**
|
|
6
6
|
* Describes the file virtru/policy/certificates/v1/certificates.proto.
|
|
7
7
|
*/
|
|
@@ -11,7 +11,7 @@ export declare const file_virtru_policy_certificates_v1_certificates: GenFile;
|
|
|
11
11
|
*
|
|
12
12
|
* @generated from message virtru.policy.certificates.v1.NamespaceCertificate
|
|
13
13
|
*/
|
|
14
|
-
export type NamespaceCertificate = Message<
|
|
14
|
+
export type NamespaceCertificate = Message<'virtru.policy.certificates.v1.NamespaceCertificate'> & {
|
|
15
15
|
/**
|
|
16
16
|
* Required - namespace id
|
|
17
17
|
*
|
|
@@ -33,7 +33,7 @@ export declare const NamespaceCertificateSchema: GenMessage<NamespaceCertificate
|
|
|
33
33
|
/**
|
|
34
34
|
* @generated from message virtru.policy.certificates.v1.ListCertificatesByNamespaceRequest
|
|
35
35
|
*/
|
|
36
|
-
export type ListCertificatesByNamespaceRequest = Message<
|
|
36
|
+
export type ListCertificatesByNamespaceRequest = Message<'virtru.policy.certificates.v1.ListCertificatesByNamespaceRequest'> & {
|
|
37
37
|
/**
|
|
38
38
|
* Required - namespace id
|
|
39
39
|
*
|
|
@@ -57,7 +57,7 @@ export declare const ListCertificatesByNamespaceRequestSchema: GenMessage<ListCe
|
|
|
57
57
|
*
|
|
58
58
|
* @generated from message virtru.policy.certificates.v1.ListCertificatesByNamespaceResponse
|
|
59
59
|
*/
|
|
60
|
-
export type ListCertificatesByNamespaceResponse = Message<
|
|
60
|
+
export type ListCertificatesByNamespaceResponse = Message<'virtru.policy.certificates.v1.ListCertificatesByNamespaceResponse'> & {
|
|
61
61
|
/**
|
|
62
62
|
* The list of certificates for the specified namespace.
|
|
63
63
|
*
|
|
@@ -79,7 +79,7 @@ export declare const ListCertificatesByNamespaceResponseSchema: GenMessage<ListC
|
|
|
79
79
|
/**
|
|
80
80
|
* @generated from message virtru.policy.certificates.v1.AssignCertificateToNamespaceRequest
|
|
81
81
|
*/
|
|
82
|
-
export type AssignCertificateToNamespaceRequest = Message<
|
|
82
|
+
export type AssignCertificateToNamespaceRequest = Message<'virtru.policy.certificates.v1.AssignCertificateToNamespaceRequest'> & {
|
|
83
83
|
/**
|
|
84
84
|
* Required - namespace id
|
|
85
85
|
*
|
|
@@ -133,7 +133,7 @@ export declare const AssignCertificateToNamespaceRequestSchema: GenMessage<Assig
|
|
|
133
133
|
/**
|
|
134
134
|
* @generated from message virtru.policy.certificates.v1.AssignCertificateToNamespaceResponse
|
|
135
135
|
*/
|
|
136
|
-
export type AssignCertificateToNamespaceResponse = Message<
|
|
136
|
+
export type AssignCertificateToNamespaceResponse = Message<'virtru.policy.certificates.v1.AssignCertificateToNamespaceResponse'> & {
|
|
137
137
|
/**
|
|
138
138
|
* The mapping of the namespace to the certificate.
|
|
139
139
|
*
|
|
@@ -155,7 +155,7 @@ export declare const AssignCertificateToNamespaceResponseSchema: GenMessage<Assi
|
|
|
155
155
|
/**
|
|
156
156
|
* @generated from message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceRequest
|
|
157
157
|
*/
|
|
158
|
-
export type RemoveCertificateFromNamespaceRequest = Message<
|
|
158
|
+
export type RemoveCertificateFromNamespaceRequest = Message<'virtru.policy.certificates.v1.RemoveCertificateFromNamespaceRequest'> & {
|
|
159
159
|
/**
|
|
160
160
|
* The namespace and certificate to unassign.
|
|
161
161
|
*
|
|
@@ -171,7 +171,7 @@ export declare const RemoveCertificateFromNamespaceRequestSchema: GenMessage<Rem
|
|
|
171
171
|
/**
|
|
172
172
|
* @generated from message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceResponse
|
|
173
173
|
*/
|
|
174
|
-
export type RemoveCertificateFromNamespaceResponse = Message<
|
|
174
|
+
export type RemoveCertificateFromNamespaceResponse = Message<'virtru.policy.certificates.v1.RemoveCertificateFromNamespaceResponse'> & {
|
|
175
175
|
/**
|
|
176
176
|
* The unassigned namespace and certificate.
|
|
177
177
|
*
|
|
@@ -192,7 +192,7 @@ export declare const CertificateService: GenService<{
|
|
|
192
192
|
* @generated from rpc virtru.policy.certificates.v1.CertificateService.ListCertificatesByNamespace
|
|
193
193
|
*/
|
|
194
194
|
listCertificatesByNamespace: {
|
|
195
|
-
methodKind:
|
|
195
|
+
methodKind: 'unary';
|
|
196
196
|
input: typeof ListCertificatesByNamespaceRequestSchema;
|
|
197
197
|
output: typeof ListCertificatesByNamespaceResponseSchema;
|
|
198
198
|
};
|
|
@@ -200,7 +200,7 @@ export declare const CertificateService: GenService<{
|
|
|
200
200
|
* @generated from rpc virtru.policy.certificates.v1.CertificateService.AssignCertificateToNamespace
|
|
201
201
|
*/
|
|
202
202
|
assignCertificateToNamespace: {
|
|
203
|
-
methodKind:
|
|
203
|
+
methodKind: 'unary';
|
|
204
204
|
input: typeof AssignCertificateToNamespaceRequestSchema;
|
|
205
205
|
output: typeof AssignCertificateToNamespaceResponseSchema;
|
|
206
206
|
};
|
|
@@ -208,7 +208,7 @@ export declare const CertificateService: GenService<{
|
|
|
208
208
|
* @generated from rpc virtru.policy.certificates.v1.CertificateService.RemoveCertificateFromNamespace
|
|
209
209
|
*/
|
|
210
210
|
removeCertificateFromNamespace: {
|
|
211
|
-
methodKind:
|
|
211
|
+
methodKind: 'unary';
|
|
212
212
|
input: typeof RemoveCertificateFromNamespaceRequestSchema;
|
|
213
213
|
output: typeof RemoveCertificateFromNamespaceResponseSchema;
|
|
214
214
|
};
|
|
@@ -1,50 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Virtru Corporation. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
|
|
5
|
+
*/
|
|
6
|
+
import { fileDesc, messageDesc, serviceDesc, } from '@bufbuild/protobuf/codegenv1';
|
|
7
|
+
import { file_buf_validate_validate } from '../../../../buf/validate/validate_pb';
|
|
8
|
+
import { file_virtru_common_common } from '../../../common/common_pb';
|
|
9
|
+
import { file_virtru_policy_objects } from '../../objects_pb';
|
|
8
10
|
/**
|
|
9
11
|
* Describes the file virtru/policy/certificates/v1/certificates.proto.
|
|
10
12
|
*/
|
|
11
|
-
export const file_virtru_policy_certificates_v1_certificates =
|
|
13
|
+
export const file_virtru_policy_certificates_v1_certificates =
|
|
14
|
+
/*@__PURE__*/
|
|
15
|
+
fileDesc('CjB2aXJ0cnUvcG9saWN5L2NlcnRpZmljYXRlcy92MS9jZXJ0aWZpY2F0ZXMucHJvdG8SHXZpcnRydS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mljYXRlVG9OYW1lc3BhY2VSZXNwb25zZSIAEq8BCh5SZW1vdmVDZXJ0aWZpY2F0ZUZyb21OYW1lc3BhY2USRC52aXJ0cnUucG9saWN5LmNlcnRpZmljYXRlcy52MS5SZW1vdmVDZXJ0aWZpY2F0ZUZyb21OYW1lc3BhY2VSZXF1ZXN0GkUudmlydHJ1LnBvbGljeS5jZXJ0aWZpY2F0ZXMudjEuUmVtb3ZlQ2VydGlmaWNhdGVGcm9tTmFtZXNwYWNlUmVzcG9uc2UiAEK0AgohY29tLnZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxQhFDZXJ0aWZpY2F0ZXNQcm90b1ABWmVnaXRodWIuY29tL3ZpcnRydS1jb3JwL2RhdGEtc2VjdXJpdHktcGxhdGZvcm0vc2RrL3YyL2dlbi92aXJ0cnUvcG9saWN5L2NlcnRpZmljYXRlcy92MTtjZXJ0aWZpY2F0ZXN2MaICA1ZQQ6oCHVZpcnRydS5Qb2xpY3kuQ2VydGlmaWNhdGVzLlYxygIdVmlydHJ1XFBvbGljeVxDZXJ0aWZpY2F0ZXNcVjHiAilWaXJ0cnVcUG9saWN5XENlcnRpZmljYXRlc1xWMVxHUEJNZXRhZGF0YeoCIFZpcnRydTo6UG9saWN5OjpDZXJ0aWZpY2F0ZXM6OlYxYgZwcm90bzM', [
|
|
16
|
+
file_buf_validate_validate,
|
|
17
|
+
file_virtru_common_common,
|
|
18
|
+
file_virtru_policy_objects,
|
|
19
|
+
]);
|
|
12
20
|
/**
|
|
13
21
|
* Describes the message virtru.policy.certificates.v1.NamespaceCertificate.
|
|
14
22
|
* Use `create(NamespaceCertificateSchema)` to create a new message.
|
|
15
23
|
*/
|
|
16
|
-
export const NamespaceCertificateSchema =
|
|
24
|
+
export const NamespaceCertificateSchema =
|
|
25
|
+
/*@__PURE__*/
|
|
26
|
+
messageDesc(file_virtru_policy_certificates_v1_certificates, 0);
|
|
17
27
|
/**
|
|
18
28
|
* Describes the message virtru.policy.certificates.v1.ListCertificatesByNamespaceRequest.
|
|
19
29
|
* Use `create(ListCertificatesByNamespaceRequestSchema)` to create a new message.
|
|
20
30
|
*/
|
|
21
|
-
export const ListCertificatesByNamespaceRequestSchema =
|
|
31
|
+
export const ListCertificatesByNamespaceRequestSchema =
|
|
32
|
+
/*@__PURE__*/
|
|
33
|
+
messageDesc(file_virtru_policy_certificates_v1_certificates, 1);
|
|
22
34
|
/**
|
|
23
35
|
* Describes the message virtru.policy.certificates.v1.ListCertificatesByNamespaceResponse.
|
|
24
36
|
* Use `create(ListCertificatesByNamespaceResponseSchema)` to create a new message.
|
|
25
37
|
*/
|
|
26
|
-
export const ListCertificatesByNamespaceResponseSchema =
|
|
38
|
+
export const ListCertificatesByNamespaceResponseSchema =
|
|
39
|
+
/*@__PURE__*/
|
|
40
|
+
messageDesc(file_virtru_policy_certificates_v1_certificates, 2);
|
|
27
41
|
/**
|
|
28
42
|
* Describes the message virtru.policy.certificates.v1.AssignCertificateToNamespaceRequest.
|
|
29
43
|
* Use `create(AssignCertificateToNamespaceRequestSchema)` to create a new message.
|
|
30
44
|
*/
|
|
31
|
-
export const AssignCertificateToNamespaceRequestSchema =
|
|
45
|
+
export const AssignCertificateToNamespaceRequestSchema =
|
|
46
|
+
/*@__PURE__*/
|
|
47
|
+
messageDesc(file_virtru_policy_certificates_v1_certificates, 3);
|
|
32
48
|
/**
|
|
33
49
|
* Describes the message virtru.policy.certificates.v1.AssignCertificateToNamespaceResponse.
|
|
34
50
|
* Use `create(AssignCertificateToNamespaceResponseSchema)` to create a new message.
|
|
35
51
|
*/
|
|
36
|
-
export const AssignCertificateToNamespaceResponseSchema =
|
|
52
|
+
export const AssignCertificateToNamespaceResponseSchema =
|
|
53
|
+
/*@__PURE__*/
|
|
54
|
+
messageDesc(file_virtru_policy_certificates_v1_certificates, 4);
|
|
37
55
|
/**
|
|
38
56
|
* Describes the message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceRequest.
|
|
39
57
|
* Use `create(RemoveCertificateFromNamespaceRequestSchema)` to create a new message.
|
|
40
58
|
*/
|
|
41
|
-
export const RemoveCertificateFromNamespaceRequestSchema =
|
|
59
|
+
export const RemoveCertificateFromNamespaceRequestSchema =
|
|
60
|
+
/*@__PURE__*/
|
|
61
|
+
messageDesc(file_virtru_policy_certificates_v1_certificates, 5);
|
|
42
62
|
/**
|
|
43
63
|
* Describes the message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceResponse.
|
|
44
64
|
* Use `create(RemoveCertificateFromNamespaceResponseSchema)` to create a new message.
|
|
45
65
|
*/
|
|
46
|
-
export const RemoveCertificateFromNamespaceResponseSchema =
|
|
66
|
+
export const RemoveCertificateFromNamespaceResponseSchema =
|
|
67
|
+
/*@__PURE__*/
|
|
68
|
+
messageDesc(file_virtru_policy_certificates_v1_certificates, 6);
|
|
47
69
|
/**
|
|
48
70
|
* @generated from service virtru.policy.certificates.v1.CertificateService
|
|
49
71
|
*/
|
|
50
|
-
export const CertificateService =
|
|
72
|
+
export const CertificateService =
|
|
73
|
+
/*@__PURE__*/
|
|
74
|
+
serviceDesc(file_virtru_policy_certificates_v1_certificates, 0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { GenEnum, GenFile, GenMessage } from
|
|
2
|
-
import type { Metadata } from
|
|
3
|
-
import type { Message } from
|
|
1
|
+
import type { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv1';
|
|
2
|
+
import type { Metadata } from '../common/common_pb';
|
|
3
|
+
import type { Message } from '@bufbuild/protobuf';
|
|
4
4
|
/**
|
|
5
5
|
* Describes the file virtru/policy/objects.proto.
|
|
6
6
|
*/
|
|
@@ -8,7 +8,7 @@ export declare const file_virtru_policy_objects: GenFile;
|
|
|
8
8
|
/**
|
|
9
9
|
* @generated from message virtru.policy.Certificate
|
|
10
10
|
*/
|
|
11
|
-
export type Certificate = Message<
|
|
11
|
+
export type Certificate = Message<'virtru.policy.Certificate'> & {
|
|
12
12
|
/**
|
|
13
13
|
* @generated from field: string id = 1;
|
|
14
14
|
*/
|
|
@@ -60,7 +60,7 @@ export declare const CertificateSchema: GenMessage<Certificate>;
|
|
|
60
60
|
/**
|
|
61
61
|
* @generated from message virtru.policy.CertificateMapping
|
|
62
62
|
*/
|
|
63
|
-
export type CertificateMapping = Message<
|
|
63
|
+
export type CertificateMapping = Message<'virtru.policy.CertificateMapping'> & {
|
|
64
64
|
/**
|
|
65
65
|
* @generated from field: string id = 1;
|
|
66
66
|
*/
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Virtru Corporation. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
|
|
5
|
+
*/
|
|
6
|
+
import { enumDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv1';
|
|
7
|
+
import { file_buf_validate_validate } from '../../buf/validate/validate_pb';
|
|
8
|
+
import { file_virtru_common_common } from '../common/common_pb';
|
|
7
9
|
/**
|
|
8
10
|
* Describes the file virtru/policy/objects.proto.
|
|
9
11
|
*/
|
|
10
|
-
export const file_virtru_policy_objects =
|
|
12
|
+
export const file_virtru_policy_objects =
|
|
13
|
+
/*@__PURE__*/
|
|
14
|
+
fileDesc('Cht2aXJ0cnUvcG9saWN5L29iamVjdHMucHJvdG8SDXZpcnRydS5wb2xpY3kinwIKC0NlcnRpZmljYXRlEgoKAmlkGAEgASgJEg4KBmtleV9pZBgCIAEoCRIvCg1rZXlfYWxnb3JpdGhtGAMgASgOMhgudmlydHJ1LnBvbGljeS5BbGdvcml0aG0SLAoKa2V5X3N0YXR1cxgEIAEoDjIYLnZpcnRydS5wb2xpY3kuS2V5U3RhdHVzEhQKA3BlbRgFIAEoCUIHukgEcgIQARIVCgRuYW1lGAYgASgJQge6SARyAhABEigKCGtleV9tb2RlGA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TWV0YWRhdGHqAg5WaXJ0cnU6OlBvbGljeWIGcHJvdG8z', [file_buf_validate_validate, file_virtru_common_common]);
|
|
11
15
|
/**
|
|
12
16
|
* Describes the message virtru.policy.Certificate.
|
|
13
17
|
* Use `create(CertificateSchema)` to create a new message.
|
|
14
18
|
*/
|
|
15
|
-
export const CertificateSchema =
|
|
19
|
+
export const CertificateSchema =
|
|
20
|
+
/*@__PURE__*/
|
|
21
|
+
messageDesc(file_virtru_policy_objects, 0);
|
|
16
22
|
/**
|
|
17
23
|
* Describes the message virtru.policy.CertificateMapping.
|
|
18
24
|
* Use `create(CertificateMappingSchema)` to create a new message.
|
|
19
25
|
*/
|
|
20
|
-
export const CertificateMappingSchema =
|
|
26
|
+
export const CertificateMappingSchema =
|
|
27
|
+
/*@__PURE__*/
|
|
28
|
+
messageDesc(file_virtru_policy_objects, 1);
|
|
21
29
|
/**
|
|
22
30
|
* @generated from enum virtru.policy.Algorithm
|
|
23
31
|
*/
|
|
@@ -51,7 +59,9 @@ export var Algorithm;
|
|
|
51
59
|
/**
|
|
52
60
|
* Describes the enum virtru.policy.Algorithm.
|
|
53
61
|
*/
|
|
54
|
-
export const AlgorithmSchema =
|
|
62
|
+
export const AlgorithmSchema =
|
|
63
|
+
/*@__PURE__*/
|
|
64
|
+
enumDesc(file_virtru_policy_objects, 0);
|
|
55
65
|
/**
|
|
56
66
|
* @generated from enum virtru.policy.KeyStatus
|
|
57
67
|
*/
|
|
@@ -73,7 +83,9 @@ export var KeyStatus;
|
|
|
73
83
|
/**
|
|
74
84
|
* Describes the enum virtru.policy.KeyStatus.
|
|
75
85
|
*/
|
|
76
|
-
export const KeyStatusSchema =
|
|
86
|
+
export const KeyStatusSchema =
|
|
87
|
+
/*@__PURE__*/
|
|
88
|
+
enumDesc(file_virtru_policy_objects, 1);
|
|
77
89
|
/**
|
|
78
90
|
* Describes the management and operational mode of a cryptographic key.
|
|
79
91
|
*
|
|
@@ -123,4 +135,6 @@ export var KeyMode;
|
|
|
123
135
|
/**
|
|
124
136
|
* Describes the enum virtru.policy.KeyMode.
|
|
125
137
|
*/
|
|
126
|
-
export const KeyModeSchema =
|
|
138
|
+
export const KeyModeSchema =
|
|
139
|
+
/*@__PURE__*/
|
|
140
|
+
enumDesc(file_virtru_policy_objects, 2);
|
package/dist/src/lib/client.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
|
|
5
5
|
*/
|
|
6
|
-
import { createClient } from '@connectrpc/connect';
|
|
6
|
+
import { createClient, } from '@connectrpc/connect';
|
|
7
7
|
import { createConnectTransport } from '@connectrpc/connect-web';
|
|
8
8
|
import { ConfigService } from '../gen/config/v1/config_pb';
|
|
9
9
|
import { PolicyArtifactService } from '../gen/policyimportexport/v1/policy_import_export_pb';
|
package/dist/src/lib/utils.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
|
|
5
5
|
*/
|
|
6
|
-
import { AuthProviders, OpenTDF, PermissionDeniedError } from '@opentdf/sdk';
|
|
6
|
+
import { AuthProviders, OpenTDF, PermissionDeniedError, } from '@opentdf/sdk';
|
|
7
7
|
import { PlatformClient } from '@opentdf/sdk/platform';
|
|
8
8
|
import { ActiveStateEnum } from '@opentdf/sdk/platform/common/common_pb.js';
|
|
9
9
|
import * as asn1js from 'asn1js';
|
|
10
10
|
import * as pkijs from 'pkijs';
|
|
11
|
-
import { MAX_CERT_BYTES, MAX_CERTS } from
|
|
11
|
+
import { MAX_CERT_BYTES, MAX_CERTS } from './consts';
|
|
12
12
|
import { DSPClient } from './client';
|
|
13
13
|
/**
|
|
14
14
|
* Creates an interceptor that adds authentication headers to outgoing requests.
|
|
@@ -207,7 +207,6 @@ export async function getTrustedCertificates(options) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
catch (error) {
|
|
210
|
-
console.error('Error retrieving namespace certificates:', error);
|
|
211
210
|
throw error;
|
|
212
211
|
}
|
|
213
212
|
return certificates;
|
|
@@ -311,7 +310,8 @@ export async function validateJWSCertificateChain(x5c, trustedRootCertificates)
|
|
|
311
310
|
if (x5c.length > MAX_CERTS) {
|
|
312
311
|
throw new Error(`Too many certificates in x5c (max ${MAX_CERTS})`);
|
|
313
312
|
}
|
|
314
|
-
if (!Array.isArray(trustedRootCertificates) ||
|
|
313
|
+
if (!Array.isArray(trustedRootCertificates) ||
|
|
314
|
+
trustedRootCertificates.length === 0) {
|
|
315
315
|
throw new Error('No trusted root certificates provided');
|
|
316
316
|
}
|
|
317
317
|
// Parse chain certs (base64 DER)
|
|
@@ -369,7 +369,8 @@ export async function validateJWSCertificateChain(x5c, trustedRootCertificates)
|
|
|
369
369
|
const leaf = chainCertificates[0];
|
|
370
370
|
const leafSubject = getNameStringSafe(leaf.subject);
|
|
371
371
|
const leafIssuer = getNameStringSafe(leaf.issuer);
|
|
372
|
-
const baseMsg = verificationResult.resultMessage ||
|
|
372
|
+
const baseMsg = verificationResult.resultMessage ||
|
|
373
|
+
'Certificate chain validation failed';
|
|
373
374
|
throw new Error(`${baseMsg} (leaf subject='${leafSubject}', issuer='${leafIssuer}')`);
|
|
374
375
|
}
|
|
375
376
|
return {
|
|
@@ -382,7 +383,9 @@ export async function validateJWSCertificateChain(x5c, trustedRootCertificates)
|
|
|
382
383
|
}
|
|
383
384
|
catch (error) {
|
|
384
385
|
const msg = error instanceof Error ? error.message : 'Unknown error';
|
|
385
|
-
const warnSuffix = warnings.length
|
|
386
|
+
const warnSuffix = warnings.length
|
|
387
|
+
? `; warnings: ${warnings.join(' | ')}`
|
|
388
|
+
: '';
|
|
386
389
|
throw new Error(`Validation error: ${msg}${warnSuffix}`);
|
|
387
390
|
}
|
|
388
391
|
}
|
package/dist/tests/dsp.test.js
CHANGED
|
@@ -55,7 +55,7 @@ test('should create a new DSP instance with platformUrl', () => {
|
|
|
55
55
|
expect(dsp).toBeInstanceOf(DSP);
|
|
56
56
|
});
|
|
57
57
|
test('should throw an error if platformUrl is not provided', () => {
|
|
58
|
-
expect(() => new DSP({})).toThrowError('
|
|
58
|
+
expect(() => new DSP({ authProvider })).toThrowError('platformUrl is required for DSP client');
|
|
59
59
|
});
|
|
60
60
|
test('should create a new DSP instance with platformUrl and authProvider', () => {
|
|
61
61
|
const dsp = new DSP({ platformUrl, authProvider });
|
|
@@ -90,6 +90,3 @@ test('should expose expected service structure', () => {
|
|
|
90
90
|
test('should throw if authProvider is missing', () => {
|
|
91
91
|
expect(() => new DSP({ platformUrl })).toThrowError('Client ID or custom AuthProvider must be defined');
|
|
92
92
|
});
|
|
93
|
-
test('should throw an error if platformUrl is not provided', async () => {
|
|
94
|
-
expect(() => new DSP({})).toThrowError();
|
|
95
|
-
});
|