acl

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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

func Authorized(c *gin.Context, role string) (int, error)

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

func CreateAuthorizationEndpoint(c *gin.Context)

CreateAuthorizationEndpoint creates an authorization and JWT token

func FindAuthorization

func FindAuthorization(ctx context.Context, token string) (*auth.Authorization, error)

FindAuthorization looks for an authorization by token

func GetAuthorization

func GetAuthorization(ctx context.Context, clientID, authType string) (*auth.Authorization, error)

GetAuthorization looks for an authorization. Not finding one is not an error!

func GetBearerToken

func GetBearerToken(c *gin.Context) string

GetBearerToken extracts the bearer token

func GetClientID

func GetClientID(c *gin.Context) (string, error)

GetClientID extracts the ClientID from the token

func GetToken

func GetToken(ctx context.Context, clientID, authType string) (string, error)

GetToken returns the oauth token of the workspace integration

func ValidateAuthorizationEndpoint

func ValidateAuthorizationEndpoint(c *gin.Context)

ValidateAuthorizationEndpoint verifies that the token is valid and exists in the authorization table

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL