Documentation ¶
Overview ¶
Package accesstoken provides storage and validation of Chain Core credentials.
Index ¶
- Variables
- type CredentialStore
- type Token
- func (cs *Token) Check(ctx context.Context, id string, secret []byte) (bool, error)
- func (cs *Token) Create(ctx context.Context, id, typ string) (*Token, error)
- func (cs *Token) Delete(ctx context.Context, id string) error
- func (cs *Token) Exists(ctx context.Context, id string) bool
- func (cs *Token) List(ctx context.Context, typ, after string, limit int) ([]*Token, string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBadID is returned when Create is called on an invalid id string. ErrBadID = errors.New("invalid id") // ErrDuplicateID is returned when Create is called on an existing ID. ErrDuplicateID = errors.New("duplicate access token ID") // ErrBadType is returned when Create is called with a bad type. ErrBadType = errors.New("type must be client or network") )
Functions ¶
This section is empty.
Types ¶
type CredentialStore ¶
type CredentialStore struct { }
type Token ¶
type Token struct { ID string `json:"id"` Token string `json:"token,omitempty"` Type string `json:"type,omitempty"` // deprecated in 1.2 Created time.Time `json:"created_at"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.