Documentation ¶
Index ¶
- func IsGoogleApiErrorWithCode(err error, errCode int) bool
- func NewBinding(role, member string) *iam.Binding
- func ServiceAccountEmail(name, project string) string
- func ServiceAccountEmailMember(name, project string) string
- func ServiceAccountKubernetesMember(name, namespace, project string) string
- func ServiceAccountResource(name, project string) string
- func ServiceAccountTokenCreatorRoleBinding(name, project string) *iam.Binding
- type ServiceAccountChecker
- type ServiceAccountFetcher
- type ServiceAccountPolicyBinder
- type ServiceAccountPolicyManager
- type ServiceAccountRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsGoogleApiErrorWithCode ¶
Borrowed from Hashicorp's GCP provider: - https://github.com/hashicorp/terraform-provider-google/blob/main/google/transport/transport.go#L150-L153
func NewBinding ¶
func NewBinding(role, member string) *iam.Binding
func ServiceAccountEmail ¶
func ServiceAccountResource ¶
ServiceAccountResource returns a fully qualified resource name for a service account. - https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/getIamPolicy
func ServiceAccountTokenCreatorRoleBinding ¶
func ServiceAccountTokenCreatorRoleBinding(name, project string) *iam.Binding
Types ¶
type ServiceAccountChecker ¶
func NewServiceAccountChecker ¶
func NewServiceAccountChecker(project string, fetcher ServiceAccountFetcher) ServiceAccountChecker
type ServiceAccountFetcher ¶
type ServiceAccountFetcher interface {
Get(ctx context.Context, name string) (*iam.ServiceAccount, error)
}
func NewServiceAccountFetcher ¶
func NewServiceAccountFetcher(project string, service *iam.Service) ServiceAccountFetcher
type ServiceAccountPolicyBinder ¶
type ServiceAccountPolicyBinder interface { AddPolicyRole(ctx context.Context, name string, role ServiceAccountRole) (*iam.Policy, error) RemovePolicyRole(ctx context.Context, name string, role ServiceAccountRole) (*iam.Policy, error) }
func NewServiceAccountPolicyBinder ¶
func NewServiceAccountPolicyBinder(project string, manager ServiceAccountPolicyManager) ServiceAccountPolicyBinder
type ServiceAccountPolicyManager ¶
type ServiceAccountPolicyManager interface { GetPolicy(ctx context.Context, resource string) (*iam.Policy, error) SetPolicy(ctx context.Context, resource string, policy *iam.Policy) (*iam.Policy, error) }
func NewServiceAccountPolicyManager ¶
func NewServiceAccountPolicyManager(project string, service *iam.Service) ServiceAccountPolicyManager
type ServiceAccountRole ¶
type ServiceAccountRole string
const ( ServiceAccountTokenCreatorRole ServiceAccountRole = "roles/iam.serviceAccountTokenCreator" WorkloadIdentityUser ServiceAccountRole = "roles/iam.workloadIdentityUser" )
func (ServiceAccountRole) String ¶
func (r ServiceAccountRole) String() string
Click to show internal directories.
Click to hide internal directories.