@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.
Files changed (76) hide show
  1. package/.rush/temp/chunked-rush-logs/dsp-sdk._phase_build.chunks.jsonl +9 -20
  2. package/.rush/temp/chunked-rush-logs/dsp-sdk._phase_test.chunks.jsonl +29 -46
  3. package/.rush/temp/package-deps__phase_build.json +31 -17
  4. package/.rush/temp/shrinkwrap-deps.json +925 -131
  5. package/CHANGELOG.json +28 -0
  6. package/CHANGELOG.md +15 -1
  7. package/README.md +10 -0
  8. package/config/jest.config.json +6 -0
  9. package/config/rig.json +8 -0
  10. package/dist/src/gen/config/v1/tagging_pb.d.ts +88 -4
  11. package/dist/src/gen/config/v1/tagging_pb.js +60 -5
  12. package/dist/src/gen/policyimportexport/v1/policy_import_export_pb.d.ts +6 -0
  13. package/dist/src/gen/policyimportexport/v1/policy_import_export_pb.js +2 -1
  14. package/dist/src/gen/virtru/common/common_pb.d.ts +10 -10
  15. package/dist/src/gen/virtru/common/common_pb.js +29 -13
  16. package/dist/src/gen/virtru/policy/certificates/v1/certificates_pb.d.ts +14 -14
  17. package/dist/src/gen/virtru/policy/certificates/v1/certificates_pb.js +40 -16
  18. package/dist/src/gen/virtru/policy/objects_pb.d.ts +5 -5
  19. package/dist/src/gen/virtru/policy/objects_pb.js +26 -12
  20. package/dist/src/lib/client.js +1 -1
  21. package/dist/src/lib/utils.js +9 -6
  22. package/dist/tests/dsp.test.js +1 -4
  23. package/lib-commonjs/src/gen/buf/validate/validate_pb.js +487 -0
  24. package/lib-commonjs/src/gen/config/v1/config_pb.js +142 -0
  25. package/lib-commonjs/src/gen/config/v1/kas_config_pb.js +72 -0
  26. package/lib-commonjs/src/gen/config/v1/meta_pb.js +36 -0
  27. package/lib-commonjs/src/gen/config/v1/outlook_config_pb.js +67 -0
  28. package/lib-commonjs/src/gen/config/v1/secureviewer_config_pb.js +67 -0
  29. package/lib-commonjs/src/gen/config/v1/tagging_pb.js +246 -0
  30. package/lib-commonjs/src/gen/google/api/annotations_pb.js +33 -0
  31. package/lib-commonjs/src/gen/google/api/http_pb.js +44 -0
  32. package/lib-commonjs/src/gen/policyimportexport/v1/policy_import_export_pb.js +93 -0
  33. package/lib-commonjs/src/gen/shared/v1/shared_pb.js +95 -0
  34. package/lib-commonjs/src/gen/tagging/pdp/v2/tagging_pb.js +277 -0
  35. package/lib-commonjs/src/gen/version/v1/version_pb.js +40 -0
  36. package/lib-commonjs/src/gen/virtru/common/common_pb.js +76 -0
  37. package/lib-commonjs/src/gen/virtru/policy/certificates/v1/certificates_pb.js +77 -0
  38. package/lib-commonjs/src/gen/virtru/policy/objects_pb.js +143 -0
  39. package/lib-commonjs/src/index.js +48 -0
  40. package/lib-commonjs/src/lib/client.js +66 -0
  41. package/lib-commonjs/src/lib/consts.js +10 -0
  42. package/lib-commonjs/src/lib/dsp.js +49 -0
  43. package/lib-commonjs/src/lib/utils.js +402 -0
  44. package/lib-commonjs/tests/dsp-client.test.js +75 -0
  45. package/lib-commonjs/tests/dsp.test.js +94 -0
  46. package/lib-commonjs/tests/mocks/create-export-artifacts.js +17 -0
  47. package/lib-commonjs/tests/mocks/tagging-pdp-tag.js +15 -0
  48. package/lib-commonjs/tests/mocks/well-known-configuration.js +16 -0
  49. package/lib-commonjs/tests/setup-msw.js +33 -0
  50. package/package.json +12 -6
  51. package/src/gen/config/formatters/testdata/v1/test_pb.ts +1 -0
  52. package/src/gen/config/v1/config_connect.ts +111 -0
  53. package/src/gen/config/v1/tagging_pb.ts +106 -5
  54. package/src/gen/helloworld/v1/helloworld_connect.ts +49 -0
  55. package/src/gen/helloworld/v1/helloworld_pb.ts +6 -0
  56. package/src/gen/kas/nanotdf/v1/nanotdf_rewrap_connect.ts +39 -0
  57. package/src/gen/kas/nanotdf/v1/nanotdf_rewrap_pb.ts +207 -0
  58. package/src/gen/policyimportexport/v1/policy_import_export_connect.ts +56 -0
  59. package/src/gen/policyimportexport/v1/policy_import_export_pb.ts +10 -2
  60. package/src/gen/shared/v1/shared_connect.ts +61 -0
  61. package/src/gen/shared/v2/shared_connect.ts +39 -0
  62. package/src/gen/tagging/pdp/v2/externalprocessors/processor_connect.ts +156 -0
  63. package/src/gen/tagging/pdp/v2/tagging_connect.ts +73 -0
  64. package/src/gen/version/v1/version_connect.ts +31 -0
  65. package/src/gen/virtru/common/common_pb.ts +55 -33
  66. package/src/gen/virtru/policy/certificates/v1/certificates_pb.ts +188 -143
  67. package/src/gen/virtru/policy/objects_pb.ts +34 -16
  68. package/src/gen/web-admin/v1/config_connect.ts +52 -0
  69. package/src/lib/client.ts +5 -1
  70. package/src/lib/utils.test.ts +76 -40
  71. package/src/lib/utils.ts +54 -29
  72. package/temp/build/lint/_eslint-5eVG3S6w.json +30 -0
  73. package/temp/test/jest/haste-map-b055a9550e6d9f9b43d8ad29b1607278-49d19aee56a0732eca9c014a51272338-8710993d07b75a801b0956e67ffc46fa +0 -0
  74. package/tests/dsp.test.ts +2 -6
  75. package/update-protos.sh +63 -0
  76. package/vitest.config.ts +1 -0
