kekaccess

package module
v0.0.0-...-3ac3c61 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const SECRET_PATH = "/.kek/s"
View Source
const SIGNING_METHOD = "HS256"
View Source
const TOKENS_PATH = "/.kek/tokens"
View Source
const TOKEN_LENGTH = 25

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
}

func (Access) AddAccessToken

func (jt Access) AddAccessToken(canWrite, canDelete, canUpdate, canPublish, canRead bool) string

func (Access) GenerateAccessToken

func (jt Access) GenerateAccessToken(read, write, update, delete, publish bool) (string, Tokens)

func (Access) GenerateSecret

func (jt Access) GenerateSecret(path string) []byte

func (Access) GetAllTokens

func (jt Access) GetAllTokens() Tokens

func (Access) GetInvalidTokens

func (jt Access) GetInvalidTokens() Tokens

func (Access) GetSecret

func (jt Access) GetSecret() ([]byte, error)

func (Access) GetValidTokens

func (jt Access) GetValidTokens() Tokens

func (Access) NewJwt

func (jt Access) NewJwt(accessToken string, data map[string]string) (string, error)

func (Access) ValidateJwtAccess

func (jt Access) ValidateJwtAccess(tokenString string, accessType string) error

type KekAccess

type KekAccess struct {
	Valid     bool `json:"valid"`
	Write     bool `json:"write"`
	Read      bool `json:"read"`
	Publish   bool `json:"publish"`
	Delete    bool `json:"delete"`
	Update    bool `json:"update"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type KekClaim

type KekClaim struct {
	jwt.StandardClaims
	AccessToken string
	Data        interface{}
}

type Tokens

type Tokens map[string]KekAccess

Jump to

Keyboard shortcuts

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