Documentation ¶
Index ¶
- type Identity
- type Keystone
- func (d Keystone) AuthOptions() *gophercloud.AuthOptions
- func (d Keystone) Authenticate(credentials *gophercloud.AuthOptions) (policy.Context, error)
- func (d Keystone) Client() *gophercloud.ProviderClient
- func (d Keystone) DomainName(id string) (string, error)
- func (d Keystone) GroupName(id string) (string, error)
- func (d Keystone) ProjectName(id string) (string, error)
- func (d Keystone) RefreshToken() error
- func (d Keystone) RoleName(id string) (string, error)
- func (d Keystone) UserID(name string) (string, error)
- func (d Keystone) UserName(id string) (string, error)
- func (d Keystone) ValidateToken(token string) (policy.Context, error)
- type Mock
- func (d Mock) AuthOptions() *gophercloud.AuthOptions
- func (d Mock) Authenticate(credentials *gophercloud.AuthOptions) (policy.Context, error)
- func (d Mock) Client() *gophercloud.ProviderClient
- func (d Mock) DomainName(id string) (string, error)
- func (d Mock) GroupName(id string) (string, error)
- func (d Mock) ProjectName(id string) (string, error)
- func (d Mock) RoleName(id string) (string, error)
- func (d Mock) UserID(name string) (string, error)
- func (d Mock) UserName(id string) (string, error)
- func (d Mock) ValidateToken(token string) (policy.Context, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Identity ¶
type Identity interface { //Return the main gophercloud client from which the respective service //clients can be derived. For Mock drivers, this returns nil, so test code //should be prepared to handle a nil Client() where appropriate. Client() *gophercloud.ProviderClient AuthOptions() *gophercloud.AuthOptions /********** requests to Keystone **********/ ValidateToken(token string) (policy.Context, error) Authenticate(credentials *gophercloud.AuthOptions) (policy.Context, error) DomainName(id string) (string, error) ProjectName(id string) (string, error) UserName(id string) (string, error) UserID(name string) (string, error) RoleName(id string) (string, error) GroupName(id string) (string, error) }
Identity is an interface that wraps the authentication of the service user and token checking of API users. Because it is an interface, the real implementation can be mocked away in unit tests.
type Keystone ¶
type Keystone struct {
TokenRenewalMutex *sync.Mutex // Used for controlling the token refresh process
}
Keystone Openstack Keystone implementation
func (Keystone) AuthOptions ¶
func (d Keystone) AuthOptions() *gophercloud.AuthOptions
AuthOptions fills in Keystone options with netflow-api config values
func (Keystone) Authenticate ¶
func (d Keystone) Authenticate(credentials *gophercloud.AuthOptions) (policy.Context, error)
Authenticate with Keystone
func (Keystone) Client ¶
func (d Keystone) Client() *gophercloud.ProviderClient
Client for Keystone connection
func (Keystone) DomainName ¶
DomainName with caching
func (Keystone) ProjectName ¶
ProjectName with caching
func (Keystone) RefreshToken ¶
RefreshToken fetches a new Identity auth token. It is also used to fetch the initial token on startup.
type Mock ¶
type Mock struct{}
Mock TODO: emnpty struct? Is there a better way?
func (Mock) AuthOptions ¶
func (d Mock) AuthOptions() *gophercloud.AuthOptions
AuthOptions for mocking keystone
func (Mock) Authenticate ¶
func (d Mock) Authenticate(credentials *gophercloud.AuthOptions) (policy.Context, error)
Authenticate for Mocking Keystone
func (Mock) DomainName ¶
DomainName for mocking keystone
func (Mock) ProjectName ¶
ProjectName for mocking keystone