The best way to control Claude Code, Codex and more from any computer or phone

main
ts 56 lines 1.68 KB
Raw
1 import type * as binaryauthorization from "@distilled.cloud/gcp/binaryauthorization_v1";
2 import * as Binding from "alchemy/Binding";
3 import type { RuntimeContext } from "alchemy/RuntimeContext";
4 import type * as Effect from "effect/Effect";
5 import type { Attestor } from "./Attestor.ts";
6
7 export interface ValidateAttestationRequest extends Omit<
8 binaryauthorization.ValidateAttestationOccurrenceRequest,
9 never
10 > {}
11
12 /**
13 * Runtime binding for Binary Authorization
14 * `attestors.validateAttestationOccurrence`.
15 *
16 * Bind this operation to an {@link Attestor} in a Function/Action init
17 * phase. Provide {@link ValidateAttestationHttp}.
18 *
19 * ### Validating an Attestation
20 * **Example:** Check a payload against the bound attestor
21 * ```typescript
22 * const validate = yield* GCP.BinaryAuthorization.ValidateAttestation(
23 * attestor,
24 * );
25 * const result = yield* validate({
26 * occurrenceNote: note.name,
27 * occurrenceResourceUri: imageUri,
28 * attestation: {
29 * serializedPayload: btoa("payload"),
30 * signatures: [{ publicKeyId: keyId, signature: btoa("sig") }],
31 * },
32 * });
33 * ```
34 *
35 * @binding
36 * @category BinaryAuthorization
37 */
38 export interface ValidateAttestation extends Binding.Service<
39 ValidateAttestation,
40 "GCP.BinaryAuthorization.ValidateAttestation",
41 (
42 attestor: Attestor,
43 ) => Effect.Effect<
44 (
45 request: ValidateAttestationRequest,
46 ) => Effect.Effect<
47 binaryauthorization.ValidateAttestationOccurrenceResponse,
48 binaryauthorization.ValidateAttestationOccurrenceProjectsAttestorsError,
49 RuntimeContext
50 >
51 >
52 > {}
53
54 export const ValidateAttestation = Binding.Service<ValidateAttestation>(
55 "GCP.BinaryAuthorization.ValidateAttestation",
56 );