Documentation ¶
Index ¶
- Constants
- func ErrFailedToGetAdmins(err error) render.Renderer
- func ErrFailedToSetInitialAdmin(err error) render.Renderer
- func ErrInvalidRequest(err error) render.Renderer
- type AccountType
- type BootstrapRequest
- type ConsentAction
- type ConsentRequest
- type ErrResponse
- type Handler
- func (h *Handler) BootstrapAdmin(w http.ResponseWriter, r *http.Request)
- func (h *Handler) BootstrapUser(b *BootstrapRequest) *BootstrapRequest
- func (h *Handler) Consent(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetHerodot() *herodot.JSONWriter
- func (h *Handler) Middleware() func(http.Handler) http.Handler
- func (h *Handler) ObservabilityTenantPolicyCheck(w http.ResponseWriter, r *http.Request)
- type PolicyRequest
- type User
Constants ¶
View Source
const ( ConsentActionAccept = ConsentAction("accept") ConsentActionDeny = ConsentAction("deny") )
Variables ¶
This section is empty.
Functions ¶
func ErrFailedToGetAdmins ¶
func ErrInvalidRequest ¶
Types ¶
type AccountType ¶
type AccountType string
const ( TypeServiceAccount AccountType = "ServiceAccount" TypeUser AccountType = "User" )
type BootstrapRequest ¶
type BootstrapRequest struct {
UserID string `json:"userId,omitempty"`
}
func (*BootstrapRequest) Render ¶
func (b *BootstrapRequest) Render(w http.ResponseWriter, r *http.Request) error
type ConsentAction ¶ added in v0.4.0
type ConsentAction string
type ConsentRequest ¶ added in v0.4.0
type ConsentRequest struct { Challenge string `json:"consent_challenge"` Action ConsentAction `json:"consent_action"` Remember bool `json:"remember"` GrantScope []string `json:"grant_scope"` }
type ErrResponse ¶
type ErrResponse struct { Err error `json:"-"` // low-level runtime error HTTPStatusCode int `json:"-"` // http response status code StatusText string `json:"status"` // user-level status message AppCode int64 `json:"code,omitempty"` // application-specific error code ErrorText string `json:"error,omitempty"` // application-level error message, for debugging }
func (*ErrResponse) Render ¶
func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error
type Handler ¶
type Handler struct { C *clients.ClientWrapper Log logr.Logger Propagators propagation.TextMapPropagator // contains filtered or unexported fields }
func (*Handler) BootstrapAdmin ¶
func (h *Handler) BootstrapAdmin(w http.ResponseWriter, r *http.Request)
func (*Handler) BootstrapUser ¶
func (h *Handler) BootstrapUser(b *BootstrapRequest) *BootstrapRequest
func (*Handler) Consent ¶ added in v0.4.0
func (h *Handler) Consent(w http.ResponseWriter, r *http.Request)
func (*Handler) GetHerodot ¶
func (h *Handler) GetHerodot() *herodot.JSONWriter
func (*Handler) Middleware ¶
Middleware decodes the share session cookie and packs the session into context
func (*Handler) ObservabilityTenantPolicyCheck ¶
func (h *Handler) ObservabilityTenantPolicyCheck(w http.ResponseWriter, r *http.Request)
type PolicyRequest ¶
type PolicyRequest struct { Subject string `json:"subject"` IsOAuth2Client bool `json:"isOAuth2Client"` RequestedPermission string `json:"requestedPermission"` // contains filtered or unexported fields }
func (*PolicyRequest) GetRelationQuery ¶
func (p *PolicyRequest) GetRelationQuery() *rts.RelationQuery
func (*PolicyRequest) GetRelationTuple ¶
func (p *PolicyRequest) GetRelationTuple(tenantId string) *rts.RelationTuple
type User ¶
type User struct { // Type AccountType // Username string Id string Name string Email string // Groups []string // ProfileImage *string // JWT *string KratosSession *kratosClient.Session IsAdmin bool }
A stand-in for our backed user object
func ForContext ¶
ForContext finds the user from the context. REQUIRES Middleware to have run.
Click to show internal directories.
Click to hide internal directories.