Documentation
¶
Index ¶
- type AccessResponse
- type Endpoint
- type ErrorResponse
- type ErrorWrapper
- type IdentityService
- type KeyPair
- func (u *KeyPair) AddService(service Service)
- func (u *KeyPair) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)
- func (u *KeyPair) ReturnFailure(w http.ResponseWriter, status int, message string)
- func (u *KeyPair) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (u *KeyPair) SetupHTTP(mux *http.ServeMux)
- func (u *KeyPair) Stop()
- type KeyPairRequest
- type Legacy
- func (lis *Legacy) AddService(service Service)
- func (lis *Legacy) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)
- func (lis *Legacy) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (lis *Legacy) SetManagementURL(URL string)
- func (lis *Legacy) SetupHTTP(mux *http.ServeMux)
- func (lis *Legacy) Stop()
- type RoleResponse
- type Service
- type ServiceProvider
- type TokenResponse
- type UserInfo
- type UserPass
- func (u *UserPass) AddService(service Service)
- func (u *UserPass) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)
- func (u *UserPass) ReturnFailure(w http.ResponseWriter, status int, message string)
- func (u *UserPass) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (u *UserPass) SetupHTTP(mux *http.ServeMux)
- func (u *UserPass) Stop()
- type UserPassRequest
- type UserResponse
- type Users
- type V2Service
- type V3Domain
- type V3Endpoint
- type V3Project
- type V3Service
- type V3TokenResponse
- type V3UserPass
- func (u *V3UserPass) AddService(service Service)
- func (u *V3UserPass) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)
- func (u *V3UserPass) ReturnFailure(w http.ResponseWriter, status int, message string)
- func (u *V3UserPass) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (u *V3UserPass) SetupHTTP(mux *http.ServeMux)
- func (u *V3UserPass) Stop()
- type V3UserPassRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessResponse ¶
type AccessResponse struct { Access struct { ServiceCatalog []V2Service `json:"serviceCatalog"` Token TokenResponse `json:"token"` User UserResponse `json:"user"` } `json:"access"` }
type ErrorResponse ¶
type ErrorWrapper ¶
type ErrorWrapper struct {
Error ErrorResponse `json:"error"`
}
type IdentityService ¶
type IdentityService interface { AddUser(user, secret, tenant, authDomain string) *UserInfo FindUser(token string) (*UserInfo, error) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider) AddService(service Service) SetupHTTP(mux *http.ServeMux) }
An IdentityService provides user authentication for an Openstack instance.
type KeyPair ¶
type KeyPair struct { hook.TestService Users // contains filtered or unexported fields }
func NewKeyPair ¶
func NewKeyPair() *KeyPair
func (*KeyPair) AddService ¶
func (*KeyPair) RegisterServiceProvider ¶
func (u *KeyPair) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)
func (*KeyPair) ReturnFailure ¶
func (u *KeyPair) ReturnFailure(w http.ResponseWriter, status int, message string)
type KeyPairRequest ¶
type Legacy ¶
type Legacy struct { Users // contains filtered or unexported fields }
func (*Legacy) AddService ¶
func (*Legacy) RegisterServiceProvider ¶
func (lis *Legacy) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)
func (*Legacy) SetManagementURL ¶
type RoleResponse ¶
type ServiceProvider ¶
type ServiceProvider interface { // For Keystone V2 Endpoints() []Endpoint // For Keystone V3 V3Endpoints() []V3Endpoint }
ServiceProvider is an Openstack module which has service endpoints.
type TokenResponse ¶
type UserPass ¶
type UserPass struct { hook.TestService Users // contains filtered or unexported fields }
func NewUserPass ¶
func NewUserPass() *UserPass
func (*UserPass) AddService ¶
func (*UserPass) RegisterServiceProvider ¶
func (u *UserPass) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)
func (*UserPass) ReturnFailure ¶
func (u *UserPass) ReturnFailure(w http.ResponseWriter, status int, message string)
type UserPassRequest ¶
type UserResponse ¶
type UserResponse struct { Id string `json:"id"` Name string `json:"name"` Roles []RoleResponse `json:"roles"` }
type V3Endpoint ¶
type V3Endpoint struct { Interface string `json:"interface"` RegionID string `json:"region_id"` URL string `json:"url"` }
V3Endpoint represents endpoints to a Service
func NewV3Endpoints ¶
func NewV3Endpoints(adminURL, internalURL, publicURL, regionID string) []V3Endpoint
NewV3Endpoints returns an array of V3Endpoint for the given Region and the passed admin, internal and public URLs.
type V3Project ¶
type V3Project struct {
ID string `json:"id,omitempty"`
}
V3Project represent an openstack project, A project is the base unit of ownership. Resources are owned by a specific project. A project is owned by a specific domain.
type V3Service ¶
type V3Service struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Endpoints []V3Endpoint `json:"endpoints"` }
V3Service represents an OpenStack web service that you can access through a URL.
type V3TokenResponse ¶
type V3TokenResponse struct { Expires time.Time `json:"expires_at"` Issued time.Time `json:"issued_at"` Methods []string `json:"methods"` Catalog []V3Service `json:"catalog,omitempty"` Project *V3Project `json:"project,omitempty"` Domain *V3Domain `json:"domain,omitempty"` User struct { ID string `json:"id"` Name string `json:"name"` } `json:"user"` }
V3TokenResponse repesent a Token returned as a response to authentication to keystone v3.
type V3UserPass ¶
type V3UserPass struct { hook.TestService Users // contains filtered or unexported fields }
V3UserPass represents an authenticated user to a service.
func (*V3UserPass) AddService ¶
func (u *V3UserPass) AddService(service Service)
AddService adds a service to the current V3UserPass.
func (*V3UserPass) RegisterServiceProvider ¶
func (u *V3UserPass) RegisterServiceProvider(name, serviceType string, serviceProvider ServiceProvider)
RegisterServiceProvider registers V3UserPass as a service provider.
func (*V3UserPass) ReturnFailure ¶
func (u *V3UserPass) ReturnFailure(w http.ResponseWriter, status int, message string)
ReturnFailure wraps and returns an error through the http connection.
func (*V3UserPass) ServeHTTP ¶
func (u *V3UserPass) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves V3UserPass for testing purposes.
func (*V3UserPass) SetupHTTP ¶
func (u *V3UserPass) SetupHTTP(mux *http.ServeMux)
SetupHTTP attaches all the needed handlers to provide the HTTP API.
func (*V3UserPass) Stop ¶
func (u *V3UserPass) Stop()
type V3UserPassRequest ¶
type V3UserPassRequest struct { Auth struct { Identity struct { Methods []string `json:"methods"` Password struct { User struct { Name string `json:"name"` Password string `json:"password"` Domain struct { Name string `json:"name,omitempty"` } `json:"domain"` } `json:"user"` } `json:"password"` } `json:"identity"` Scope struct { Project struct { Name string `json:"name"` Domain struct { Name string `json:"name,omitempty"` } `json:"domain,omitempty"` } `json:"project"` Domain struct { Name string `json:"name,omitempty"` } `json:"domain"` } `json:"scope"` } `json:"auth"` }
V3UserPassRequest Implement the v3 User Pass form of identity (Keystone)