Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoAuth = fmt.Errorf("no authorization header found")
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct {
UserID int64 `json:"user_id,omitempty"`
RegistryID int64 `json:"registry_id,omitempty"`
TokenID int64 `json:"token_id,omitempty"`
NoRateLimit bool `json:"no_rate_limit,omitempty"`
RateLimitPerSecond uint64 `json:"rate_limit_per_second,omitempty"`
NoAllowlist bool `json:"no_allowlist,omitempty"`
NoBlock bool `json:"no_block,omitempty"`
AllowTagsList bool `json:"allow_tags_list,omitempty"`
Weight int `json:"weight,omitempty"`
Host string `json:"host,omitempty"`
Image string `json:"image,omitempty"`
NoBlobsAgent bool `json:"no_blobs_agent,omitempty"`
BlobsAgentURL string `json:"blobs_url,omitempty"`
AlwaysRedirect bool `json:"always_redirect,omitempty"`
Block bool `json:"block,omitempty"`
BlockMessage string `json:"block_message,omitempty"`
}
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func NewAuthenticator ¶
func NewAuthenticator( tokenDecoder *Decoder, tokenURL string, ) *Authenticator
func (*Authenticator) Authenticate ¶
func (c *Authenticator) Authenticate(rw http.ResponseWriter, r *http.Request)
func (*Authenticator) Authorization ¶
func (c *Authenticator) Authorization(r *http.Request) (Token, error)
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
type Token ¶
type Token struct {
ExpiresAt time.Time `json:"expires_at,omitempty"`
Scope string `json:"scope,omitempty"`
Service string `json:"service,omitempty"`
Account string `json:"account,omitempty"`
IP string `json:"ip,omitempty"`
Image string `json:"image,omitempty"`
Attribute `json:"attribute,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.