@treeseed/sdk 0.13.0-rc.85 → 0.13.0-rc.87
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/dist/.treeseed-build-complete.json +1 -1
- package/dist/configuration/secrets-capability.d.ts +2 -2
- package/dist/configuration/secrets-capability.js +2 -2
- package/dist/content/validation/content-model-schemas.d.ts +1 -1
- package/dist/deployment/hosted-topology-template.d.ts +6 -6
- package/dist/deployment/hosted-topology-template.js +1 -1
- package/dist/deployment/hosted-topology.d.ts +73 -214
- package/dist/deployment/hosted-topology.js +30 -64
- package/dist/operator-contracts/canonical-command-tree.js +2 -2
- package/dist/operator-contracts/catalog/hosted-topology-operations.d.ts +4 -31
- package/dist/operator-contracts/catalog/hosted-topology-operations.js +7 -12
- package/dist/operator-contracts/catalog/services/secret-operations.d.ts +62 -0
- package/dist/operator-contracts/catalog/services/secret-operations.js +51 -0
- package/dist/operator-contracts/control-plane-operations.d.ts +61 -48
- package/dist/operator-contracts/control-plane-operations.js +3 -4
- package/dist/secrets-capability/github-actions-encryption.d.ts +2 -0
- package/dist/secrets-capability/github-actions-encryption.js +11 -0
- package/dist/secrets-capability/provider-operation-contracts.d.ts +1 -1
- package/dist/secrets-capability/secret-contracts.d.ts +33 -0
- package/dist/secrets-capability/secret-contracts.js +49 -0
- package/dist/secrets-capability/service-provider-contracts.d.ts +2 -2
- package/dist/secrets-capability/service-provider-contracts.js +15 -31
- package/package.json +1 -1
- package/dist/operator-contracts/catalog/services/service-vault-operations.d.ts +0 -17
- package/dist/operator-contracts/catalog/services/service-vault-operations.js +0 -158
- package/dist/secrets-capability/service-vault-contracts.d.ts +0 -108
- package/dist/secrets-capability/service-vault-contracts.js +0 -74
- package/dist/secrets-capability/service-vault-crypto.d.ts +0 -20
- package/dist/secrets-capability/service-vault-crypto.js +0 -210
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import sodium from "libsodium-wrappers-sumo";
|
|
2
|
+
async function encryptGitHubActionsSecret(value, providerPublicKey) {
|
|
3
|
+
await sodium.ready;
|
|
4
|
+
if (!value) throw new Error("GitHub Actions secret value is required.");
|
|
5
|
+
const key = sodium.from_base64(providerPublicKey, sodium.base64_variants.ORIGINAL);
|
|
6
|
+
if (key.length !== sodium.crypto_box_PUBLICKEYBYTES) throw new Error("Invalid GitHub public key.");
|
|
7
|
+
return sodium.to_base64(sodium.crypto_box_seal(value, key), sodium.base64_variants.ORIGINAL);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
encryptGitHubActionsSecret
|
|
11
|
+
};
|
|
@@ -9,7 +9,7 @@ export type ProviderCredentialAuthority = {
|
|
|
9
9
|
scheme: CredentialAuthorityScheme;
|
|
10
10
|
reference: string;
|
|
11
11
|
capabilities: ServiceCapabilityType[];
|
|
12
|
-
status: 'ready' | '
|
|
12
|
+
status: 'ready' | 'reauthorization-required' | 'revoked';
|
|
13
13
|
version: number;
|
|
14
14
|
};
|
|
15
15
|
export type ProjectRemoteRepositoryBinding = {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const secretScopeSchema: z.ZodObject<{
|
|
3
|
+
team: z.ZodString;
|
|
4
|
+
project: z.ZodString;
|
|
5
|
+
environment: z.ZodString;
|
|
6
|
+
purpose: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
project: string;
|
|
10
|
+
name: string;
|
|
11
|
+
team: string;
|
|
12
|
+
purpose: string;
|
|
13
|
+
environment: string;
|
|
14
|
+
}, {
|
|
15
|
+
project: string;
|
|
16
|
+
name: string;
|
|
17
|
+
team: string;
|
|
18
|
+
purpose: string;
|
|
19
|
+
environment: string;
|
|
20
|
+
}>;
|
|
21
|
+
export type SecretScope = z.infer<typeof secretScopeSchema>;
|
|
22
|
+
export declare const SECRET_CUSTODY_BACKENDS: readonly ["openbao", "os"];
|
|
23
|
+
export declare function canonicalSecretPath(input: SecretScope): string;
|
|
24
|
+
export type HostedSecretOperationBinding = {
|
|
25
|
+
subjectType: 'declaration' | 'plan' | 'rollback';
|
|
26
|
+
subjectDigest: string;
|
|
27
|
+
deploymentId: string;
|
|
28
|
+
stackId: string;
|
|
29
|
+
environment: 'staging' | 'production';
|
|
30
|
+
};
|
|
31
|
+
export declare function containsForbiddenPlaintextSecretMaterial(value: unknown, path?: string): string[];
|
|
32
|
+
export declare function canonicalHostedSecretOperationBinding(input: HostedSecretOperationBinding): string;
|
|
33
|
+
export declare function validateHostedSecretOperationBinding(value: unknown): value is HostedSecretOperationBinding;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const segment = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/u);
|
|
3
|
+
const secretScopeSchema = z.object({
|
|
4
|
+
team: segment,
|
|
5
|
+
project: segment,
|
|
6
|
+
environment: segment,
|
|
7
|
+
purpose: segment,
|
|
8
|
+
name: segment
|
|
9
|
+
}).strict();
|
|
10
|
+
const SECRET_CUSTODY_BACKENDS = ["openbao", "os"];
|
|
11
|
+
function canonicalSecretPath(input) {
|
|
12
|
+
const s = secretScopeSchema.parse(input);
|
|
13
|
+
return `teams/${s.team}/projects/${s.project}/environments/${s.environment}/purposes/${s.purpose}/secrets/${s.name}`;
|
|
14
|
+
}
|
|
15
|
+
const FORBIDDEN_SECRET_KEYS = /(?:passphrase|password|plaintext|derivedKey|privateKey|apiToken|accessToken|secretValue|credentialValue)$/iu;
|
|
16
|
+
function containsForbiddenPlaintextSecretMaterial(value, path = "") {
|
|
17
|
+
if (!value || typeof value !== "object") return [];
|
|
18
|
+
const failures = [];
|
|
19
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
20
|
+
const nextPath = path ? `${path}.${key}` : key;
|
|
21
|
+
if (FORBIDDEN_SECRET_KEYS.test(key) && typeof entry === "string" && entry.trim()) failures.push(nextPath);
|
|
22
|
+
if (entry && typeof entry === "object") failures.push(...containsForbiddenPlaintextSecretMaterial(entry, nextPath));
|
|
23
|
+
}
|
|
24
|
+
return failures;
|
|
25
|
+
}
|
|
26
|
+
const digest = /^sha256:[a-f0-9]{64}$/u;
|
|
27
|
+
const identifier = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;
|
|
28
|
+
function canonicalHostedSecretOperationBinding(input) {
|
|
29
|
+
return JSON.stringify({
|
|
30
|
+
subjectType: input.subjectType,
|
|
31
|
+
subjectDigest: input.subjectDigest,
|
|
32
|
+
deploymentId: input.deploymentId,
|
|
33
|
+
stackId: input.stackId,
|
|
34
|
+
environment: input.environment
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function validateHostedSecretOperationBinding(value) {
|
|
38
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
39
|
+
const binding = value;
|
|
40
|
+
return ["declaration", "plan", "rollback"].includes(String(binding.subjectType)) && digest.test(String(binding.subjectDigest)) && identifier.test(String(binding.deploymentId)) && identifier.test(String(binding.stackId)) && ["staging", "production"].includes(String(binding.environment));
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
SECRET_CUSTODY_BACKENDS,
|
|
44
|
+
canonicalHostedSecretOperationBinding,
|
|
45
|
+
canonicalSecretPath,
|
|
46
|
+
containsForbiddenPlaintextSecretMaterial,
|
|
47
|
+
secretScopeSchema,
|
|
48
|
+
validateHostedSecretOperationBinding
|
|
49
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SERVICE_PROVIDER_IDS: readonly ["github", "cloudflare", "railway"
|
|
1
|
+
export declare const SERVICE_PROVIDER_IDS: readonly ["github", "cloudflare", "railway"];
|
|
2
2
|
export declare const SERVICE_CAPABILITY_TYPES: readonly ["repository-hosting", "workflow-execution", "workflow-configuration", "secret-enclave", "frontend-hosting", "backend-hosting", "dns-management", "object-storage", "state-encryption", "database-hosting", "capacity-runtime-hosting", "private-knowledge-index-hosting", "artifact-hosting"];
|
|
3
3
|
export declare const SERVICE_CONNECTION_STATUSES: readonly ["draft", "active", "degraded", "validation-failed", "reentry-required", "reauthorization-required", "disconnected"];
|
|
4
4
|
export declare const SERVICE_CAPABILITY_STATUSES: readonly ["configured", "disabled", "blocked", "planned"];
|
|
@@ -27,7 +27,7 @@ export type CredentialProfileDefinition = {
|
|
|
27
27
|
authoritySchemes?: CredentialAuthorityScheme[];
|
|
28
28
|
knowledgePageIds: string[];
|
|
29
29
|
};
|
|
30
|
-
export declare const CREDENTIAL_AUTHORITY_SCHEMES: readonly ["app-installation", "
|
|
30
|
+
export declare const CREDENTIAL_AUTHORITY_SCHEMES: readonly ["app-installation", "openbao"];
|
|
31
31
|
export type CredentialAuthorityScheme = (typeof CREDENTIAL_AUTHORITY_SCHEMES)[number];
|
|
32
32
|
export type ServiceCapabilityDefinition = {
|
|
33
33
|
type: ServiceCapabilityType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const SERVICE_PROVIDER_IDS = ["github", "cloudflare", "railway"
|
|
1
|
+
const SERVICE_PROVIDER_IDS = ["github", "cloudflare", "railway"];
|
|
2
2
|
const SERVICE_CAPABILITY_TYPES = [
|
|
3
3
|
"repository-hosting",
|
|
4
4
|
"workflow-execution",
|
|
@@ -26,12 +26,7 @@ const SERVICE_CONNECTION_STATUSES = [
|
|
|
26
26
|
const SERVICE_CAPABILITY_STATUSES = ["configured", "disabled", "blocked", "planned"];
|
|
27
27
|
const CREDENTIAL_AUTHORITY_SCHEMES = [
|
|
28
28
|
"app-installation",
|
|
29
|
-
"
|
|
30
|
-
"oauth-token",
|
|
31
|
-
"environment-reference",
|
|
32
|
-
"client-encrypted",
|
|
33
|
-
"external-vault",
|
|
34
|
-
"workload-identity"
|
|
29
|
+
"openbao"
|
|
35
30
|
];
|
|
36
31
|
const field = (key, label, description, required = true, sensitive = false) => ({
|
|
37
32
|
key,
|
|
@@ -76,11 +71,11 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
76
71
|
label: "Repository token authority",
|
|
77
72
|
description: "Fine-grained token authority restricted to selected repositories and Contents access.",
|
|
78
73
|
capabilities: ["repository-hosting"],
|
|
79
|
-
fields: [field("accessToken", "Fine-grained token", "
|
|
74
|
+
fields: [field("accessToken", "Fine-grained token", "Stored in core OpenBao; used only by authorized operations.", true, true)],
|
|
80
75
|
permissions: ["Metadata: read", "Contents: read and write"],
|
|
81
76
|
sharing: "capability-scoped",
|
|
82
|
-
unattendedCompatible:
|
|
83
|
-
authoritySchemes: ["
|
|
77
|
+
unattendedCompatible: true,
|
|
78
|
+
authoritySchemes: ["openbao"],
|
|
84
79
|
knowledgePageIds: ["provider.github", "services.credentials", "vault.rotation"]
|
|
85
80
|
},
|
|
86
81
|
{
|
|
@@ -100,11 +95,11 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
100
95
|
label: "Workflow token authority",
|
|
101
96
|
description: "Fine-grained token authority for Actions and explicitly enabled secret or variable scopes.",
|
|
102
97
|
capabilities: ["workflow-execution", "workflow-configuration", "secret-enclave"],
|
|
103
|
-
fields: [field("accessToken", "Fine-grained token", "
|
|
98
|
+
fields: [field("accessToken", "Fine-grained token", "Stored in core OpenBao; used only by authorized operations.", true, true)],
|
|
104
99
|
permissions: ["Metadata: read", "Contents: read", "Actions: read and write", "Secrets: read and write", "Variables: read and write"],
|
|
105
100
|
sharing: "capability-scoped",
|
|
106
|
-
unattendedCompatible:
|
|
107
|
-
authoritySchemes: ["
|
|
101
|
+
unattendedCompatible: true,
|
|
102
|
+
authoritySchemes: ["openbao"],
|
|
108
103
|
knowledgePageIds: ["provider.github", "services.credentials", "vault.rotation"]
|
|
109
104
|
}
|
|
110
105
|
]
|
|
@@ -132,11 +127,11 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
132
127
|
{ type: "state-encryption", label: "State encryption", description: "Independent encryption authority for OpenTofu state and plan files.", credentialProfileIds: ["opentofu-state-encryption"], status: "available" }
|
|
133
128
|
],
|
|
134
129
|
credentialProfiles: [
|
|
135
|
-
{ id: "cloudflare-runtime", label: "Pages and Workers token", description: "A token limited to application deployment resources.", capabilities: ["frontend-hosting"], fields: [field("apiToken", "API token", "
|
|
136
|
-
{ id: "cloudflare-dns", label: "DNS token", description: "A token restricted to selected zones.", capabilities: ["dns-management"], fields: [field("apiToken", "DNS API token", "Encrypted separately from deployment authority.", true, true)], permissions: ["Zone: DNS Edit for only the managed zones"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["
|
|
137
|
-
{ id: "cloudflare-storage", label: "Storage management authority", description: "Vault-custodied token used only to reconcile authorized R2 resources.", capabilities: ["object-storage"], fields: [field("apiToken", "Storage API token", "Encrypted separately and used only to reconcile authorized R2 resources.", true, true)], permissions: ["Account: Workers R2 Storage Edit"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["
|
|
138
|
-
{ id: "s3-state-session", label: "OpenTofu state session", description: "S3-compatible credentials limited to the selected team state prefix.", capabilities: ["object-storage"], fields: [field("accessKeyId", "R2 access key ID", "Vault-custodied S3-compatible access key identifier for encrypted OpenTofu state.", true, true), field("secretAccessKey", "R2 secret access key", "Vault-custodied S3-compatible secret key for encrypted OpenTofu state.", true, true), field("sessionToken", "R2 session token", "Optional short-lived S3-compatible session token.", false, true)], permissions: ["Object read and write for only the managed team state prefix"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["
|
|
139
|
-
{ id: "opentofu-state-encryption", label: "OpenTofu state encryption", description: "Independent encryption material that is never stored with the R2 state object.", capabilities: ["state-encryption"], fields: [field("stateEncryptionKey", "OpenTofu state encryption key", "
|
|
130
|
+
{ id: "cloudflare-runtime", label: "Pages and Workers token", description: "A token limited to application deployment resources.", capabilities: ["frontend-hosting"], fields: [field("apiToken", "API token", "Stored in core OpenBao and used only by authorized operations.", true, true)], permissions: ["Account: Workers Scripts Edit", "Account: Pages Edit"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] },
|
|
131
|
+
{ id: "cloudflare-dns", label: "DNS token", description: "A token restricted to selected zones.", capabilities: ["dns-management"], fields: [field("apiToken", "DNS API token", "Encrypted separately from deployment authority.", true, true)], permissions: ["Zone: DNS Edit for only the managed zones"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] },
|
|
132
|
+
{ id: "cloudflare-storage", label: "Storage management authority", description: "Vault-custodied token used only to reconcile authorized R2 resources.", capabilities: ["object-storage"], fields: [field("apiToken", "Storage API token", "Encrypted separately and used only to reconcile authorized R2 resources.", true, true)], permissions: ["Account: Workers R2 Storage Edit"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] },
|
|
133
|
+
{ id: "s3-state-session", label: "OpenTofu state session", description: "S3-compatible credentials limited to the selected team state prefix.", capabilities: ["object-storage"], fields: [field("accessKeyId", "R2 access key ID", "Vault-custodied S3-compatible access key identifier for encrypted OpenTofu state.", true, true), field("secretAccessKey", "R2 secret access key", "Vault-custodied S3-compatible secret key for encrypted OpenTofu state.", true, true), field("sessionToken", "R2 session token", "Optional short-lived S3-compatible session token.", false, true)], permissions: ["Object read and write for only the managed team state prefix"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] },
|
|
134
|
+
{ id: "opentofu-state-encryption", label: "OpenTofu state encryption", description: "Independent encryption material that is never stored with the R2 state object.", capabilities: ["state-encryption"], fields: [field("stateEncryptionKey", "OpenTofu state encryption key", "A 32-byte hexadecimal key stored separately in core OpenBao.", true, true)], permissions: ["Encrypt and decrypt only the selected team OpenTofu state"], sharing: "capability-scoped", unattendedCompatible: true, authoritySchemes: ["openbao"], knowledgePageIds: ["provider.cloudflare", "services.credentials", "vault.rotation"] }
|
|
140
135
|
]
|
|
141
136
|
},
|
|
142
137
|
{
|
|
@@ -163,24 +158,13 @@ const SERVICE_PROVIDER_CATALOG = [
|
|
|
163
158
|
label: "Railway workspace token",
|
|
164
159
|
description: "Railway currently exposes broad workspace authority. Sharing it increases the blast radius across enabled capabilities.",
|
|
165
160
|
capabilities: ["backend-hosting", "database-hosting", "capacity-runtime-hosting", "private-knowledge-index-hosting"],
|
|
166
|
-
fields: [field("apiToken", "Workspace token", "
|
|
161
|
+
fields: [field("apiToken", "Workspace token", "Stored in core OpenBao and used only by authorized operations.", true, true)],
|
|
167
162
|
permissions: ["Workspace access required by the selected operations"],
|
|
168
163
|
sharing: "provider-shared",
|
|
169
164
|
unattendedCompatible: true,
|
|
170
|
-
authoritySchemes: ["
|
|
165
|
+
authoritySchemes: ["openbao"],
|
|
171
166
|
knowledgePageIds: ["provider.railway", "services.credentials", "vault.rotation"]
|
|
172
167
|
}]
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
id: "openbao",
|
|
176
|
-
label: "OpenBao / HashiCorp Vault",
|
|
177
|
-
logoKey: "vault",
|
|
178
|
-
documentationUrl: "https://openbao.org/docs/auth/jwt/",
|
|
179
|
-
description: "Reference an external vault through workload identity; no long-lived vault token is stored.",
|
|
180
|
-
knowledgePageIds: ["provider.openbao", "services.external-vault"],
|
|
181
|
-
connectionFields: [field("address", "Vault address", "The HTTPS endpoint for the vault."), field("mount", "Secrets mount", "The mount containing TreeSeed-managed references."), field("role", "Workload identity role", "The OIDC/JWT role used by the operations runner.")],
|
|
182
|
-
capabilities: [{ type: "secret-enclave", label: "External secret vault", description: "Resolve approved secret references through workload identity.", credentialProfileIds: [], status: "available" }],
|
|
183
|
-
credentialProfiles: []
|
|
184
168
|
}
|
|
185
169
|
];
|
|
186
170
|
function getServiceProviderDefinition(providerId) {
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const SERVICE_VAULT_OPERATIONS: {
|
|
2
|
-
readonly userVaultKey: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
3
|
-
readonly putUserVaultKey: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
4
|
-
readonly teamVault: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
5
|
-
readonly initializeTeamVault: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
6
|
-
readonly resetTeamVault: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
7
|
-
readonly rotateTeamVault: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
8
|
-
readonly vaultGrantCandidates: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
9
|
-
readonly createVaultGrant: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
10
|
-
readonly deleteVaultGrant: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
11
|
-
readonly vaultCredentialEnvelopes: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
12
|
-
readonly credentialEnvelopes: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
13
|
-
readonly putCredentialEnvelope: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
14
|
-
readonly createOperationLease: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
15
|
-
readonly operationLease: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
16
|
-
readonly putOperationLeasePayload: import("../../control-plane-operation.js").ControlPlaneOperationBinding<any, {}, any, any>;
|
|
17
|
-
};
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { defineOperation } from "../../operation-builder.js";
|
|
3
|
-
const empty = z.object({}).strict();
|
|
4
|
-
const none = z.undefined();
|
|
5
|
-
const record = z.record(z.unknown());
|
|
6
|
-
const teamPath = z.object({ teamId: z.string().min(1) }).strict();
|
|
7
|
-
function vaultOperation(operationId, method, path, pathSchema, options = {}) {
|
|
8
|
-
const read = method === "GET", risk = options.risk ?? "ordinary";
|
|
9
|
-
return defineOperation({
|
|
10
|
-
operationId,
|
|
11
|
-
description: `${read ? "Read" : "Apply"} ${operationId}.`,
|
|
12
|
-
rest: { method, path },
|
|
13
|
-
capability: read ? "secrets.read" : "secrets.write",
|
|
14
|
-
...path.includes("{") ? { parameters: `treeseed.${operationId}.parameters/v1` } : {},
|
|
15
|
-
authentication: "oauth",
|
|
16
|
-
oauthScopes: read ? ["treeseed:read"] : ["treeseed:projects:write"],
|
|
17
|
-
kind: read ? "read" : "mutation",
|
|
18
|
-
riskClass: risk,
|
|
19
|
-
confirmation: risk === "ordinary" ? "never" : "input_required",
|
|
20
|
-
surfaces: ["rest"],
|
|
21
|
-
cacheScope: read ? "principal" : "none",
|
|
22
|
-
pagination: "none",
|
|
23
|
-
redactedPaths: options.redactedPaths
|
|
24
|
-
}, { path: pathSchema, query: read ? record : empty, body: read ? none : options.body ?? record, output: options.output ?? record });
|
|
25
|
-
}
|
|
26
|
-
const nullableRecord = record.nullable(), records = z.array(record);
|
|
27
|
-
const encryptedPrivateKeyEnvelope = z.object({
|
|
28
|
-
version: z.literal("service-vault-v1"),
|
|
29
|
-
algorithm: z.literal("xchacha20-poly1305-ietf"),
|
|
30
|
-
kdf: z.object({ algorithm: z.literal("argon2id"), opsLimit: z.number().int().positive(), memLimit: z.number().int().positive(), salt: z.string().min(1) }).strict(),
|
|
31
|
-
nonce: z.string().min(1),
|
|
32
|
-
ciphertext: z.string().min(1),
|
|
33
|
-
publicKey: z.string().min(1)
|
|
34
|
-
}).strict();
|
|
35
|
-
const encryptedCredentialEnvelope = z.object({
|
|
36
|
-
version: z.literal("service-vault-v1"),
|
|
37
|
-
algorithm: z.literal("xchacha20-poly1305-ietf"),
|
|
38
|
-
ciphertext: z.string().min(1),
|
|
39
|
-
nonce: z.string().min(1),
|
|
40
|
-
wrappedKey: z.string().min(1),
|
|
41
|
-
wrappedKeyNonce: z.string().min(1),
|
|
42
|
-
associatedData: z.string().min(1),
|
|
43
|
-
associatedDataDigest: z.string().min(1),
|
|
44
|
-
fingerprint: z.string().min(1)
|
|
45
|
-
}).strict();
|
|
46
|
-
const SERVICE_VAULT_OPERATIONS = {
|
|
47
|
-
userVaultKey: vaultOperation("services.vault.user.key.show", "GET", "/v1/users/me/vault-key", empty, { output: nullableRecord }),
|
|
48
|
-
putUserVaultKey: vaultOperation(
|
|
49
|
-
"services.vault.user.key.put",
|
|
50
|
-
"PUT",
|
|
51
|
-
"/v1/users/me/vault-key",
|
|
52
|
-
empty,
|
|
53
|
-
{ risk: "credential", redactedPaths: ["body.encryptedPrivateKeyEnvelope"], body: z.object({ publicKey: z.string().min(1), encryptedPrivateKeyEnvelope }).strict() }
|
|
54
|
-
),
|
|
55
|
-
teamVault: vaultOperation("services.vault.team.show", "GET", "/v1/teams/{teamId}/vault", teamPath, { output: nullableRecord }),
|
|
56
|
-
initializeTeamVault: vaultOperation(
|
|
57
|
-
"services.vault.team.initialize",
|
|
58
|
-
"POST",
|
|
59
|
-
"/v1/teams/{teamId}/vault",
|
|
60
|
-
teamPath,
|
|
61
|
-
{ risk: "credential", redactedPaths: ["body.wrappedTeamVaultKey"], body: z.object({ userVaultKeyId: z.string().min(1), wrappedTeamVaultKey: z.string().min(1), encryptionVersion: z.literal("service-vault-v1") }).strict() }
|
|
62
|
-
),
|
|
63
|
-
resetTeamVault: vaultOperation(
|
|
64
|
-
"services.vault.team.reset",
|
|
65
|
-
"POST",
|
|
66
|
-
"/v1/teams/{teamId}/vault/reset",
|
|
67
|
-
teamPath,
|
|
68
|
-
{ risk: "destructive", redactedPaths: ["body.wrappedTeamVaultKey", "body.currentPassword"], body: z.object({ userVaultKeyId: z.string().min(1), wrappedTeamVaultKey: z.string().min(1), encryptionVersion: z.literal("service-vault-v1"), confirmation: z.string().min(1), currentPassword: z.string().min(1) }).strict() }
|
|
69
|
-
),
|
|
70
|
-
rotateTeamVault: vaultOperation(
|
|
71
|
-
"services.vault.team.rotate",
|
|
72
|
-
"POST",
|
|
73
|
-
"/v1/teams/{teamId}/vault/rotate",
|
|
74
|
-
teamPath,
|
|
75
|
-
{ risk: "credential", redactedPaths: ["body.envelopes", "body.grants"], body: z.object({
|
|
76
|
-
expectedKeyVersion: z.number().int().positive(),
|
|
77
|
-
envelopes: z.array(z.object({ id: z.string().min(1), envelope: encryptedCredentialEnvelope }).strict()),
|
|
78
|
-
grants: z.array(z.object({ userId: z.string().min(1), userVaultKeyId: z.string().min(1), wrappedTeamVaultKey: z.string().min(1) }).strict()).min(1)
|
|
79
|
-
}).strict() }
|
|
80
|
-
),
|
|
81
|
-
vaultGrantCandidates: vaultOperation("services.vault.grant.candidates.list", "GET", "/v1/teams/{teamId}/vault/grant-candidates", teamPath, { output: records }),
|
|
82
|
-
createVaultGrant: vaultOperation(
|
|
83
|
-
"services.vault.grants.create",
|
|
84
|
-
"POST",
|
|
85
|
-
"/v1/teams/{teamId}/vault/grants",
|
|
86
|
-
teamPath,
|
|
87
|
-
{ risk: "credential", redactedPaths: ["body.wrappedTeamVaultKey"], body: z.object({ userId: z.string().min(1), userVaultKeyId: z.string().min(1), wrappedTeamVaultKey: z.string().min(1) }).strict() }
|
|
88
|
-
),
|
|
89
|
-
deleteVaultGrant: vaultOperation(
|
|
90
|
-
"services.vault.grants.delete",
|
|
91
|
-
"DELETE",
|
|
92
|
-
"/v1/teams/{teamId}/vault/grants/{grantId}",
|
|
93
|
-
z.object({ teamId: z.string().min(1), grantId: z.string().min(1) }).strict(),
|
|
94
|
-
{ risk: "destructive" }
|
|
95
|
-
),
|
|
96
|
-
vaultCredentialEnvelopes: vaultOperation(
|
|
97
|
-
"services.vault.credential.envelopes.list",
|
|
98
|
-
"GET",
|
|
99
|
-
"/v1/teams/{teamId}/vault/credential-envelopes",
|
|
100
|
-
teamPath,
|
|
101
|
-
{ output: records }
|
|
102
|
-
),
|
|
103
|
-
credentialEnvelopes: vaultOperation(
|
|
104
|
-
"services.credential.envelopes.list",
|
|
105
|
-
"GET",
|
|
106
|
-
"/v1/teams/{teamId}/services/{connectionId}/credential-envelopes",
|
|
107
|
-
z.object({ teamId: z.string().min(1), connectionId: z.string().min(1) }).strict(),
|
|
108
|
-
{ output: records }
|
|
109
|
-
),
|
|
110
|
-
putCredentialEnvelope: vaultOperation(
|
|
111
|
-
"services.credential.envelopes.put",
|
|
112
|
-
"POST",
|
|
113
|
-
"/v1/teams/{teamId}/services/{connectionId}/credential-envelopes",
|
|
114
|
-
z.object({ teamId: z.string().min(1), connectionId: z.string().min(1) }).strict(),
|
|
115
|
-
{ risk: "credential", redactedPaths: ["body.envelope"], body: z.object({ definitionId: z.string().min(1), fieldKey: z.string().min(1), keyVersion: z.number().int().positive(), envelope: encryptedCredentialEnvelope }).strict() }
|
|
116
|
-
),
|
|
117
|
-
createOperationLease: vaultOperation(
|
|
118
|
-
"services.operation.leases.create",
|
|
119
|
-
"POST",
|
|
120
|
-
"/v1/teams/{teamId}/service-operation-leases",
|
|
121
|
-
teamPath,
|
|
122
|
-
{ risk: "authority", body: z.object({
|
|
123
|
-
connectionId: z.string().min(1),
|
|
124
|
-
capabilityType: z.string().min(1),
|
|
125
|
-
credentialProfileId: z.string().min(1),
|
|
126
|
-
purpose: z.enum([
|
|
127
|
-
"provider-connection-validation",
|
|
128
|
-
"remote-git-publication",
|
|
129
|
-
"workflow-dispatch",
|
|
130
|
-
"workflow-configuration",
|
|
131
|
-
"hosted-topology-plan",
|
|
132
|
-
"hosted-topology-apply",
|
|
133
|
-
"hosted-topology-readback",
|
|
134
|
-
"hosted-topology-rollback"
|
|
135
|
-
]),
|
|
136
|
-
idempotencyKey: z.string().min(1).optional(),
|
|
137
|
-
resourceScope: record.optional(),
|
|
138
|
-
hostedBinding: record.optional(),
|
|
139
|
-
authorityRequests: z.array(record).optional()
|
|
140
|
-
}).strict() }
|
|
141
|
-
),
|
|
142
|
-
operationLease: vaultOperation(
|
|
143
|
-
"services.operation.leases.show",
|
|
144
|
-
"GET",
|
|
145
|
-
"/v1/teams/{teamId}/service-operation-leases/{leaseId}",
|
|
146
|
-
z.object({ teamId: z.string().min(1), leaseId: z.string().min(1) }).strict()
|
|
147
|
-
),
|
|
148
|
-
putOperationLeasePayload: vaultOperation(
|
|
149
|
-
"services.operation.leases.payload.put",
|
|
150
|
-
"PUT",
|
|
151
|
-
"/v1/teams/{teamId}/service-operation-leases/{leaseId}/payload",
|
|
152
|
-
z.object({ teamId: z.string().min(1), leaseId: z.string().min(1) }).strict(),
|
|
153
|
-
{ risk: "credential", redactedPaths: ["body.sealedPayload"], body: z.object({ sealedPayload: z.string().min(1) }).strict() }
|
|
154
|
-
)
|
|
155
|
-
};
|
|
156
|
-
export {
|
|
157
|
-
SERVICE_VAULT_OPERATIONS
|
|
158
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
export declare const SERVICE_VAULT_ENCRYPTION_VERSION: "service-vault-v1";
|
|
2
|
-
export declare const SERVICE_VAULT_AEAD_ALGORITHM: "xchacha20-poly1305-ietf";
|
|
3
|
-
export declare const SERVICE_VAULT_KEY_AGREEMENT: "x25519-sealed-box";
|
|
4
|
-
export declare const SERVICE_VAULT_KDF: "argon2id";
|
|
5
|
-
export declare const SECRET_OPERATION_PURPOSES: readonly ["provider-connection-validation", "remote-git-publication", "workflow-dispatch", "workflow-configuration", "hosted-topology-plan", "hosted-topology-apply", "hosted-topology-readback", "hosted-topology-rollback"];
|
|
6
|
-
export type SecretOperationPurpose = (typeof SECRET_OPERATION_PURPOSES)[number];
|
|
7
|
-
export type HostedSecretOperationPurpose = Extract<SecretOperationPurpose, `hosted-topology-${string}`>;
|
|
8
|
-
export type EncryptedCredentialEnvelope = {
|
|
9
|
-
version: typeof SERVICE_VAULT_ENCRYPTION_VERSION;
|
|
10
|
-
algorithm: typeof SERVICE_VAULT_AEAD_ALGORITHM;
|
|
11
|
-
ciphertext: string;
|
|
12
|
-
nonce: string;
|
|
13
|
-
wrappedKey: string;
|
|
14
|
-
wrappedKeyNonce: string;
|
|
15
|
-
associatedData: string;
|
|
16
|
-
associatedDataDigest: string;
|
|
17
|
-
fingerprint: string;
|
|
18
|
-
};
|
|
19
|
-
export type EncryptedPrivateKeyEnvelope = {
|
|
20
|
-
version: typeof SERVICE_VAULT_ENCRYPTION_VERSION;
|
|
21
|
-
algorithm: typeof SERVICE_VAULT_AEAD_ALGORITHM;
|
|
22
|
-
kdf: {
|
|
23
|
-
algorithm: typeof SERVICE_VAULT_KDF;
|
|
24
|
-
opsLimit: number;
|
|
25
|
-
memLimit: number;
|
|
26
|
-
salt: string;
|
|
27
|
-
};
|
|
28
|
-
nonce: string;
|
|
29
|
-
ciphertext: string;
|
|
30
|
-
publicKey: string;
|
|
31
|
-
};
|
|
32
|
-
export type TeamVaultGrantEnvelope = {
|
|
33
|
-
version: typeof SERVICE_VAULT_ENCRYPTION_VERSION;
|
|
34
|
-
algorithm: typeof SERVICE_VAULT_KEY_AGREEMENT;
|
|
35
|
-
recipientPublicKey: string;
|
|
36
|
-
wrappedTeamVaultKey: string;
|
|
37
|
-
};
|
|
38
|
-
export type SecretOperationLease = {
|
|
39
|
-
id: string;
|
|
40
|
-
teamId: string;
|
|
41
|
-
connectionId: string;
|
|
42
|
-
capabilityType: string;
|
|
43
|
-
purpose: SecretOperationPurpose;
|
|
44
|
-
resourceScope: Record<string, string>;
|
|
45
|
-
credentialProfileId: string;
|
|
46
|
-
actorUserId: string;
|
|
47
|
-
requiredFields: string[];
|
|
48
|
-
publicKey: string;
|
|
49
|
-
status: 'awaiting-runner' | 'pending' | 'ready' | 'consumed' | 'expired' | 'cancelled' | 'failed';
|
|
50
|
-
expiresAt: string;
|
|
51
|
-
consumedAt?: string | null;
|
|
52
|
-
operationCorrelationId: string;
|
|
53
|
-
hostedBinding?: HostedSecretOperationBinding;
|
|
54
|
-
authorityRequests?: SecretOperationAuthorityRequest[];
|
|
55
|
-
};
|
|
56
|
-
export type HostedSecretOperationBinding = {
|
|
57
|
-
subjectType: 'declaration' | 'plan' | 'rollback';
|
|
58
|
-
subjectDigest: string;
|
|
59
|
-
deploymentId: string;
|
|
60
|
-
stackId: string;
|
|
61
|
-
environment: 'staging' | 'production';
|
|
62
|
-
};
|
|
63
|
-
export type SecretOperationAuthorityRequest = {
|
|
64
|
-
requestId: string;
|
|
65
|
-
connectionId: string;
|
|
66
|
-
credentialProfileId: string;
|
|
67
|
-
provider: 'cloudflare' | 'railway' | 'treeseed';
|
|
68
|
-
purpose: 'provider' | 'state-backend' | 'state-encryption';
|
|
69
|
-
capabilities: string[];
|
|
70
|
-
requiredFields: string[];
|
|
71
|
-
secretRef?: string;
|
|
72
|
-
};
|
|
73
|
-
export type SealedSecretOperationPayload = {
|
|
74
|
-
schemaVersion: 'treeseed.sealed-secret-operation-payload/v1';
|
|
75
|
-
leaseId: string;
|
|
76
|
-
teamId: string;
|
|
77
|
-
operationCorrelationId: string;
|
|
78
|
-
hostedBinding: HostedSecretOperationBinding;
|
|
79
|
-
algorithm: typeof SERVICE_VAULT_KEY_AGREEMENT;
|
|
80
|
-
ciphertext: string;
|
|
81
|
-
};
|
|
82
|
-
export type SecretOperationCredentialBundle = {
|
|
83
|
-
schemaVersion: 'treeseed.secret-operation-credential-bundle/v1';
|
|
84
|
-
leaseId: string;
|
|
85
|
-
teamId: string;
|
|
86
|
-
operationCorrelationId: string;
|
|
87
|
-
hostedBinding: HostedSecretOperationBinding;
|
|
88
|
-
materials: Array<{
|
|
89
|
-
requestId: string;
|
|
90
|
-
connectionId: string;
|
|
91
|
-
credentialProfileId: string;
|
|
92
|
-
values: Record<string, string>;
|
|
93
|
-
}>;
|
|
94
|
-
};
|
|
95
|
-
export type ServiceVaultAssociatedData = {
|
|
96
|
-
teamId: string;
|
|
97
|
-
connectionId: string;
|
|
98
|
-
credentialProfileId: string;
|
|
99
|
-
field: string;
|
|
100
|
-
purpose: string;
|
|
101
|
-
version: number;
|
|
102
|
-
};
|
|
103
|
-
export declare function containsForbiddenPlaintextSecretMaterial(value: unknown, path?: string): string[];
|
|
104
|
-
export declare function canonicalServiceVaultAssociatedData(input: ServiceVaultAssociatedData): string;
|
|
105
|
-
export declare function canonicalHostedSecretOperationBinding(input: HostedSecretOperationBinding): string;
|
|
106
|
-
export declare function validateHostedSecretOperationBinding(value: unknown): value is HostedSecretOperationBinding;
|
|
107
|
-
export declare function validateSealedSecretOperationPayload(value: unknown): value is SealedSecretOperationPayload;
|
|
108
|
-
export declare function validateEncryptedCredentialEnvelope(value: unknown): value is EncryptedCredentialEnvelope;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const SERVICE_VAULT_ENCRYPTION_VERSION = "service-vault-v1";
|
|
2
|
-
const SERVICE_VAULT_AEAD_ALGORITHM = "xchacha20-poly1305-ietf";
|
|
3
|
-
const SERVICE_VAULT_KEY_AGREEMENT = "x25519-sealed-box";
|
|
4
|
-
const SERVICE_VAULT_KDF = "argon2id";
|
|
5
|
-
const SECRET_OPERATION_PURPOSES = [
|
|
6
|
-
"provider-connection-validation",
|
|
7
|
-
"remote-git-publication",
|
|
8
|
-
"workflow-dispatch",
|
|
9
|
-
"workflow-configuration",
|
|
10
|
-
"hosted-topology-plan",
|
|
11
|
-
"hosted-topology-apply",
|
|
12
|
-
"hosted-topology-readback",
|
|
13
|
-
"hosted-topology-rollback"
|
|
14
|
-
];
|
|
15
|
-
const FORBIDDEN_SECRET_KEYS = /(?:passphrase|password|plaintext|derivedKey|privateKey|apiToken|accessToken|secretValue|credentialValue)$/iu;
|
|
16
|
-
function containsForbiddenPlaintextSecretMaterial(value, path = "") {
|
|
17
|
-
if (!value || typeof value !== "object") return [];
|
|
18
|
-
const failures = [];
|
|
19
|
-
for (const [key, entry] of Object.entries(value)) {
|
|
20
|
-
const nextPath = path ? `${path}.${key}` : key;
|
|
21
|
-
if (FORBIDDEN_SECRET_KEYS.test(key) && typeof entry === "string" && entry.trim()) failures.push(nextPath);
|
|
22
|
-
if (entry && typeof entry === "object") failures.push(...containsForbiddenPlaintextSecretMaterial(entry, nextPath));
|
|
23
|
-
}
|
|
24
|
-
return failures;
|
|
25
|
-
}
|
|
26
|
-
function canonicalServiceVaultAssociatedData(input) {
|
|
27
|
-
return JSON.stringify({
|
|
28
|
-
teamId: input.teamId,
|
|
29
|
-
connectionId: input.connectionId,
|
|
30
|
-
credentialProfileId: input.credentialProfileId,
|
|
31
|
-
field: input.field,
|
|
32
|
-
purpose: input.purpose,
|
|
33
|
-
version: input.version
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
const digest = /^sha256:[a-f0-9]{64}$/u;
|
|
37
|
-
const identifier = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;
|
|
38
|
-
function canonicalHostedSecretOperationBinding(input) {
|
|
39
|
-
return JSON.stringify({
|
|
40
|
-
subjectType: input.subjectType,
|
|
41
|
-
subjectDigest: input.subjectDigest,
|
|
42
|
-
deploymentId: input.deploymentId,
|
|
43
|
-
stackId: input.stackId,
|
|
44
|
-
environment: input.environment
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function validateHostedSecretOperationBinding(value) {
|
|
48
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
49
|
-
const binding = value;
|
|
50
|
-
return ["declaration", "plan", "rollback"].includes(String(binding.subjectType)) && digest.test(String(binding.subjectDigest)) && identifier.test(String(binding.deploymentId)) && identifier.test(String(binding.stackId)) && ["staging", "production"].includes(String(binding.environment));
|
|
51
|
-
}
|
|
52
|
-
function validateSealedSecretOperationPayload(value) {
|
|
53
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
54
|
-
const payload = value;
|
|
55
|
-
return payload.schemaVersion === "treeseed.sealed-secret-operation-payload/v1" && payload.algorithm === SERVICE_VAULT_KEY_AGREEMENT && [payload.leaseId, payload.teamId, payload.operationCorrelationId, payload.ciphertext].every((field) => typeof field === "string" && field.length > 0) && validateHostedSecretOperationBinding(payload.hostedBinding);
|
|
56
|
-
}
|
|
57
|
-
function validateEncryptedCredentialEnvelope(value) {
|
|
58
|
-
if (!value || typeof value !== "object") return false;
|
|
59
|
-
const envelope = value;
|
|
60
|
-
return envelope.version === SERVICE_VAULT_ENCRYPTION_VERSION && envelope.algorithm === SERVICE_VAULT_AEAD_ALGORITHM && [envelope.ciphertext, envelope.nonce, envelope.wrappedKey, envelope.wrappedKeyNonce, envelope.associatedData, envelope.associatedDataDigest, envelope.fingerprint].every((field) => typeof field === "string" && field.length > 0);
|
|
61
|
-
}
|
|
62
|
-
export {
|
|
63
|
-
SECRET_OPERATION_PURPOSES,
|
|
64
|
-
SERVICE_VAULT_AEAD_ALGORITHM,
|
|
65
|
-
SERVICE_VAULT_ENCRYPTION_VERSION,
|
|
66
|
-
SERVICE_VAULT_KDF,
|
|
67
|
-
SERVICE_VAULT_KEY_AGREEMENT,
|
|
68
|
-
canonicalHostedSecretOperationBinding,
|
|
69
|
-
canonicalServiceVaultAssociatedData,
|
|
70
|
-
containsForbiddenPlaintextSecretMaterial,
|
|
71
|
-
validateEncryptedCredentialEnvelope,
|
|
72
|
-
validateHostedSecretOperationBinding,
|
|
73
|
-
validateSealedSecretOperationPayload
|
|
74
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type EncryptedCredentialEnvelope, type EncryptedPrivateKeyEnvelope, type TeamVaultGrantEnvelope } from '@treeseed/sdk/secrets-capability';
|
|
2
|
-
export declare function createServiceVaultKey(): Promise<Uint8Array>;
|
|
3
|
-
export declare function createServiceVaultUserKeyPair(): Promise<{
|
|
4
|
-
publicKey: string;
|
|
5
|
-
privateKey: Uint8Array;
|
|
6
|
-
}>;
|
|
7
|
-
export declare function encryptServiceVaultPrivateKey(privateKey: Uint8Array, publicKey: string, passphrase: string, options?: {
|
|
8
|
-
opsLimit?: number;
|
|
9
|
-
memLimit?: number;
|
|
10
|
-
}): Promise<EncryptedPrivateKeyEnvelope>;
|
|
11
|
-
export declare function decryptServiceVaultPrivateKey(envelope: EncryptedPrivateKeyEnvelope, passphrase: string): Promise<Uint8Array>;
|
|
12
|
-
export declare function createTeamVaultGrant(teamVaultKey: Uint8Array, recipientPublicKey: string): Promise<TeamVaultGrantEnvelope>;
|
|
13
|
-
export declare function openTeamVaultGrant(grant: TeamVaultGrantEnvelope, recipientPrivateKey: Uint8Array): Promise<Uint8Array>;
|
|
14
|
-
export declare function encryptServiceCredential(plaintext: string, teamVaultKey: Uint8Array, associatedData: string): Promise<EncryptedCredentialEnvelope>;
|
|
15
|
-
export declare function decryptServiceCredential(envelope: EncryptedCredentialEnvelope, teamVaultKey: Uint8Array, expectedAssociatedData: string): Promise<string>;
|
|
16
|
-
export declare function rewrapServiceCredential(envelope: EncryptedCredentialEnvelope, currentTeamVaultKey: Uint8Array, replacementTeamVaultKey: Uint8Array): Promise<EncryptedCredentialEnvelope>;
|
|
17
|
-
export declare function sealSecretOperationPayload(values: Record<string, string>, operationPublicKey: string): Promise<string>;
|
|
18
|
-
export declare function encryptGitHubActionsSecret(value: string, providerPublicKey: string): Promise<string>;
|
|
19
|
-
export declare function openSecretOperationPayload(sealedPayload: string, operationPublicKey: string, operationPrivateKey: Uint8Array): Promise<Record<string, string>>;
|
|
20
|
-
export declare function clearServiceVaultKey(value: Uint8Array | undefined): void;
|