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