@@ -1,7 +1,7 @@
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";
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<"virtru.policy.certificates.v1.NamespaceCertificate"> & {
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<"virtru.policy.certificates.v1.ListCertificatesByNamespaceRequest"> & {
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<"virtru.policy.certificates.v1.ListCertificatesByNamespaceResponse"> & {
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<"virtru.policy.certificates.v1.AssignCertificateToNamespaceRequest"> & {
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<"virtru.policy.certificates.v1.AssignCertificateToNamespaceResponse"> & {
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<"virtru.policy.certificates.v1.RemoveCertificateFromNamespaceRequest"> & {
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<"virtru.policy.certificates.v1.RemoveCertificateFromNamespaceResponse"> & {
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: "unary";
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: "unary";
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: "unary";
211
+ methodKind: 'unary';
212
212
  input: typeof RemoveCertificateFromNamespaceRequestSchema;
213
213
  output: typeof RemoveCertificateFromNamespaceResponseSchema;
214
214
  };
@@ -1,50 +1,74 @@
1
- // @generated by protoc-gen-es v2.3.0 with parameter "target=ts"
2
- // @generated from file virtru/policy/certificates/v1/certificates.proto (package virtru.policy.certificates.v1, syntax proto3)
3
- /* eslint-disable */
4
- import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
5
- import { file_buf_validate_validate } from "../../../../buf/validate/validate_pb";
6
- import { file_virtru_common_common } from "../../../common/common_pb";
7
- import { file_virtru_policy_objects } from "../../objects_pb";
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 = /*@__PURE__*/ fileDesc("CjB2aXJ0cnUvcG9saWN5L2NlcnRpZmljYXRlcy92MS9jZXJ0aWZpY2F0ZXMucHJvdG8SHXZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxIl4KFE5hbWVzcGFjZUNlcnRpZmljYXRlEiEKDG5hbWVzcGFjZV9pZ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RC52aXJ0cnUucG9saWN5LmNlcnRpZmljYXRlcy52MS5SZW1vdmVDZXJ0aWZpY2F0ZUZyb21OYW1lc3BhY2VSZXF1ZXN0GkUudmlydHJ1LnBvbGljeS5jZXJ0aWZpY2F0ZXMudjEuUmVtb3ZlQ2VydGlmaWNhdGVGcm9tTmFtZXNwYWNlUmVzcG9uc2UiAELNAQohY29tLnZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxQhFDZXJ0aWZpY2F0ZXNQcm90b1ABogIDVlBDqgIdVmlydHJ1LlBvbGljeS5DZXJ0aWZpY2F0ZXMuVjHKAh1WaXJ0cnVcUG9saWN5XENlcnRpZmljYXRlc1xWMeICKVZpcnRydVxQb2xpY3lcQ2VydGlmaWNhdGVzXFYxXEdQQk1ldGFkYXRh6gIgVmlydHJ1OjpQb2xpY3k6OkNlcnRpZmljYXRlczo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_virtru_common_common, file_virtru_policy_objects]);
13
+ export const file_virtru_policy_certificates_v1_certificates =
14
+ /*@__PURE__*/
15
+ fileDesc('CjB2aXJ0cnUvcG9saWN5L2NlcnRpZmljYXRlcy92MS9jZXJ0aWZpY2F0ZXMucHJvdG8SHXZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxIl4KFE5hbWVzcGFjZUNlcnRpZmljYXRlEiEKDG5hbWVzcGFjZV9pZBgBIAEoCUILukgIyAEBcgOwAQESIwoOY2VydGlmaWNhdGVfaWQYAiABKAlCC7pICMgBAXIDsAEBIncKIkxpc3RDZXJ0aWZpY2F0ZXNCeU5hbWVzcGFjZVJlcXVlc3QSIQoMbmFtZXNwYWNlX2lkGAEgASgJQgu6SAjIAQFyA7ABARIuCgpwYWdpbmF0aW9uGAogASgLMhoudmlydHJ1LmNvbW1vbi5QYWdlUmVxdWVzdCKIAQojTGlzdENlcnRpZmljYXRlc0J5TmFtZXNwYWNlUmVzcG9uc2USMAoMY2VydGlmaWNhdGVzGAEgAygLMhoudmlydHJ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GxhdGZvcm0vc2RrL3YyL2dlbi92aXJ0cnUvcG9saWN5L2NlcnRpZmljYXRlcy92MTtjZXJ0aWZpY2F0ZXN2MaICA1ZQQ6oCHVZpcnRydS5Qb2xpY3kuQ2VydGlmaWNhdGVzLlYxygIdVmlydHJ1XFBvbGljeVxDZXJ0aWZpY2F0ZXNcVjHiAilWaXJ0cnVcUG9saWN5XENlcnRpZmljYXRlc1xWMVxHUEJNZXRhZGF0YeoCIFZpcnRydTo6UG9saWN5OjpDZXJ0aWZpY2F0ZXM6OlYxYgZwcm90bzM', [
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 = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 0);
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 = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 1);
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 = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 2);
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 = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 3);
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 = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 4);
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 = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 5);
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 = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 6);
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 = /*@__PURE__*/ serviceDesc(file_virtru_policy_certificates_v1_certificates, 0);
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 "@bufbuild/protobuf/codegenv1";
2
- import type { Metadata } from "../common/common_pb";
3
- import type { Message } from "@bufbuild/protobuf";
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<"virtru.policy.Certificate"> & {
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<"virtru.policy.CertificateMapping"> & {
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
- // @generated by protoc-gen-es v2.3.0 with parameter "target=ts"
2
- // @generated from file virtru/policy/objects.proto (package virtru.policy, syntax proto3)
3
- /* eslint-disable */
4
- import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
5
- import { file_buf_validate_validate } from "../../buf/validate/validate_pb";
6
- import { file_virtru_common_common } from "../common/common_pb";
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 = /*@__PURE__*/ fileDesc("Cht2aXJ0cnUvcG9saWN5L29iamVjdHMucHJvdG8SDXZpcnRydS5wb2xpY3kinwIKC0NlcnRpZmljYXRlEgoKAmlkGAEgASgJEg4KBmtleV9pZBgCIAEoCRIvCg1rZXlfYWxnb3JpdGhtGAMgASgOMhgudmlydHJ1LnBvbGljeS5BbGdvcml0aG0SLAoKa2V5X3N0YXR1cxgEIAEoDjIYLnZpcnRydS5wb2xpY3kuS2V5U3RhdHVzEhQKA3BlbRgFIAEoCUIHukgEcgIQARIVCgRuYW1lGAYgASgJQge6SARyAhABEigKCGtleV9tb2RlGAcgASgOMhYudmlydHJ1LnBvbGljeS5LZXlNb2RlEhMKC2ZpbmdlcnByaW50GAggASgJEikKCG1ldGFkYXRhGGQgASgLMhcudmlydHJ1LmNvbW1vbi5NZXRhZGF0YSKXAQoSQ2VydGlmaWNhdGVNYXBwaW5nEhQKAmlkGAEgASgJQgi6SAVyA7ABARIgCg5jZXJ0aWZpY2F0ZV9pZBgCIAEoCUIIukgFcgOwAQESHgoMbmFtZXNwYWNlX2lkGAMgASgJQgi6SAVyA7ABARIpCghtZXRhZGF0YRhkIAEoCzIXLnZpcnRydS5jb21tb24uTWV0YWRhdGEqmwEKCUFsZ29yaXRobRIZChVBTEdPUklUSE1fVU5TUEVDSUZJRUQQABIWChJBTEdPUklUSE1fUlNBXzIwNDgQARIWChJBTEdPUklUSE1fUlNBXzQwOTYQAhIVChFBTEdPUklUSE1fRUNfUDI1NhADEhUKEUFMR09SSVRITV9FQ19QMzg0EAQSFQoRQUxHT1JJVEhNX0VDX1A1MjEQBSpWCglLZXlTdGF0dXMSGgoWS0VZX1NUQVRVU19VTlNQRUNJRklFRBAAEhUKEUtFWV9TVEFUVVNfQUNUSVZFEAESFgoSS0VZX1NUQVRVU19ST1RBVEVEEAIqlAEKB0tleU1vZGUSGAoUS0VZX01PREVfVU5TUEVDSUZJRUQQABIcChhLRVlfTU9ERV9DT05GSUdfUk9PVF9LRVkQARIeChpLRVlfTU9ERV9QUk9WSURFUl9ST09UX0tFWRACEhMKD0tFWV9NT0RFX1JFTU9URRADEhwKGEtFWV9NT0RFX1BVQkxJQ19LRVlfT05MWRAEQnYKEWNvbS52aXJ0cnUucG9saWN5QgxPYmplY3RzUHJvdG9QAaICA1ZQWKoCDVZpcnRydS5Qb2xpY3nKAg1WaXJ0cnVcUG9saWN54gIZVmlydHJ1XFBvbGljeVxHUEJNZXRhZGF0YeoCDlZpcnRydTo6UG9saWN5YgZwcm90bzM", [file_buf_validate_validate, file_virtru_common_common]);
12
+ export const file_virtru_policy_objects =
13
+ /*@__PURE__*/
14
+ fileDesc('Cht2aXJ0cnUvcG9saWN5L29iamVjdHMucHJvdG8SDXZpcnRydS5wb2xpY3kinwIKC0NlcnRpZmljYXRlEgoKAmlkGAEgASgJEg4KBmtleV9pZBgCIAEoCRIvCg1rZXlfYWxnb3JpdGhtGAMgASgOMhgudmlydHJ1LnBvbGljeS5BbGdvcml0aG0SLAoKa2V5X3N0YXR1cxgEIAEoDjIYLnZpcnRydS5wb2xpY3kuS2V5U3RhdHVzEhQKA3BlbRgFIAEoCUIHukgEcgIQARIVCgRuYW1lGAYgASgJQge6SARyAhABEigKCGtleV9tb2RlGAcgASgOMhYudmlydHJ1LnBvbGljeS5LZXlNb2RlEhMKC2ZpbmdlcnByaW50GAggASgJEikKCG1ldGFkYXRhGGQgASgLMhcudmlydHJ1LmNvbW1vbi5NZXRhZGF0YSKXAQoSQ2VydGlmaWNhdGVNYXBwaW5nEhQKAmlkGAEgASgJQgi6SAVyA7ABARIgCg5jZXJ0aWZpY2F0ZV9pZBgCIAEoCUIIukgFcgOwAQESHgoMbmFtZXNwYWNlX2lkGAMgASgJQgi6SAVyA7ABARIpCghtZXRhZGF0YRhkIAEoCzIXLnZpcnRydS5jb21tb24uTWV0YWRhdGEqmwEKCUFsZ29yaXRobRIZChVBTEdPUklUSE1fVU5TUEVDSUZJRUQQABIWChJBTEdPUklUSE1fUlNBXzIwNDgQARIWChJBTEdPUklUSE1fUlNBXzQwOTYQAhIVChFBTEdPUklUSE1fRUNfUDI1NhADEhUKEUFMR09SSVRITV9FQ19QMzg0EAQSFQoRQUxHT1JJVEhNX0VDX1A1MjEQBSpWCglLZXlTdGF0dXMSGgoWS0VZX1NUQVRVU19VTlNQRUNJRklFRBAAEhUKEUtFWV9TVEFUVVNfQUNUSVZFEAESFgoSS0VZX1NUQVRVU19ST1RBVEVEEAIqlAEKB0tleU1vZGUSGAoUS0VZX01PREVfVU5TUEVDSUZJRUQQABIcChhLRVlfTU9ERV9DT05GSUdfUk9PVF9LRVkQARIeChpLRVlfTU9ERV9QUk9WSURFUl9ST09UX0tFWRACEhMKD0tFWV9NT0RFX1JFTU9URRADEhwKGEtFWV9NT0RFX1BVQkxJQ19LRVlfT05MWRAEQr4BChFjb20udmlydHJ1LnBvbGljeUIMT2JqZWN0c1Byb3RvUAFaRmdpdGh1Yi5jb20vdmlydHJ1LWNvcnAvZGF0YS1zZWN1cml0eS1wbGF0Zm9ybS9zZGsvdjIvZ2VuL3ZpcnRydS9wb2xpY3miAgNWUFiqAg1WaXJ0cnUuUG9saWN5ygINVmlydHJ1XFBvbGljeeICGVZpcnRydVxQb2xpY3lcR1BCTWV0YWRhdGHqAg5WaXJ0cnU6OlBvbGljeWIGcHJvdG8z', [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 = /*@__PURE__*/ messageDesc(file_virtru_policy_objects, 0);
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 = /*@__PURE__*/ messageDesc(file_virtru_policy_objects, 1);
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 = /*@__PURE__*/ enumDesc(file_virtru_policy_objects, 0);
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 = /*@__PURE__*/ enumDesc(file_virtru_policy_objects, 1);
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 = /*@__PURE__*/ enumDesc(file_virtru_policy_objects, 2);
138
+ export const KeyModeSchema =
139
+ /*@__PURE__*/
140
+ enumDesc(file_virtru_policy_objects, 2);
@@ -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';
@@ -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 "./consts";
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) || trustedRootCertificates.length === 0) {
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 || 'Certificate chain validation failed';
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 ? `; warnings: ${warnings.join(' | ')}` : '';
386
+ const warnSuffix = warnings.length
387
+ ? `; warnings: ${warnings.join(' | ')}`
388
+ : '';
386
389
  throw new Error(`Validation error: ${msg}${warnSuffix}`);
387
390
  }
388
391
  }
@@ -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('Client ID or custom AuthProvider must be defined');
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
- });