Documentation ¶
Index ¶
- func NewService(credentials string) (*crmService, error)
- type BindingNotFoundError
- type CRM
- type Client
- func (client *Client) AddSAtoRole(saname string, roles []string, projectname string, ...) (*cloudresourcemanager.Policy, error)
- func (client *Client) MakeSafqdn(saname string, projectname string) string
- func (client *Client) RemoveSaRole(saname string, roles []string, projectname string, ...) (*cloudresourcemanager.Policy, error)
- type PolicyModifiedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
Types ¶
type BindingNotFoundError ¶
type BindingNotFoundError struct {
// contains filtered or unexported fields
}
func (*BindingNotFoundError) Error ¶
func (e *BindingNotFoundError) Error() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
TODO: Add handling of policy version according to the comments in Policy type, see: https://godoc.org/google.golang.org/api/cloudresourcemanager/v1#Policy projects management object.
func New ¶
New return new Client and error object. Error is not used at present. Added it for future use and to support common error handling.
func (*Client) AddSAtoRole ¶
func (client *Client) AddSAtoRole(saname string, roles []string, projectname string, condition *cloudresourcemanager.Expr) (*cloudresourcemanager.Policy, error)
TODO: Change method signature to accept condition expression string instead *cloudresourcemanager.Expr object. Align cmd main.go code to pass expression string. AddSAtoRole will fetch policy from GCP, assign serviceaccount to roles and send policy back to GCP. If role binding doesn't exist it will be added to the policy. Check in caller if returned error is PolicyModifiedError. If yes, GCP policy was changed by other caller in the meantime.
func (*Client) MakeSafqdn ¶
TODO: This should be renamed to make sa resource string. It should not be exported. Revert it to client private method. makeSafqdn will create serviceaccount fully qualified valid name, accepted by GCP API.
func (*Client) RemoveSaRole ¶
func (client *Client) RemoveSaRole(saname string, roles []string, projectname string, condition *cloudresourcemanager.Expr) (*cloudresourcemanager.Policy, error)
TODO: Change method signature to accept condition expression string instead *cloudresourcemanager.Expr object. Align cmd main.go code to pass expression string. AddSAtoRole will fetch policy from GCP, assign serviceaccount to roles and send policy back to GCP. If role binding doesn't exist it will be added to the policy. Check in caller if returned error is PolicyModifiedError. If yes, GCP policy was changed by other caller in the meantime.
type PolicyModifiedError ¶
type PolicyModifiedError struct {
// contains filtered or unexported fields
}
Custom Errors
func (*PolicyModifiedError) Error ¶
func (e *PolicyModifiedError) Error() string
Implementation of Error interface.