auth

package
v0.0.0-...-f4df827 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClaimSubject = "sub"
	ClaimIssuer  = "iss"
	ClaimIssued  = "iat"
	ClaimExpiry  = "exp"
	ClaimID      = "jti"

	ClaimScopeDomain  = "github.com/dicot-project/scope/domain"
	ClaimScopeProject = "github.com/dicot-project/scope/project"

	Issuer = "github.com/dicot-project/api"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	ID      string
	Issued  time.Time
	Expiry  time.Time
	Subject TokenSubject
	Scope   TokenScope
}

type TokenManager

type TokenManager interface {
	NewToken() *Token
	SignToken(tok *Token) (string, error)
	ValidateToken(toksig string) (*Token, error)
}

func NewTokenManager

func NewTokenManager(keys []interface{}, lifetime time.Duration, cl identity.Interface) TokenManager

func NewTokenManagerFromPEM

func NewTokenManagerFromPEM(keyPEM string, lifetime time.Duration, cl identity.Interface) (TokenManager, error)

type TokenScope

type TokenScope struct {
	DomainName  string
	ProjectName string
}

type TokenSubject

type TokenSubject struct {
	DomainName string
	UserName   string
}

Jump to

Keyboard shortcuts

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