package accesstoken
import (
- "context"
"crypto/rand"
"encoding/json"
"fmt"
}
// Create generates a new access token with the given ID.
-func (cs *CredentialStore) Create(ctx context.Context, id, typ string) (*Token, error) {
+func (cs *CredentialStore) Create(id, typ string) (*Token, error) {
if !validIDRegexp.MatchString(id) {
return nil, errors.WithDetailf(ErrBadID, "invalid id %q", id)
}
}
// Check returns whether or not an id-secret pair is a valid access token.
-func (cs *CredentialStore) Check(ctx context.Context, id string, secret string) error {
+func (cs *CredentialStore) Check(id string, secret string) error {
if !validIDRegexp.MatchString(id) {
return errors.WithDetailf(ErrBadID, "invalid id %q", id)
}
}
// List lists all access tokens.
-func (cs *CredentialStore) List(ctx context.Context) ([]*Token, error) {
+func (cs *CredentialStore) List() ([]*Token, error) {
tokens := make([]*Token, 0)
iter := cs.DB.Iterator()
defer iter.Release()
}
// Delete deletes an access token by id.
-func (cs *CredentialStore) Delete(ctx context.Context, id string) error {
+func (cs *CredentialStore) Delete(id string) error {
if !validIDRegexp.MatchString(id) {
return errors.WithDetailf(ErrBadID, "invalid id %q", id)
}