gcpclient

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 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 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 FetchAvailableServiceAccounts added in v0.0.18

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

FetchAvailableServiceAccounts gets a list of service accounts that the user can impersonate.

func GenerateTemporaryAccessToken

func GenerateTemporaryAccessToken(svcAcct, 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)

GetClusters gets the list of clusters in the current project.

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 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