Documentation ¶
Index ¶
Constants ¶
View Source
const Provider = "google"
Variables ¶
This section is empty.
Functions ¶
func CreateOath2Client ¶
func CreateOath2Client(serviceAccount *ServiceAccount, scope ...string) (*http.Client, error)
CreateOath2Client creates a new OAuth2 client with credentials
Types ¶
type IamSvc ¶
type IamSvc struct {
// contains filtered or unexported fields
}
IamSvc describes the fields needed for interacting with Google's IAM API
func NewIamSvc ¶
func NewIamSvc(googleCredentials *googleauth.Credentials) *IamSvc
NewIamSvc creates a new IamSvc that will use the specified google credentials for interacting with Google IAM API
func (*IamSvc) GenerateNewAccessToken ¶
func (iam *IamSvc) GenerateNewAccessToken(serviceAccountEmail string, duration *duration.Duration) (*credentialspb.GenerateAccessTokenResponse, error)
GenerateNewAccessToken generates a new GCP access token that expires after the specified duration
type ServiceAccount ¶
type ServiceAccount struct { Type string `json:"type"` ProjectId string `json:"project_id"` PrivateKeyId string `json:"private_key_id"` PrivateKey string `json:"private_key"` ClientEmail string `json:"client_email"` ClientId string `json:"client_id"` AuthUri string `json:"auth_uri"` TokenUri string `json:"token_uri"` AuthProviderX50CertUrl string `json:"auth_provider_x509_cert_url"` ClientX509CertUrl string `json:"client_x509_cert_url"` }
ServiceAccount describes a GKE service account
func CreateServiceAccount ¶
func CreateServiceAccount(values map[string]string) *ServiceAccount
CreateServiceAccount creates a new 'ServiceAccount' instance
Click to show internal directories.
Click to hide internal directories.