Documentation ¶
Index ¶
- func Authentication() martini.Handler
- func Authorization(action string) martini.Handler
- func FakeKeystone(martini *martini.ClassicMartini)
- func HTTPJSONError(res http.ResponseWriter, err string, code int)
- func JSONURLs() martini.Handler
- func Logging() martini.Handler
- func ReadJSON(r *http.Request) (map[string]interface{}, error)
- func WithContext() martini.Handler
- type Context
- type DefaultNobodyResourceService
- type FakeIdentity
- func (identity *FakeIdentity) GetClient() *gophercloud.ServiceClient
- func (identity *FakeIdentity) GetServiceAuthorization() (schema.Authorization, error)
- func (*FakeIdentity) GetTenantID(tenantName string) (string, error)
- func (*FakeIdentity) GetTenantName(tenantID string) (string, error)
- func (*FakeIdentity) VerifyToken(tokenID string) (schema.Authorization, error)
- type IdentityService
- type NoIdentityService
- func (i *NoIdentityService) GetClient() *gophercloud.ServiceClient
- func (i *NoIdentityService) GetServiceAuthorization() (schema.Authorization, error)
- func (i *NoIdentityService) GetTenantID(string) (string, error)
- func (i *NoIdentityService) GetTenantName(string) (string, error)
- func (i *NoIdentityService) VerifyToken(string) (schema.Authorization, error)
- type NobodyIdentityService
- func (i *NobodyIdentityService) GetClient() *gophercloud.ServiceClient
- func (i *NobodyIdentityService) GetServiceAuthorization() (schema.Authorization, error)
- func (i *NobodyIdentityService) GetTenantID(string) (string, error)
- func (i *NobodyIdentityService) GetTenantName(string) (string, error)
- func (i *NobodyIdentityService) VerifyToken(string) (schema.Authorization, error)
- type NobodyResourceService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authentication ¶
Authentication authenticates user using keystone
func Authorization ¶
Authorization checks user permissions against policy
func FakeKeystone ¶
func FakeKeystone(martini *martini.ClassicMartini)
FakeKeystone server for only test purpose
func HTTPJSONError ¶
func HTTPJSONError(res http.ResponseWriter, err string, code int)
HTTPJSONError helper for returning JSON errors
Types ¶
type DefaultNobodyResourceService ¶
type DefaultNobodyResourceService struct {
// contains filtered or unexported fields
}
func (*DefaultNobodyResourceService) VerifyResourcePath ¶
func (nrs *DefaultNobodyResourceService) VerifyResourcePath(resourcePath string) bool
type FakeIdentity ¶
type FakeIdentity struct{}
FakeIdentity middleware
func (*FakeIdentity) GetClient ¶
func (identity *FakeIdentity) GetClient() *gophercloud.ServiceClient
GetClient returns openstack client
func (*FakeIdentity) GetServiceAuthorization ¶
func (identity *FakeIdentity) GetServiceAuthorization() (schema.Authorization, error)
GetServiceAuthorization returns the master authorization with full permission
func (*FakeIdentity) GetTenantID ¶
func (*FakeIdentity) GetTenantID(tenantName string) (string, error)
GetTenantID maps the given tenant name to the tenant's ID
func (*FakeIdentity) GetTenantName ¶
func (*FakeIdentity) GetTenantName(tenantID string) (string, error)
GetTenantName maps the given tenant ID to the tenant's name
func (*FakeIdentity) VerifyToken ¶
func (*FakeIdentity) VerifyToken(tokenID string) (schema.Authorization, error)
VerifyToken fake verify
type IdentityService ¶
type IdentityService interface { GetTenantID(string) (string, error) GetTenantName(string) (string, error) VerifyToken(string) (schema.Authorization, error) GetServiceAuthorization() (schema.Authorization, error) GetClient() *gophercloud.ServiceClient }
IdentityService for user authentication & authorization
type NoIdentityService ¶
type NoIdentityService struct { }
NoIdentityService for disabled auth
func (*NoIdentityService) GetClient ¶
func (i *NoIdentityService) GetClient() *gophercloud.ServiceClient
GetClient returns always nil
func (*NoIdentityService) GetServiceAuthorization ¶
func (i *NoIdentityService) GetServiceAuthorization() (schema.Authorization, error)
GetServiceAuthorization returns always authorization for admin
func (*NoIdentityService) GetTenantID ¶
func (i *NoIdentityService) GetTenantID(string) (string, error)
GetTenantID returns always admin
func (*NoIdentityService) GetTenantName ¶
func (i *NoIdentityService) GetTenantName(string) (string, error)
GetTenantName returns always admin
func (*NoIdentityService) VerifyToken ¶
func (i *NoIdentityService) VerifyToken(string) (schema.Authorization, error)
VerifyToken returns always authorization for admin
type NobodyIdentityService ¶
type NobodyIdentityService struct { }
NobodyIdentityService for nobody auth
func (*NobodyIdentityService) GetClient ¶
func (i *NobodyIdentityService) GetClient() *gophercloud.ServiceClient
GetClient returns always nil
func (*NobodyIdentityService) GetServiceAuthorization ¶
func (i *NobodyIdentityService) GetServiceAuthorization() (schema.Authorization, error)
GetServiceAuthorization returns always authorization for nobody
func (*NobodyIdentityService) GetTenantID ¶
func (i *NobodyIdentityService) GetTenantID(string) (string, error)
GetTenantID returns always nobody
func (*NobodyIdentityService) GetTenantName ¶
func (i *NobodyIdentityService) GetTenantName(string) (string, error)
GetTenantName returns always nobody
func (*NobodyIdentityService) VerifyToken ¶
func (i *NobodyIdentityService) VerifyToken(string) (schema.Authorization, error)
VerifyToken returns always authorization for nobody
type NobodyResourceService ¶
NobodyResourceService contains a definition of nobody resources (that do not require authorization)
func NewNobodyResourceService ¶
func NewNobodyResourceService(nobodyResourcePathRegexes []*regexp.Regexp) NobodyResourceService