Documentation
¶
Index ¶
- func CreateAccessKey() (id, secret string, hash []byte, err error)
- func HashSecret(secret string) ([]byte, error)
- type Keychain
- func (kc *Keychain) Add(id string, hash []byte)
- func (kc *Keychain) Allow(r *http.Request) bool
- func (kc *Keychain) Guard(w http.ResponseWriter, r *http.Request) bool
- func (kc *Keychain) IDs() []string
- func (kc *Keychain) Len() int
- func (kc *Keychain) Remove(id string) bool
- func (kc *Keychain) Save() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAccessKey ¶
func HashSecret ¶
Types ¶
type Keychain ¶
type Keychain struct { Name string // contains filtered or unexported fields }
Keychain represents a collection of access keys that are allowed to use the API
func LoadKeychain ¶
Click to show internal directories.
Click to hide internal directories.