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 FakeIdentity
- 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
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 FakeIdentity ¶
type FakeIdentity struct{}
FakeIdentity middleware
func (*FakeIdentity) GetServiceAuthorization ¶
func (identity *FakeIdentity) GetServiceAuthorization() (schema.Authorization, error)
GetServiceAuthorization returns the master authorization with full permisions
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) }
IdentityService for user authentication & authorization
Click to show internal directories.
Click to hide internal directories.