Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Scope for reading tokens ScopeRead = "github.com/mutablelogic/go-server/tokenauth:read" // Scope for updating, deleting and creating tokens ScopeWrite = "github.com/mutablelogic/go-server/tokenauth:write" )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(pool Pool, opts ...Option) Auth
Create a new authorization service with the given pool
func NewAuthToken ¶ added in v0.0.3
func NewAuthToken(t *Token) *authtoken
Types ¶
type Token ¶
type Token struct { Key string `json:"key,omitempty" bson:"_id,omitempty"` // Key Name string `json:"name" bson:"name"` // Name of token Type TokenType `json:"type" bson:"type"` // Type of token Value string `json:"-" bson:"value"` // Token value Expire time.Time `json:"expires_at,omitempty" bson:"expires_at,omitempty"` // Time of expiration for the token Time time.Time `json:"access_at" bson:"access_at"` // Time of last access Scope []string `json:"scope,omitempty" bson:"scope,omitempty"` // Authorization scopes }
func (*Token) MarshalJSON ¶
type TokenUpdateExpiry ¶
type TokenUpdateScope ¶
type TokenUpdateTime ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.