Documentation ¶
Overview ¶
Package fakeiam provides a fake implementation for IAM services: IAM Admin IAM Credendtials
Index ¶
- func HashProto(msg proto.Message) []byte
- func SAEmail(proj string, accountID string) string
- func SAKName(proj string, accountID string, keyID string) string
- func SAName(proj string, accountID string) string
- type Admin
- func (f *Admin) CreateServiceAccount(ctx context.Context, req *iampb.CreateServiceAccountRequest) (*iampb.ServiceAccount, error)
- func (f *Admin) CreateServiceAccountKey(ctx context.Context, req *iampb.CreateServiceAccountKeyRequest) (*iampb.ServiceAccountKey, error)
- func (f *Admin) DeleteServiceAccount(ctx context.Context, req *iampb.DeleteServiceAccountRequest) (*epb.Empty, error)
- func (f *Admin) DeleteServiceAccountKey(ctx context.Context, req *iampb.DeleteServiceAccountKeyRequest) (*epb.Empty, error)
- func (f *Admin) GetServiceAccount(ctx context.Context, req *iampb.GetServiceAccountRequest) (*iampb.ServiceAccount, error)
- func (f *Admin) GetServiceAccountKey(ctx context.Context, req *iampb.GetServiceAccountKeyRequest) (*iampb.ServiceAccountKey, error)
- func (f *Admin) ListServiceAccountKeys(ctx context.Context, req *iampb.ListServiceAccountKeysRequest) (*iampb.ListServiceAccountKeysResponse, error)
- func (f *Admin) ListServiceAccounts(ctx context.Context, req *iampb.ListServiceAccountsRequest) (*iampb.ListServiceAccountsResponse, error)
- type AdminState
- type Creds
- type CredsState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SAEmail ¶ added in v0.8.6
SAEmail returns the service account email for a given project and account id.
Types ¶
type Admin ¶
type Admin struct { State chan AdminState iamgrpcpb.IAMServer }
Admin is a fake implementation of IAM Admin service.
func (*Admin) CreateServiceAccount ¶
func (f *Admin) CreateServiceAccount(ctx context.Context, req *iampb.CreateServiceAccountRequest) (*iampb.ServiceAccount, error)
func (*Admin) CreateServiceAccountKey ¶
func (f *Admin) CreateServiceAccountKey(ctx context.Context, req *iampb.CreateServiceAccountKeyRequest) (*iampb.ServiceAccountKey, error)
func (*Admin) DeleteServiceAccount ¶
func (*Admin) DeleteServiceAccountKey ¶
func (*Admin) GetServiceAccount ¶
func (f *Admin) GetServiceAccount(ctx context.Context, req *iampb.GetServiceAccountRequest) (*iampb.ServiceAccount, error)
func (*Admin) GetServiceAccountKey ¶
func (f *Admin) GetServiceAccountKey(ctx context.Context, req *iampb.GetServiceAccountKeyRequest) (*iampb.ServiceAccountKey, error)
func (*Admin) ListServiceAccountKeys ¶
func (f *Admin) ListServiceAccountKeys(ctx context.Context, req *iampb.ListServiceAccountKeysRequest) (*iampb.ListServiceAccountKeysResponse, error)
func (*Admin) ListServiceAccounts ¶
func (f *Admin) ListServiceAccounts(ctx context.Context, req *iampb.ListServiceAccountsRequest) (*iampb.ListServiceAccountsResponse, error)
type AdminState ¶
type AdminState struct { Accounts []*iampb.ServiceAccount Keys []*iampb.ServiceAccountKey }
AdminState stores the data of Admin.
type Creds ¶
type Creds struct { State chan CredsState iamcredsgrpcpb.IAMCredentialsServer }
Creds is a fake implementation of IAMCredentialsServer.
func (*Creds) GenerateAccessToken ¶
func (f *Creds) GenerateAccessToken(ctx context.Context, req *iamcredscpb.GenerateAccessTokenRequest) (*iamcredscpb.GenerateAccessTokenResponse, error)
type CredsState ¶
type CredsState struct { // Tokens is the list of tokens issued. Tokens []*iamcredscpb.GenerateAccessTokenResponse }
CredsState contains the state of the Creds
Click to show internal directories.
Click to hide internal directories.