| 1 | import type * as grafana from "@distilled.cloud/aws/grafana"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Workspace } from "./Workspace.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `UpdateWorkspaceAuthentication` operation (IAM |
| 8 | * action `grafana:UpdateWorkspaceAuthentication`), scoped to one |
| 9 | * {@link Workspace}. |
| 10 | * |
| 11 | * Defines the SAML identity provider the workspace authenticates users from |
| 12 | * — IdP metadata, assertion-attribute mapping, and which groups receive the |
| 13 | * `Admin` and `Editor` roles. Changes can take a few minutes to apply. |
| 14 | * Provide the implementation with |
| 15 | * `Effect.provide(AWS.Grafana.UpdateWorkspaceAuthenticationHttp)`. |
| 16 | * ### Managing Authentication |
| 17 | * **Example:** Configure a SAML Identity Provider |
| 18 | * ```typescript |
| 19 | * const updateAuth = yield* Grafana.UpdateWorkspaceAuthentication(workspace); |
| 20 | * |
| 21 | * yield* updateAuth({ |
| 22 | * authenticationProviders: ["SAML"], |
| 23 | * samlConfiguration: { |
| 24 | * idpMetadata: { url: "https://idp.example.com/metadata.xml" }, |
| 25 | * assertionAttributes: { role: "grafanaRole" }, |
| 26 | * roleValues: { admin: ["platform-team"] }, |
| 27 | * }, |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface UpdateWorkspaceAuthentication extends Binding.Service< |
| 34 | UpdateWorkspaceAuthentication, |
| 35 | "AWS.Grafana.UpdateWorkspaceAuthentication", |
| 36 | ( |
| 37 | workspace: Workspace, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: Omit< |
| 41 | grafana.UpdateWorkspaceAuthenticationRequest, |
| 42 | "workspaceId" |
| 43 | >, |
| 44 | ) => Effect.Effect< |
| 45 | grafana.UpdateWorkspaceAuthenticationResponse, |
| 46 | grafana.UpdateWorkspaceAuthenticationError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | export const UpdateWorkspaceAuthentication = |
| 51 | Binding.Service<UpdateWorkspaceAuthentication>( |
| 52 | "AWS.Grafana.UpdateWorkspaceAuthentication", |
| 53 | ); |