gcpclient

package
v0.0.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanImpersonate

func CanImpersonate(project, serviceAccountEmail, reason string) (bool, error)

CanImpersonate checks if a given service account can be impersonated by the authenticated user.

func CheckActiveAccountSet

func CheckActiveAccountSet() (string, error)

CheckActiveAccountSet ensures that the current gcloud config has an active account value and if an account is set, it returns the value

func ClientWithReason

func ClientWithReason(reason string) (*credentials.IamCredentialsClient, error)

ClientWithReason creates a client SDK with the provided reason field

func ConfigureGcloudProxy

func ConfigureGcloudProxy(project string) error

ConfigureGcloudProxy configures the current gcloud configuration to use the auth proxy

func GenerateTemporaryAccessToken

func GenerateTemporaryAccessToken(serviceAccountEmail, reason string) (*credentialspb.GenerateAccessTokenResponse, error)

GenerateTemporaryAccessToken generates short-lived credentials for the given service account

func GetClusters

func GetClusters(project, reason string) ([]map[string]string, error)

func GetCurrentProject

func GetCurrentProject() (string, error)

GetCurrentProject get the active project from the gcloud config

func GetCurrentRegion

func GetCurrentRegion() (string, error)

GetCurrentRegion get the active region from the gcloud config

func GetCurrentZone

func GetCurrentZone() (string, error)

GetCurrentZone get the active zone from the gcloud config

func GetServiceAccounts

func GetServiceAccounts(project, reason string) ([]*iam.ServiceAccount, error)

GetServiceAccounts fetches each of the service accounts that the authenticated user can impersonate in the active project.

func UnsetGcloudProxy

func UnsetGcloudProxy() error

UnsetGcloudProxy restores the auth proxy changes made to the gcloud config

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL