Documentation ¶
Overview ¶
tokenauth package implements authentication tokens for HTTP servers
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" )
View Source
const (
AdminToken = "admin"
)
Variables ¶
This section is empty.
Functions ¶
func NewWithPlugin ¶
Create a new logger task with provider of other tasks
Types ¶
type Plugin ¶
type Plugin struct { task.Plugin Path_ string `json:"path,omitempty"` File_ string `json:"file,omitempty"` Delta_ time.Duration `json:"delta,omitempty"` }
Plugin for tokenauth for storing tokens in a file
type Token ¶
type Token struct { Name string `json:"name,omitempty"` // Name of the token Value string `json:"token,omitempty"` // Token value Expire time.Time `json:"expire_time,omitempty"` // Time of expiration for the token Time time.Time `json:"access_time"` // Time of last access Scope []string `json:"scopes,omitempty"` // Authentication scopes }
func (*Token) MarshalJSON ¶
type TokenCreate ¶
Click to show internal directories.
Click to hide internal directories.