Documentation ¶
Index ¶
- Variables
- func CreateConfigFromEnv() (*oauth2.Config, error)
- func GetTokenFromRequest(c echo.Context) (string, error)
- func SliceMatches(requested, allowed []string) (bool, string)
- type Authenticator
- type Authorizer
- type Claims
- type ClientAuthorizer
- type SimpleAuthenticator
- type SimpleAuthorizer
- type UAA
- type UAAClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthenticatedAdmin = &SimpleAuthenticator{ admin: true, authorizedOrgGUIDs: []string{}, }
View Source
var AuthenticatedNonAdmin = &SimpleAuthenticator{ admin: false, authorizedOrgGUIDs: []string{ "org_guid", "org_guid1", "org_guid2", "00000001-0001-0000-0000-000000000000", "00000001-0002-0000-0000-000000000000", "00000001-0003-0000-0000-000000000000", "00000002-0001-0000-0000-000000000000", "00000002-0002-0000-0000-000000000000", "00000003-0005-0000-0000-000000000000", "o1s1", "o2s1", }, }
View Source
var FakeBearerToken = "Bearer FAKE_TOKEN"
View Source
var NonAuthenticated = &SimpleAuthenticator{ admin: false, authorizedOrgGUIDs: []string{}, authorizationError: nil, }
Functions ¶
func CreateConfigFromEnv ¶
func SliceMatches ¶
SliceMatches will iterate through both slices to find any incompatibilities in order to determine if the requested access is indeed allowed.
Types ¶
type Authenticator ¶
type Authorizer ¶
type Claims ¶
type Claims struct { Val string `json:"val"` jwt.StandardClaims }
type ClientAuthorizer ¶
type ClientAuthorizer struct {
// contains filtered or unexported fields
}
func (*ClientAuthorizer) Admin ¶
func (a *ClientAuthorizer) Admin() (bool, error)
func (*ClientAuthorizer) HasBillingAccess ¶
func (a *ClientAuthorizer) HasBillingAccess(requestedOrgs []string) (bool, error)
type SimpleAuthenticator ¶
type SimpleAuthenticator struct {
// contains filtered or unexported fields
}
func (*SimpleAuthenticator) Authorize ¶
func (sa *SimpleAuthenticator) Authorize(c echo.Context) error
func (*SimpleAuthenticator) Exchange ¶
func (sa *SimpleAuthenticator) Exchange(c echo.Context) error
func (*SimpleAuthenticator) NewAuthorizer ¶
func (sa *SimpleAuthenticator) NewAuthorizer(token string) (Authorizer, error)
type SimpleAuthorizer ¶
type SimpleAuthorizer struct {
// contains filtered or unexported fields
}
func (*SimpleAuthorizer) Admin ¶
func (sa *SimpleAuthorizer) Admin() (bool, error)
func (*SimpleAuthorizer) HasBillingAccess ¶
func (sa *SimpleAuthorizer) HasBillingAccess(orgs []string) (bool, error)
type UAA ¶
func (*UAA) NewAuthorizer ¶
func (uaa *UAA) NewAuthorizer(token string) (Authorizer, error)
Click to show internal directories.
Click to hide internal directories.