UNPKG

@dataroadinc/setup-auth

Version:

CLI tool and programmatic API for automated OAuth setup across cloud platforms

48 lines (47 loc) 1.84 kB
import { protos } from "@google-cloud/resource-manager"; import { GoogleAuth } from "google-auth-library"; import { GcpAuthenticatedIdentity } from "../creds/identity.js"; import { GcpProjectIamManager } from "../iam/project-iam.js"; export declare class GcpProjectManager { private readonly identity; private projectsClient; private readonly organizationId; private initialized; constructor(identity: GcpAuthenticatedIdentity, organizationId: string); initialize(): Promise<void>; projectExists(projectId: string): Promise<boolean>; isAttachedToOrganization(projectId: string): Promise<boolean>; deleteProject(projectId: string): Promise<void>; migrateProjectToOrganization(projectId: string): Promise<boolean>; listProjects(): Promise<string[]>; createProject(projectId: string): Promise<void>; getProject(projectId: string): Promise<protos.google.cloud.resourcemanager.v3.IProject>; getIamManager(projectId: string): Promise<GcpProjectIamManager>; } export declare function gcpSetOauthProjectId(options: { gcpOauthQuotaProjectId?: string; gcpOauthProjectId?: string; }): Promise<void>; export declare function gcpGetOauthProjectId(options: { gcpOauthProjectId?: string; }): Promise<{ success: boolean; gcpOauthProjectId?: string; error?: string; }>; export declare function gcpGetOauthQuotaProjectId(options: { gcpOauthQuotaProjectId?: string; gcpOauthProjectId?: string; }): Promise<{ success: boolean; gcpOauthQuotaProjectId?: string; error?: string; }>; export declare function gcpCheckOauthProjectId(options: { gcpOauthProjectId?: string; gcpOauthQuotaProjectId?: string; }): Promise<{ success: boolean; error?: string; }>; export declare function listProjects(auth: GoogleAuth, filter?: string): Promise<string[]>;