MCPcopy Create free account
hub / github.com/firebase/firebase-tools / iamUserIsCSQLAdmin

Function iamUserIsCSQLAdmin

src/gcp/cloudsql/cloudsqladmin.ts:26–42  ·  view source on GitHub ↗
(options: Options)

Source from the content-addressed store, hash-verified

24}
25
26export async function iamUserIsCSQLAdmin(options: Options): Promise<boolean> {
27 const projectId = needProjectId(options);
28 const requiredPermissions = [
29 "cloudsql.instances.connect",
30 "cloudsql.instances.get",
31 "cloudsql.users.create",
32 "cloudsql.users.update",
33 ];
34
35 try {
36 const iamResult = await testIamPermissions(projectId, requiredPermissions);
37 return iamResult.passed;
38 } catch (err: any) {
39 logger.debug(`[iam] error while checking permissions, command may fail: ${err}`);
40 return false;
41 }
42}
43
44export async function listInstances(projectId: string): Promise<Instance[]> {
45 const res = await client.get<{ items: Instance[] }>(`projects/${projectId}/instances`);

Callers 3

setupSQLPermissionsFunction · 0.90

Calls 2

needProjectIdFunction · 0.90
testIamPermissionsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…