@virtru/dsp-sdk 0.2.4 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/.rush/temp/chunked-rush-logs/dsp-sdk._phase_build.chunks.jsonl +3 -3
  2. package/.rush/temp/chunked-rush-logs/dsp-sdk._phase_test.chunks.jsonl +36 -9
  3. package/.rush/temp/package-deps__phase_build.json +16 -8
  4. package/.rush/temp/shrinkwrap-deps.json +8 -2
  5. package/CHANGELOG.json +28 -0
  6. package/CHANGELOG.md +15 -1
  7. package/README.md +55 -0
  8. package/buf.gen.yaml +17 -0
  9. package/buf.yaml +4 -0
  10. package/dist/src/gen/virtru/common/common_pb.d.ts +151 -0
  11. package/dist/src/gen/virtru/common/common_pb.js +57 -0
  12. package/dist/src/gen/virtru/policy/certificates/v1/certificates_pb.d.ts +215 -0
  13. package/dist/src/gen/virtru/policy/certificates/v1/certificates_pb.js +50 -0
  14. package/dist/src/gen/virtru/policy/objects_pb.d.ts +188 -0
  15. package/dist/src/gen/virtru/policy/objects_pb.js +126 -0
  16. package/dist/src/index.d.ts +1 -2
  17. package/dist/src/index.js +1 -2
  18. package/dist/src/lib/client.d.ts +2 -0
  19. package/dist/src/lib/client.js +2 -0
  20. package/dist/src/lib/consts.d.ts +2 -0
  21. package/dist/src/lib/consts.js +7 -0
  22. package/dist/src/lib/utils.d.ts +136 -0
  23. package/dist/src/lib/utils.js +355 -2
  24. package/package.json +5 -3
  25. package/src/gen/virtru/common/common_pb.ts +179 -0
  26. package/src/gen/virtru/policy/certificates/v1/certificates_connect.ts +44 -0
  27. package/src/gen/virtru/policy/certificates/v1/certificates_pb.ts +260 -0
  28. package/src/gen/virtru/policy/objects_pb.ts +235 -0
  29. package/src/index.ts +15 -2
  30. package/src/lib/client.ts +3 -0
  31. package/src/lib/consts.ts +8 -0
  32. package/src/lib/utils.test.ts +376 -0
  33. package/src/lib/utils.ts +460 -4
