Documentation
¶
Overview ¶
Package npmjsaccesstoken contains a Veles Secret type and a Detector for npm.js Access Tokens (prefix `npm_`).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDetector ¶
NewDetector returns a new simpletoken.Detector that matches npm.js access tokens.
func NewValidator ¶
NewValidator checks whether the given NpmJsAccessToken is valid.
It performs a GET request to the npm registry whoami endpoint using the access token in the Authorization header. If the request returns HTTP 200, the token is considered valid. If 401 Unauthorized, the token is invalid. Other errors return ValidationFailed.
Types ¶
type NpmJsAccessToken ¶
type NpmJsAccessToken struct {
Token string
}
NpmJsAccessToken is a Veles Secret that holds relevant information for a DigitalOcean API key (prefix `dop_v1_`). DigitaloceanAPIToken represents an API key used to authenticate requests