Documentation ¶
Index ¶
- Constants
- func Authorized(c *gin.Context, role string) (int, error)
- func CreateAuthorization(ctx context.Context, auth *auth.Authorization) error
- func CreateAuthorizationEndpoint(c *gin.Context)
- func FindAuthorization(ctx context.Context, token string) (*auth.Authorization, error)
- func GetAuthorization(ctx context.Context, clientID, authType string) (*auth.Authorization, error)
- func GetBearerToken(c *gin.Context) string
- func GetClientID(c *gin.Context) (string, error)
- func GetToken(ctx context.Context, clientID, authType string) (string, error)
- func ValidateAuthorizationEndpoint(c *gin.Context)
Constants ¶
View Source
const ( // DatastoreAuthorizations collection AUTHORIZATION DatastoreAuthorizations string = "AUTHORIZATIONS" // AuthTypeJWT constant jwt AuthTypeJWT = "jwt" // AuthTypeSlack constant salack AuthTypeSlack = "slack" )
Variables ¶
This section is empty.
Functions ¶
func Authorized ¶
Authorized verifies that clientID can access resource kind/GUID
func CreateAuthorization ¶
func CreateAuthorization(ctx context.Context, auth *auth.Authorization) error
CreateAuthorization creates all data needed for the OAuth fu
func CreateAuthorizationEndpoint ¶
CreateAuthorizationEndpoint creates an authorization and JWT token
func FindAuthorization ¶
FindAuthorization looks for an authorization by token
func GetAuthorization ¶
GetAuthorization looks for an authorization. Not finding one is not an error!
func GetBearerToken ¶
GetBearerToken extracts the bearer token
func GetClientID ¶
GetClientID extracts the ClientID from the token
func ValidateAuthorizationEndpoint ¶
ValidateAuthorizationEndpoint verifies that the token is valid and exists in the authorization table
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.