Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
ID string
Label string
GrantScopes string
ScopeLineKeys []string
ScopesCannotKey string
// ClientName is the product on the other end of the connection, used in the
// key label and as the fallback actor on the consent page.
ClientName string
TrustForwardedHost bool
LoginPath string
CreateKey func(label, scopes string) (rawKey string, id int64, err error)
BusinessName func() string
Language func(r *http.Request) string
Translate func(lang, key string) string
LocaleDir func(lang string) string
CSRFToken func(r *http.Request) string
CurrentUser func(r *http.Request) (User, bool)
Audit func(r *http.Request, userID int64, action string, details map[string]interface{})
Fail func(w http.ResponseWriter, status int, msg string)
JSON func(w http.ResponseWriter, status int, body map[string]any)
// contains filtered or unexported fields
}
func (*Service) Authorize ¶
func (c *Service) Authorize(w http.ResponseWriter, r *http.Request)
Authorize renders the consent screen (GET) and, on Approve (POST), mints the key and redirects back with a one-time code. Admin session required.
func (*Service) Stylesheet ¶
func (c *Service) Stylesheet(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.