| 1 | import type * as rolesanywhere from "@distilled.cloud/aws/rolesanywhere"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `rolesanywhere:GetSubject`. |
| 7 | * |
| 8 | * Reads a *subject* — the audit record IAM Roles Anywhere keeps for each |
| 9 | * certificate identity that has requested credentials, including the |
| 10 | * certificates presented and the time of the last authentication attempt. |
| 11 | * Account-level operation — subjects are chosen per request at runtime, so |
| 12 | * the binding takes no resource argument. Provide the implementation with |
| 13 | * `Effect.provide(AWS.RolesAnywhere.GetSubjectHttp)`. |
| 14 | * ### Auditing Certificate Identities |
| 15 | * **Example:** Inspect a Subject's Credentials |
| 16 | * ```typescript |
| 17 | * // init — account-level binding, no resource argument |
| 18 | * const getSubject = yield* AWS.RolesAnywhere.GetSubject(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { subject } = yield* getSubject({ subjectId }); |
| 22 | * const lastSeen = subject?.lastSeenAt; |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetSubject extends Binding.Service< |
| 28 | GetSubject, |
| 29 | "AWS.RolesAnywhere.GetSubject", |
| 30 | () => Effect.Effect< |
| 31 | ( |
| 32 | request: rolesanywhere.ScalarSubjectRequest, |
| 33 | ) => Effect.Effect< |
| 34 | rolesanywhere.SubjectDetailResponse, |
| 35 | rolesanywhere.GetSubjectError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const GetSubject = Binding.Service<GetSubject>( |
| 40 | "AWS.RolesAnywhere.GetSubject", |
| 41 | ); |