Documentation ¶
Overview ¶
Package google contains the Google directory provider.
Index ¶
Constants ¶
const (
// Name is the provider name.
Name = "google"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(cfg *config)
An Option changes the configuration for the Google directory provider.
func WithServiceAccount ¶
func WithServiceAccount(serviceAccount *ServiceAccount) Option
WithServiceAccount sets the service account in the Google configuration.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
A Provider is a Google directory provider.
func (*Provider) UserGroups ¶
UserGroups returns a slice of group names a given user is in NOTE: groups via Directory API is limited to 1 QPS! https://developers.google.com/admin-sdk/directory/v1/reference/groups/list https://developers.google.com/admin-sdk/directory/v1/limits
type ServiceAccount ¶
type ServiceAccount struct { Type string `json:"type"` // serviceAccountKey or userCredentialsKey // Service Account fields ClientEmail string `json:"client_email"` PrivateKeyID string `json:"private_key_id"` PrivateKey string `json:"private_key"` TokenURL string `json:"token_uri"` ProjectID string `json:"project_id"` // User Credential fields // (These typically come from gcloud auth.) ClientSecret string `json:"client_secret"` ClientID string `json:"client_id"` RefreshToken string `json:"refresh_token"` // The User to use for Admin Directory API calls ImpersonateUser string `json:"impersonate_user"` }
A ServiceAccount is used to authenticate with the Google APIs.
Google oauth fields are from https://github.com/golang/oauth2/blob/master/google/google.go#L99
func ParseServiceAccount ¶
func ParseServiceAccount(rawServiceAccount string) (*ServiceAccount, error)
ParseServiceAccount parses the service account in the config options.