| 1 | import * as redis from "@distilled.cloud/gcp/redis_v1"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeRedisInstanceHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { GetAuthString } from "./GetAuthString.ts"; |
| 5 | |
| 6 | /** |
| 7 | * HTTP implementation of {@link GetAuthString}. |
| 8 | * |
| 9 | * @layer |
| 10 | * @provides GCP.Redis.GetAuthString |
| 11 | */ |
| 12 | export const GetAuthStringHttp = Layer.effect( |
| 13 | GetAuthString, |
| 14 | makeRedisInstanceHttpBinding({ |
| 15 | tag: "GCP.Redis.GetAuthString", |
| 16 | operation: redis.getAuthStringProjectsLocationsInstances, |
| 17 | // `redis.instances.getAuthString` is only in the admin role; the IAM |
| 18 | // Condition limits it to the bound instance. |
| 19 | iam: { role: "roles/redis.admin", scopeByCondition: true }, |
| 20 | }), |
| 21 | ); |