Documentation
¶
Index ¶
- Variables
- func Authorize(p Principal, op Operation, ownerKeyID string) error
- func ClearSessionCookie(allowInsecureHTTP bool) *http.Cookie
- func SessionCookie(value string, allowInsecureHTTP bool) *http.Cookie
- type Key
- type Level
- type Operation
- type Principal
- type Service
- func (s Service) Authenticate(ctx context.Context, bearer string) (Principal, error)
- func (s Service) BootstrapUser(ctx context.Context, login, password string) (string, error)
- func (s Service) IssueKey(ctx context.Context, p Principal, name string, level Level, expires *time.Time, ...) (Key, string, error)
- func (s Service) Keys(ctx context.Context, p Principal) ([]Key, error)
- func (s Service) Login(ctx context.Context, login, password string) (session, csrf string, p Principal, err error)
- func (s Service) Logout(ctx context.Context, session string) error
- func (s Service) Revoke(ctx context.Context, p Principal, id string) error
- func (s Service) Session(ctx context.Context, session, csrf string, mutating bool) (Principal, error)
- func (s Service) SetLevel(ctx context.Context, p Principal, id string, level Level) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrForbidden = errors.New("forbidden")
View Source
var ErrInvalid = errors.New("invalid input")
Functions ¶
func ClearSessionCookie ¶
Types ¶
type Key ¶
type Key struct {
ID string `json:"id"`
Name string `json:"name"`
IssuerID string `json:"issuer_id"`
IssuerName string `json:"issuer_name"`
CreatedAt string `json:"created_at"`
ExpiresAt string `json:"expires_at"`
Note string `json:"note"`
LastUsedAt string `json:"last_used_at"`
RevokedAt string `json:"revoked_at"`
Level Level `json:"level"`
}
type Operation ¶
type Operation string
const ( View Operation = "view" PutContext Operation = "put_context" RecordNote Operation = "record_note" ProposeChange Operation = "propose_change" Update Operation = "update" MarkVerified Operation = "mark_verified" CheckVersions Operation = "check_versions" Approve Operation = "approve" Reject Operation = "reject" Delete Operation = "delete" ManageKeys Operation = "manage_keys" Restore Operation = "restore" )
type Service ¶
func (Service) Authenticate ¶
func (Service) BootstrapUser ¶
BootstrapUser is for a local, one-time setup command; it refuses a second account.
Click to show internal directories.
Click to hide internal directories.