@@ -0,0 +1,215 @@
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
+ /**
6
+ * Describes the file virtru/policy/certificates/v1/certificates.proto.
7
+ */
8
+ export declare const file_virtru_policy_certificates_v1_certificates: GenFile;
9
+ /**
10
+ * Maps a namespace to a certificate (similar to NamespaceKey pattern)
11
+ *
12
+ * @generated from message virtru.policy.certificates.v1.NamespaceCertificate
13
+ */
14
+ export type NamespaceCertificate = Message<"virtru.policy.certificates.v1.NamespaceCertificate"> & {
15
+ /**
16
+ * Required - namespace id
17
+ *
18
+ * @generated from field: string namespace_id = 1;
19
+ */
20
+ namespaceId: string;
21
+ /**
22
+ * Required (The id from the Certificate object)
23
+ *
24
+ * @generated from field: string certificate_id = 2;
25
+ */
26
+ certificateId: string;
27
+ };
28
+ /**
29
+ * Describes the message virtru.policy.certificates.v1.NamespaceCertificate.
30
+ * Use `create(NamespaceCertificateSchema)` to create a new message.
31
+ */
32
+ export declare const NamespaceCertificateSchema: GenMessage<NamespaceCertificate>;
33
+ /**
34
+ * @generated from message virtru.policy.certificates.v1.ListCertificatesByNamespaceRequest
35
+ */
36
+ export type ListCertificatesByNamespaceRequest = Message<"virtru.policy.certificates.v1.ListCertificatesByNamespaceRequest"> & {
37
+ /**
38
+ * Required - namespace id
39
+ *
40
+ * @generated from field: string namespace_id = 1;
41
+ */
42
+ namespaceId: string;
43
+ /**
44
+ * Optional pagination information
45
+ *
46
+ * @generated from field: virtru.common.PageRequest pagination = 10;
47
+ */
48
+ pagination?: PageRequest;
49
+ };
50
+ /**
51
+ * Describes the message virtru.policy.certificates.v1.ListCertificatesByNamespaceRequest.
52
+ * Use `create(ListCertificatesByNamespaceRequestSchema)` to create a new message.
53
+ */
54
+ export declare const ListCertificatesByNamespaceRequestSchema: GenMessage<ListCertificatesByNamespaceRequest>;
55
+ /**
56
+ * ListCertificatesByNamespaceResponse is the response message for the ListCertificatesByNamespace method.
57
+ *
58
+ * @generated from message virtru.policy.certificates.v1.ListCertificatesByNamespaceResponse
59
+ */
60
+ export type ListCertificatesByNamespaceResponse = Message<"virtru.policy.certificates.v1.ListCertificatesByNamespaceResponse"> & {
61
+ /**
62
+ * The list of certificates for the specified namespace.
63
+ *
64
+ * @generated from field: repeated virtru.policy.Certificate certificates = 1;
65
+ */
66
+ certificates: Certificate[];
67
+ /**
68
+ * Pagination information
69
+ *
70
+ * @generated from field: virtru.common.PageResponse pagination = 10;
71
+ */
72
+ pagination?: PageResponse;
73
+ };
74
+ /**
75
+ * Describes the message virtru.policy.certificates.v1.ListCertificatesByNamespaceResponse.
76
+ * Use `create(ListCertificatesByNamespaceResponseSchema)` to create a new message.
77
+ */
78
+ export declare const ListCertificatesByNamespaceResponseSchema: GenMessage<ListCertificatesByNamespaceResponse>;
79
+ /**
80
+ * @generated from message virtru.policy.certificates.v1.AssignCertificateToNamespaceRequest
81
+ */
82
+ export type AssignCertificateToNamespaceRequest = Message<"virtru.policy.certificates.v1.AssignCertificateToNamespaceRequest"> & {
83
+ /**
84
+ * Required - namespace id
85
+ *
86
+ * @generated from field: string namespace_id = 1;
87
+ */
88
+ namespaceId: string;
89
+ /**
90
+ * Required - PEM format certificate
91
+ *
92
+ * @generated from field: string pem = 2;
93
+ */
94
+ pem: string;
95
+ /**
96
+ * @generated from field: string key_id = 3;
97
+ */
98
+ keyId: string;
99
+ /**
100
+ * The algorithm to be used for the key
101
+ *
102
+ * @generated from field: virtru.policy.Algorithm key_algorithm = 4;
103
+ */
104
+ keyAlgorithm: Algorithm;
105
+ /**
106
+ * @generated from field: string name = 5;
107
+ */
108
+ name: string;
109
+ /**
110
+ * The status of the key
111
+ *
112
+ * @generated from field: virtru.policy.KeyStatus key_status = 6;
113
+ */
114
+ keyStatus: KeyStatus;
115
+ /**
116
+ * The mode of the key
117
+ *
118
+ * @generated from field: virtru.policy.KeyMode key_mode = 7;
119
+ */
120
+ keyMode: KeyMode;
121
+ /**
122
+ * Optional
123
+ *
124
+ * @generated from field: virtru.common.MetadataMutable metadata = 100;
125
+ */
126
+ metadata?: MetadataMutable;
127
+ };
128
+ /**
129
+ * Describes the message virtru.policy.certificates.v1.AssignCertificateToNamespaceRequest.
130
+ * Use `create(AssignCertificateToNamespaceRequestSchema)` to create a new message.
131
+ */
132
+ export declare const AssignCertificateToNamespaceRequestSchema: GenMessage<AssignCertificateToNamespaceRequest>;
133
+ /**
134
+ * @generated from message virtru.policy.certificates.v1.AssignCertificateToNamespaceResponse
135
+ */
136
+ export type AssignCertificateToNamespaceResponse = Message<"virtru.policy.certificates.v1.AssignCertificateToNamespaceResponse"> & {
137
+ /**
138
+ * The mapping of the namespace to the certificate.
139
+ *
140
+ * @generated from field: virtru.policy.certificates.v1.NamespaceCertificate namespace_certificate = 1;
141
+ */
142
+ namespaceCertificate?: NamespaceCertificate;
143
+ /**
144
+ * Return the full certificate object for convenience
145
+ *
146
+ * @generated from field: virtru.policy.Certificate certificate = 2;
147
+ */
148
+ certificate?: Certificate;
149
+ };
150
+ /**
151
+ * Describes the message virtru.policy.certificates.v1.AssignCertificateToNamespaceResponse.
152
+ * Use `create(AssignCertificateToNamespaceResponseSchema)` to create a new message.
153
+ */
154
+ export declare const AssignCertificateToNamespaceResponseSchema: GenMessage<AssignCertificateToNamespaceResponse>;
155
+ /**
156
+ * @generated from message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceRequest
157
+ */
158
+ export type RemoveCertificateFromNamespaceRequest = Message<"virtru.policy.certificates.v1.RemoveCertificateFromNamespaceRequest"> & {
159
+ /**
160
+ * The namespace and certificate to unassign.
161
+ *
162
+ * @generated from field: virtru.policy.certificates.v1.NamespaceCertificate namespace_certificate = 1;
163
+ */
164
+ namespaceCertificate?: NamespaceCertificate;
165
+ };
166
+ /**
167
+ * Describes the message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceRequest.
168
+ * Use `create(RemoveCertificateFromNamespaceRequestSchema)` to create a new message.
169
+ */
170
+ export declare const RemoveCertificateFromNamespaceRequestSchema: GenMessage<RemoveCertificateFromNamespaceRequest>;
171
+ /**
172
+ * @generated from message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceResponse
173
+ */
174
+ export type RemoveCertificateFromNamespaceResponse = Message<"virtru.policy.certificates.v1.RemoveCertificateFromNamespaceResponse"> & {
175
+ /**
176
+ * The unassigned namespace and certificate.
177
+ *
178
+ * @generated from field: virtru.policy.certificates.v1.NamespaceCertificate namespace_certificate = 1;
179
+ */
180
+ namespaceCertificate?: NamespaceCertificate;
181
+ };
182
+ /**
183
+ * Describes the message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceResponse.
184
+ * Use `create(RemoveCertificateFromNamespaceResponseSchema)` to create a new message.
185
+ */
186
+ export declare const RemoveCertificateFromNamespaceResponseSchema: GenMessage<RemoveCertificateFromNamespaceResponse>;
187
+ /**
188
+ * @generated from service virtru.policy.certificates.v1.CertificateService
189
+ */
190
+ export declare const CertificateService: GenService<{
191
+ /**
192
+ * @generated from rpc virtru.policy.certificates.v1.CertificateService.ListCertificatesByNamespace
193
+ */
194
+ listCertificatesByNamespace: {
195
+ methodKind: "unary";
196
+ input: typeof ListCertificatesByNamespaceRequestSchema;
197
+ output: typeof ListCertificatesByNamespaceResponseSchema;
198
+ };
199
+ /**
200
+ * @generated from rpc virtru.policy.certificates.v1.CertificateService.AssignCertificateToNamespace
201
+ */
202
+ assignCertificateToNamespace: {
203
+ methodKind: "unary";
204
+ input: typeof AssignCertificateToNamespaceRequestSchema;
205
+ output: typeof AssignCertificateToNamespaceResponseSchema;
206
+ };
207
+ /**
208
+ * @generated from rpc virtru.policy.certificates.v1.CertificateService.RemoveCertificateFromNamespace
209
+ */
210
+ removeCertificateFromNamespace: {
211
+ methodKind: "unary";
212
+ input: typeof RemoveCertificateFromNamespaceRequestSchema;
213
+ output: typeof RemoveCertificateFromNamespaceResponseSchema;
214
+ };
215
+ }>;
@@ -0,0 +1,50 @@
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";
8
+ /**
9
+ * Describes the file virtru/policy/certificates/v1/certificates.proto.
10
+ */
11
+ export const file_virtru_policy_certificates_v1_certificates = /*@__PURE__*/ fileDesc("CjB2aXJ0cnUvcG9saWN5L2NlcnRpZmljYXRlcy92MS9jZXJ0aWZpY2F0ZXMucHJvdG8SHXZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxIl4KFE5hbWVzcGFjZUNlcnRpZmljYXRlEiEKDG5hbWVzcGFjZV9pZBgBIAEoCUILukgIyAEBcgOwAQESIwoOY2VydGlmaWNhdGVfaWQYAiABKAlCC7pICMgBAXIDsAEBIncKIkxpc3RDZXJ0aWZpY2F0ZXNCeU5hbWVzcGFjZVJlcXVlc3QSIQoMbmFtZXNwYWNlX2lkGAEgASgJQgu6SAjIAQFyA7ABARIuCgpwYWdpbmF0aW9uGAogASgLMhoudmlydHJ1LmNvbW1vbi5QYWdlUmVxdWVzdCKIAQojTGlzdENlcnRpZmljYXRlc0J5TmFtZXNwYWNlUmVzcG9uc2USMAoMY2VydGlmaWNhdGVzGAEgAygLMhoudmlydHJ1LnBvbGljeS5DZXJ0aWZpY2F0ZRIvCgpwYWdpbmF0aW9uGAogASgLMhsudmlydHJ1LmNvbW1vbi5QYWdlUmVzcG9uc2UiugMKI0Fzc2lnbkNlcnRpZmljYXRlVG9OYW1lc3BhY2VSZXF1ZXN0EiEKDG5hbWVzcGFjZV9pZBgBIAEoCUILukgIyAE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_policy_objects]);
12
+ /**
13
+ * Describes the message virtru.policy.certificates.v1.NamespaceCertificate.
14
+ * Use `create(NamespaceCertificateSchema)` to create a new message.
15
+ */
16
+ export const NamespaceCertificateSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 0);
17
+ /**
18
+ * Describes the message virtru.policy.certificates.v1.ListCertificatesByNamespaceRequest.
19
+ * Use `create(ListCertificatesByNamespaceRequestSchema)` to create a new message.
20
+ */
21
+ export const ListCertificatesByNamespaceRequestSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 1);
22
+ /**
23
+ * Describes the message virtru.policy.certificates.v1.ListCertificatesByNamespaceResponse.
24
+ * Use `create(ListCertificatesByNamespaceResponseSchema)` to create a new message.
25
+ */
26
+ export const ListCertificatesByNamespaceResponseSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 2);
27
+ /**
28
+ * Describes the message virtru.policy.certificates.v1.AssignCertificateToNamespaceRequest.
29
+ * Use `create(AssignCertificateToNamespaceRequestSchema)` to create a new message.
30
+ */
31
+ export const AssignCertificateToNamespaceRequestSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 3);
32
+ /**
33
+ * Describes the message virtru.policy.certificates.v1.AssignCertificateToNamespaceResponse.
34
+ * Use `create(AssignCertificateToNamespaceResponseSchema)` to create a new message.
35
+ */
36
+ export const AssignCertificateToNamespaceResponseSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 4);
37
+ /**
38
+ * Describes the message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceRequest.
39
+ * Use `create(RemoveCertificateFromNamespaceRequestSchema)` to create a new message.
40
+ */
41
+ export const RemoveCertificateFromNamespaceRequestSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 5);
42
+ /**
43
+ * Describes the message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceResponse.
44
+ * Use `create(RemoveCertificateFromNamespaceResponseSchema)` to create a new message.
45
+ */
46
+ export const RemoveCertificateFromNamespaceResponseSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 6);
47
+ /**
48
+ * @generated from service virtru.policy.certificates.v1.CertificateService
49
+ */
50
+ export const CertificateService = /*@__PURE__*/ serviceDesc(file_virtru_policy_certificates_v1_certificates, 0);
@@ -0,0 +1,188 @@
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
+ /**
5
+ * Describes the file virtru/policy/objects.proto.
6
+ */
7
+ export declare const file_virtru_policy_objects: GenFile;
8
+ /**
9
+ * @generated from message virtru.policy.Certificate
10
+ */
11
+ export type Certificate = Message<"virtru.policy.Certificate"> & {
12
+ /**
13
+ * @generated from field: string id = 1;
14
+ */
15
+ id: string;
16
+ /**
17
+ * @generated from field: string key_id = 2;
18
+ */
19
+ keyId: string;
20
+ /**
21
+ * @generated from field: virtru.policy.Algorithm key_algorithm = 3;
22
+ */
23
+ keyAlgorithm: Algorithm;
24
+ /**
25
+ * @generated from field: virtru.policy.KeyStatus key_status = 4;
26
+ */
27
+ keyStatus: KeyStatus;
28
+ /**
29
+ * @generated from field: string pem = 5;
30
+ */
31
+ pem: string;
32
+ /**
33
+ * The name of the certificate.
34
+ *
35
+ * @generated from field: string name = 6;
36
+ */
37
+ name: string;
38
+ /**
39
+ * The key mode of the certificate.
40
+ *
41
+ * @generated from field: virtru.policy.KeyMode key_mode = 7;
42
+ */
43
+ keyMode: KeyMode;
44
+ /**
45
+ * The fingerprint of the certificate.
46
+ *
47
+ * @generated from field: string fingerprint = 8;
48
+ */
49
+ fingerprint: string;
50
+ /**
51
+ * @generated from field: virtru.common.Metadata metadata = 100;
52
+ */
53
+ metadata?: Metadata;
54
+ };
55
+ /**
56
+ * Describes the message virtru.policy.Certificate.
57
+ * Use `create(CertificateSchema)` to create a new message.
58
+ */
59
+ export declare const CertificateSchema: GenMessage<Certificate>;
60
+ /**
61
+ * @generated from message virtru.policy.CertificateMapping
62
+ */
63
+ export type CertificateMapping = Message<"virtru.policy.CertificateMapping"> & {
64
+ /**
65
+ * @generated from field: string id = 1;
66
+ */
67
+ id: string;
68
+ /**
69
+ * @generated from field: string certificate_id = 2;
70
+ */
71
+ certificateId: string;
72
+ /**
73
+ * @generated from field: string namespace_id = 3;
74
+ */
75
+ namespaceId: string;
76
+ /**
77
+ * @generated from field: virtru.common.Metadata metadata = 100;
78
+ */
79
+ metadata?: Metadata;
80
+ };
81
+ /**
82
+ * Describes the message virtru.policy.CertificateMapping.
83
+ * Use `create(CertificateMappingSchema)` to create a new message.
84
+ */
85
+ export declare const CertificateMappingSchema: GenMessage<CertificateMapping>;
86
+ /**
87
+ * @generated from enum virtru.policy.Algorithm
88
+ */
89
+ export declare enum Algorithm {
90
+ /**
91
+ * @generated from enum value: ALGORITHM_UNSPECIFIED = 0;
92
+ */
93
+ UNSPECIFIED = 0,
94
+ /**
95
+ * @generated from enum value: ALGORITHM_RSA_2048 = 1;
96
+ */
97
+ RSA_2048 = 1,
98
+ /**
99
+ * @generated from enum value: ALGORITHM_RSA_4096 = 2;
100
+ */
101
+ RSA_4096 = 2,
102
+ /**
103
+ * @generated from enum value: ALGORITHM_EC_P256 = 3;
104
+ */
105
+ EC_P256 = 3,
106
+ /**
107
+ * @generated from enum value: ALGORITHM_EC_P384 = 4;
108
+ */
109
+ EC_P384 = 4,
110
+ /**
111
+ * @generated from enum value: ALGORITHM_EC_P521 = 5;
112
+ */
113
+ EC_P521 = 5
114
+ }
115
+ /**
116
+ * Describes the enum virtru.policy.Algorithm.
117
+ */
118
+ export declare const AlgorithmSchema: GenEnum<Algorithm>;
119
+ /**
120
+ * @generated from enum virtru.policy.KeyStatus
121
+ */
122
+ export declare enum KeyStatus {
123
+ /**
124
+ * @generated from enum value: KEY_STATUS_UNSPECIFIED = 0;
125
+ */
126
+ UNSPECIFIED = 0,
127
+ /**
128
+ * @generated from enum value: KEY_STATUS_ACTIVE = 1;
129
+ */
130
+ ACTIVE = 1,
131
+ /**
132
+ * @generated from enum value: KEY_STATUS_ROTATED = 2;
133
+ */
134
+ ROTATED = 2
135
+ }
136
+ /**
137
+ * Describes the enum virtru.policy.KeyStatus.
138
+ */
139
+ export declare const KeyStatusSchema: GenEnum<KeyStatus>;
140
+ /**
141
+ * Describes the management and operational mode of a cryptographic key.
142
+ *
143
+ * @generated from enum virtru.policy.KeyMode
144
+ */
145
+ export declare enum KeyMode {
146
+ /**
147
+ * KEY_MODE_UNSPECIFIED: Default, unspecified key mode. Indicates an uninitialized or error state.
148
+ *
149
+ * @generated from enum value: KEY_MODE_UNSPECIFIED = 0;
150
+ */
151
+ UNSPECIFIED = 0,
152
+ /**
153
+ * KEY_MODE_CONFIG_ROOT_KEY: Local key management where the private key is wrapped by a Key Encryption Key (KEK)
154
+ * sourced from local configuration. Unwrapping and all cryptographic operations are performed locally.
155
+ *
156
+ * @generated from enum value: KEY_MODE_CONFIG_ROOT_KEY = 1;
157
+ */
158
+ CONFIG_ROOT_KEY = 1,
159
+ /**
160
+ * KEY_MODE_PROVIDER_ROOT_KEY: Local key management where the private key is wrapped by a Key Encryption Key (KEK)
161
+ * managed by an external provider (e.g., a Hardware Security Module or Cloud KMS).
162
+ * Key unwrapping is delegated to the external provider; subsequent cryptographic operations
163
+ * are performed locally using the unwrapped key.
164
+ *
165
+ * @generated from enum value: KEY_MODE_PROVIDER_ROOT_KEY = 2;
166
+ */
167
+ PROVIDER_ROOT_KEY = 2,
168
+ /**
169
+ * KEY_MODE_REMOTE: Remote key management where the private key is stored in, and all cryptographic
170
+ * operations are performed by, a remote Key Management Service (KMS) or HSM.
171
+ * The private key material never leaves the secure boundary of the remote system.
172
+ *
173
+ * @generated from enum value: KEY_MODE_REMOTE = 3;
174
+ */
175
+ REMOTE = 3,
176
+ /**
177
+ * KEY_MODE_PUBLIC_KEY_ONLY: Public key only mode. Used when only a public key is available or required,
178
+ * typically for wrapping operations (e.g., encrypting a Data Encryption Key (DEK) for an external KAS).
179
+ * The corresponding private key is not managed or accessible by this system.
180
+ *
181
+ * @generated from enum value: KEY_MODE_PUBLIC_KEY_ONLY = 4;
182
+ */
183
+ PUBLIC_KEY_ONLY = 4
184
+ }
185
+ /**
186
+ * Describes the enum virtru.policy.KeyMode.
187
+ */
188
+ export declare const KeyModeSchema: GenEnum<KeyMode>;
@@ -0,0 +1,126 @@
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";
7
+ /**
8
+ * Describes the file virtru/policy/objects.proto.
9
+ */
10
+ export const file_virtru_policy_objects = /*@__PURE__*/ fileDesc("Cht2aXJ0cnUvcG9saWN5L29iamVjdHMucHJvdG8SDXZpcnRydS5wb2xpY3kinwIKC0NlcnRpZmljYXRlEgoKAmlkGAEgASgJEg4KBmtleV9pZBgCIAEoCRIvCg1rZXlfYWxnb3JpdGhtGAMgASgOMhgudmlydHJ1LnBvbGljeS5BbGdvcml0aG0SLAoKa2V5X3N0YXR1cxgEIAEoDjIYLnZpcnRydS5wb2xpY3kuS2V5U3RhdHVzEhQKA3BlbRgFIAEoCUIHukgEcgIQARIVCgRuYW1lGAYgASgJQge6SARyAhABEigKCGtleV9tb2RlGAcgASgOMhYudmlydHJ1LnBvbGljeS5LZXlNb2RlEhMKC2ZpbmdlcnByaW50GAggASgJEikKCG1ldGFkYXRhGGQgASgLMhcudmlydHJ1LmNvbW1vbi5NZXRhZGF0YSKXAQoSQ2VydGlmaWNhdGVNYXBwaW5nEhQKAmlkGAEgASgJQgi6SAVyA7ABARIgCg5jZXJ0aWZpY2F0ZV9pZBgCIAEoCUIIukgFcgOwAQESHgoMbmFtZXNwYWNlX2lkGAMgASgJQgi6SAVyA7ABARIpCghtZXRhZGF0YRhkIAEoCzIXLnZpcnRydS5jb21tb24uTWV0YWRhdGEqmwEKCUFsZ29yaXRobRIZChVBTEdPUklUSE1fVU5TUEVDSUZJRUQQABIWChJBTEdPUklUSE1fUlNBXzIwNDgQARIWChJBTEdPUklUSE1fUlNBXzQwOTYQAhIVChFBTEdPUklUSE1fRUNfUDI1NhADEhUKEUFMR09SSVRITV9FQ19QMzg0EAQSFQoRQUxHT1JJVEhNX0VDX1A1MjEQBSpWCglLZXlTdGF0dXMSGgoWS0VZX1NUQVRVU19VTlNQRUNJRklFRBAAEhUKEUtFWV9TVEFUVVNfQUNUSVZFEAESFgoSS0VZX1NUQVRVU19ST1RBVEVEEAIqlAEKB0tleU1vZGUSGAoUS0VZX01PREVfVU5TUEVDSUZJRUQQABIcChhLRVlfTU9ERV9DT05GSUdfUk9PVF9LRVkQARIeChpLRVlfTU9ERV9QUk9WSURFUl9ST09UX0tFWRACEhMKD0tFWV9NT0RFX1JFTU9URRADEhwKGEtFWV9NT0RFX1BVQkxJQ19LRVlfT05MWRAEQnYKEWNvbS52aXJ0cnUucG9saWN5QgxPYmplY3RzUHJvdG9QAaICA1ZQWKoCDVZpcnRydS5Qb2xpY3nKAg1WaXJ0cnVcUG9saWN54gIZVmlydHJ1XFBvbGljeVxHUEJNZXRhZGF0YeoCDlZpcnRydTo6UG9saWN5YgZwcm90bzM", [file_buf_validate_validate, file_virtru_common_common]);
11
+ /**
12
+ * Describes the message virtru.policy.Certificate.
13
+ * Use `create(CertificateSchema)` to create a new message.
14
+ */
15
+ export const CertificateSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_objects, 0);
16
+ /**
17
+ * Describes the message virtru.policy.CertificateMapping.
18
+ * Use `create(CertificateMappingSchema)` to create a new message.
19
+ */
20
+ export const CertificateMappingSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_objects, 1);
21
+ /**
22
+ * @generated from enum virtru.policy.Algorithm
23
+ */
24
+ export var Algorithm;
25
+ (function (Algorithm) {
26
+ /**
27
+ * @generated from enum value: ALGORITHM_UNSPECIFIED = 0;
28
+ */
29
+ Algorithm[Algorithm["UNSPECIFIED"] = 0] = "UNSPECIFIED";
30
+ /**
31
+ * @generated from enum value: ALGORITHM_RSA_2048 = 1;
32
+ */
33
+ Algorithm[Algorithm["RSA_2048"] = 1] = "RSA_2048";
34
+ /**
35
+ * @generated from enum value: ALGORITHM_RSA_4096 = 2;
36
+ */
37
+ Algorithm[Algorithm["RSA_4096"] = 2] = "RSA_4096";
38
+ /**
39
+ * @generated from enum value: ALGORITHM_EC_P256 = 3;
40
+ */
41
+ Algorithm[Algorithm["EC_P256"] = 3] = "EC_P256";
42
+ /**
43
+ * @generated from enum value: ALGORITHM_EC_P384 = 4;
44
+ */
45
+ Algorithm[Algorithm["EC_P384"] = 4] = "EC_P384";
46
+ /**
47
+ * @generated from enum value: ALGORITHM_EC_P521 = 5;
48
+ */
49
+ Algorithm[Algorithm["EC_P521"] = 5] = "EC_P521";
50
+ })(Algorithm || (Algorithm = {}));
51
+ /**
52
+ * Describes the enum virtru.policy.Algorithm.
53
+ */
54
+ export const AlgorithmSchema = /*@__PURE__*/ enumDesc(file_virtru_policy_objects, 0);
55
+ /**
56
+ * @generated from enum virtru.policy.KeyStatus
57
+ */
58
+ export var KeyStatus;
59
+ (function (KeyStatus) {
60
+ /**
61
+ * @generated from enum value: KEY_STATUS_UNSPECIFIED = 0;
62
+ */
63
+ KeyStatus[KeyStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
64
+ /**
65
+ * @generated from enum value: KEY_STATUS_ACTIVE = 1;
66
+ */
67
+ KeyStatus[KeyStatus["ACTIVE"] = 1] = "ACTIVE";
68
+ /**
69
+ * @generated from enum value: KEY_STATUS_ROTATED = 2;
70
+ */
71
+ KeyStatus[KeyStatus["ROTATED"] = 2] = "ROTATED";
72
+ })(KeyStatus || (KeyStatus = {}));
73
+ /**
74
+ * Describes the enum virtru.policy.KeyStatus.
75
+ */
76
+ export const KeyStatusSchema = /*@__PURE__*/ enumDesc(file_virtru_policy_objects, 1);
77
+ /**
78
+ * Describes the management and operational mode of a cryptographic key.
79
+ *
80
+ * @generated from enum virtru.policy.KeyMode
81
+ */
82
+ export var KeyMode;
83
+ (function (KeyMode) {
84
+ /**
85
+ * KEY_MODE_UNSPECIFIED: Default, unspecified key mode. Indicates an uninitialized or error state.
86
+ *
87
+ * @generated from enum value: KEY_MODE_UNSPECIFIED = 0;
88
+ */
89
+ KeyMode[KeyMode["UNSPECIFIED"] = 0] = "UNSPECIFIED";
90
+ /**
91
+ * KEY_MODE_CONFIG_ROOT_KEY: Local key management where the private key is wrapped by a Key Encryption Key (KEK)
92
+ * sourced from local configuration. Unwrapping and all cryptographic operations are performed locally.
93
+ *
94
+ * @generated from enum value: KEY_MODE_CONFIG_ROOT_KEY = 1;
95
+ */
96
+ KeyMode[KeyMode["CONFIG_ROOT_KEY"] = 1] = "CONFIG_ROOT_KEY";
97
+ /**
98
+ * KEY_MODE_PROVIDER_ROOT_KEY: Local key management where the private key is wrapped by a Key Encryption Key (KEK)
99
+ * managed by an external provider (e.g., a Hardware Security Module or Cloud KMS).
100
+ * Key unwrapping is delegated to the external provider; subsequent cryptographic operations
101
+ * are performed locally using the unwrapped key.
102
+ *
103
+ * @generated from enum value: KEY_MODE_PROVIDER_ROOT_KEY = 2;
104
+ */
105
+ KeyMode[KeyMode["PROVIDER_ROOT_KEY"] = 2] = "PROVIDER_ROOT_KEY";
106
+ /**
107
+ * KEY_MODE_REMOTE: Remote key management where the private key is stored in, and all cryptographic
108
+ * operations are performed by, a remote Key Management Service (KMS) or HSM.
109
+ * The private key material never leaves the secure boundary of the remote system.
110
+ *
111
+ * @generated from enum value: KEY_MODE_REMOTE = 3;
112
+ */
113
+ KeyMode[KeyMode["REMOTE"] = 3] = "REMOTE";
114
+ /**
115
+ * KEY_MODE_PUBLIC_KEY_ONLY: Public key only mode. Used when only a public key is available or required,
116
+ * typically for wrapping operations (e.g., encrypting a Data Encryption Key (DEK) for an external KAS).
117
+ * The corresponding private key is not managed or accessible by this system.
118
+ *
119
+ * @generated from enum value: KEY_MODE_PUBLIC_KEY_ONLY = 4;
120
+ */
121
+ KeyMode[KeyMode["PUBLIC_KEY_ONLY"] = 4] = "PUBLIC_KEY_ONLY";
122
+ })(KeyMode || (KeyMode = {}));
123
+ /**
124
+ * Describes the enum virtru.policy.KeyMode.
125
+ */
126
+ export const KeyModeSchema = /*@__PURE__*/ enumDesc(file_virtru_policy_objects, 2);
@@ -7,7 +7,7 @@ export { platformConnect as dspConnect, platformConnectWeb as dspConnectWeb, } f
7
7
  */
8
8
  export { type DSPClientServicesV1 as DSPServicesV1, type DSPClientServicesV2 as DSPServicesV2, type DSPClientOptions, DSPClient, } from './lib/client';
9
9
  export { PlatformClient } from '@opentdf/sdk/platform';
10
- export { createAuthInterceptor, type Interceptor } from './lib/utils';
10
+ export { createAuthInterceptor, type Interceptor, createAuthProvider, createOpenTDFClient, getObligations, getUserEntitlements, flattenObligations, getTrustedCertificates, validateJWSCertificateChain, type JWSValidationResult, type ObligationFeatureMap, type SupportedObligations, type GetUserEntitlementsResponse, } from './lib/utils';
11
11
  /**
12
12
  * Exports the DSP wrapper of OpenTDF
13
13
  */
@@ -18,4 +18,3 @@ export { DSP, createDSP } from './lib/dsp';
18
18
  export { version, clientType, tdfSpecVersion, type DecoratedStream, type CreateZTDFOptions, } from '@opentdf/sdk';
19
19
  export { AuthProviders, type AuthProvider } from '@opentdf/sdk';
20
20
  export * as singlecontainer from '@opentdf/sdk/singlecontainer';
21
- export * as nano from '@opentdf/sdk/nano';
package/dist/src/index.js CHANGED
@@ -12,7 +12,7 @@ export { platformConnect as dspConnect, platformConnectWeb as dspConnectWeb, } f
12
12
  */
13
13
  export { DSPClient, } from './lib/client';
14
14
  export { PlatformClient } from '@opentdf/sdk/platform';
15
- export { createAuthInterceptor } from './lib/utils';
15
+ export { createAuthInterceptor, createAuthProvider, createOpenTDFClient, getObligations, getUserEntitlements, flattenObligations, getTrustedCertificates, validateJWSCertificateChain, } from './lib/utils';
16
16
  /**
17
17
  * Exports the DSP wrapper of OpenTDF
18
18
  */
@@ -25,4 +25,3 @@ export { version, clientType, tdfSpecVersion, } from '@opentdf/sdk';
25
25
  // TODO: remove this export once the SDK is updated to deprecate the AuthProvider
26
26
  export { AuthProviders } from '@opentdf/sdk';
27
27
  export * as singlecontainer from '@opentdf/sdk/singlecontainer';
28
- export * as nano from '@opentdf/sdk/nano';
@@ -5,11 +5,13 @@ import { PolicyArtifactService } from '../gen/policyimportexport/v1/policy_impor
5
5
  import { SharedService } from '../gen/shared/v1/shared_pb';
6
6
  import { TaggingPDPService } from '../gen/tagging/pdp/v2/tagging_pb';
7
7
  import { VersionService } from '../gen/version/v1/version_pb';
8
+ import { CertificateService } from '../gen/virtru/policy/certificates/v1/certificates_pb';
8
9
  export interface DSPClientServicesV1 {
9
10
  configService: Client<typeof ConfigService>;
10
11
  policyArtifactService: Client<typeof PolicyArtifactService>;
11
12
  sharedService: Client<typeof SharedService>;
12
13
  versionService: Client<typeof VersionService>;
14
+ certificateService: Client<typeof CertificateService>;
13
15
  }
14
16
  export interface DSPClientServicesV2 {
15
17
  taggingPDPService: Client<typeof TaggingPDPService>;
@@ -10,6 +10,7 @@ import { PolicyArtifactService } from '../gen/policyimportexport/v1/policy_impor
10
10
  import { SharedService } from '../gen/shared/v1/shared_pb';
11
11
  import { TaggingPDPService } from '../gen/tagging/pdp/v2/tagging_pb';
12
12
  import { VersionService } from '../gen/version/v1/version_pb';
13
+ import { CertificateService } from '../gen/virtru/policy/certificates/v1/certificates_pb';
13
14
  import { createAuthInterceptor } from './utils';
14
15
  /**
15
16
  * A client for interacting with the DSP using the Connect RPC framework.
@@ -52,6 +53,7 @@ export class DSPClient {
52
53
  policyArtifactService: createClient(PolicyArtifactService, transport),
53
54
  sharedService: createClient(SharedService, transport),
54
55
  versionService: createClient(VersionService, transport),
56
+ certificateService: createClient(CertificateService, transport),
55
57
  };
56
58
  this.v2 = {
57
59
  taggingPDPService: createClient(TaggingPDPService, transport),
@@ -0,0 +1,2 @@
1
+ export declare const MAX_CERTS = 10;
2
+ export declare const MAX_CERT_BYTES: number;
@@ -0,0 +1,7 @@
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
+ export const MAX_CERTS = 10; // reasonable upper bound for chain depth
7
+ export const MAX_CERT_BYTES = 64 * 1024; // 64KB per certificate