@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 22 lines 703 Bytes
Raw
1 import * as sqladmin from "@distilled.cloud/gcp/sqladmin_v1";
2 import * as Layer from "effect/Layer";
3 import { makeSqlUserHttpBinding } from "./BindingHttp.ts";
4 import { GetUser } from "./GetUser.ts";
5
6 /**
7 * HTTP implementation of {@link GetUser}.
8 *
9 * @layer
10 * @provides GCP.SQL.GetUser
11 */
12 export const GetUserHttp = Layer.effect(
13 GetUser,
14 makeSqlUserHttpBinding({
15 tag: "GCP.SQL.GetUser",
16 // `users.get` is not evaluated against the instance's resource name, so
17 // an instance-scoped IAM Condition never matches it (observed:
18 // SqlInstanceNotAuthorized); no narrower predefined role has it.
19 iam: { role: "roles/cloudsql.viewer" },
20 operation: sqladmin.getUsers,
21 }),
22 );