@turbofy-ai/app-runtime 0.0.21 → 0.0.22
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/src/cloud-function/broker-client.d.ts +20 -0
- package/dist/src/cloud-function/grant.d.ts +13 -0
- package/dist/src/cloud-function/secret-fetch.d.ts +9 -0
- package/dist/src/cloud-function/secret.d.ts +7 -16
- package/dist/src/cloud-function.d.ts +5 -3
- package/dist/src/cloud-function.js +913 -21563
- package/package.json +4 -2
- package/dist/src/cloud-function/decrypt.d.ts +0 -3
- package/dist/src/cloud-function/log-redaction.d.ts +0 -1
- package/dist/src/cloud-function/with-secrets.d.ts +0 -7
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface IBrokerRequest {
|
|
2
|
+
url: string;
|
|
3
|
+
method: string;
|
|
4
|
+
headers: Record<string, string>;
|
|
5
|
+
/** Base64. */
|
|
6
|
+
body?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface IBrokerResponse {
|
|
9
|
+
status: number;
|
|
10
|
+
statusText: string;
|
|
11
|
+
headers: Record<string, string>;
|
|
12
|
+
/** Base64. */
|
|
13
|
+
body: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class SecretBrokerError extends Error {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
readonly status: number;
|
|
18
|
+
constructor(code: string, message: string, status: number);
|
|
19
|
+
}
|
|
20
|
+
export declare const callSecretBroker: (brokerUrl: URL, grant: string, request: IBrokerRequest, signal?: AbortSignal | null) => Promise<IBrokerResponse>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ICloudFunctionEvent {
|
|
2
|
+
body?: string | null;
|
|
3
|
+
isBase64Encoded?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface ISecretGrant {
|
|
6
|
+
grant: string;
|
|
7
|
+
brokerUrl: URL;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Reads the grant from the Function URL event, or from its already parsed
|
|
11
|
+
* JSON body.
|
|
12
|
+
*/
|
|
13
|
+
export declare const readSecretGrant: (event: unknown) => ISecretGrant;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SecretFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
2
|
+
/**
|
|
3
|
+
* A `fetch` that sends requests through the Turbofy secret broker, which
|
|
4
|
+
* replaces `secret(...)` placeholders in header and query values with the
|
|
5
|
+
* real values — only for hosts the workspace admin allowed for each secret.
|
|
6
|
+
* The function never sees the values; responses come back with them
|
|
7
|
+
* redacted. Redirects are returned, not followed.
|
|
8
|
+
*/
|
|
9
|
+
export declare const createSecretFetch: (event: unknown) => SecretFetch;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare class CloudFunctionSecrets {
|
|
9
|
-
#private;
|
|
10
|
-
constructor(secretsByPath: Record<string, string>);
|
|
11
|
-
has(path: string): boolean;
|
|
12
|
-
get(path: string): Secret | undefined;
|
|
13
|
-
require(path: string): Secret;
|
|
14
|
-
paths(): string[];
|
|
15
|
-
toJSON(): string[];
|
|
16
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* A stand-in for the secret passed to this invocation under `path` (the
|
|
3
|
+
* step param name, dot-separated when nested). Only the Turbofy secret
|
|
4
|
+
* broker replaces it with the value, so it is safe to log or return.
|
|
5
|
+
* Use it in header values or URL query values of `createSecretFetch` calls.
|
|
6
|
+
*/
|
|
7
|
+
export declare const secret: (path: string) => string;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
export { SecretBrokerError } from "./cloud-function/broker-client";
|
|
2
|
+
export type { ICloudFunctionEvent } from "./cloud-function/grant";
|
|
3
|
+
export { secret } from "./cloud-function/secret";
|
|
4
|
+
export { createSecretFetch } from "./cloud-function/secret-fetch";
|
|
5
|
+
export type { SecretFetch } from "./cloud-function/secret-fetch";
|