Documentation ¶
Overview ¶
Package accesstoken provides storage and validation of Chain Core credentials.
Index ¶
- Variables
- type CredentialStore
- func (cs *CredentialStore) Check(ctx context.Context, id string, secret []byte) (bool, error)
- func (cs *CredentialStore) Create(ctx context.Context, id, typ string) (*Token, error)
- func (cs *CredentialStore) Delete(ctx context.Context, id string) error
- func (cs *CredentialStore) Exists(ctx context.Context, id string) bool
- func (cs *CredentialStore) List(ctx context.Context, typ, after string, limit int) ([]*Token, string, error)
- type Token
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 ¶
func (*CredentialStore) Check ¶
Check returns whether or not an id-secret pair is a valid access token.
func (*CredentialStore) Delete ¶
func (cs *CredentialStore) Delete(ctx context.Context, id string) error
Delete deletes an access token by id.
Click to show internal directories.
Click to hide internal directories.