Documentation
¶
Index ¶
- Constants
- func ErrFailedToGetAdmins(err error) render.Renderer
- func ErrFailedToSetInitialAdmin(err error) render.Renderer
- func ErrInvalidRequest(err error) render.Renderer
- type AccountType
- type AuthenticationSessionRequest
- type BootstrapRequest
- type ErrResponse
- type Handler
- func (h *Handler) BootstrapAdmin(w http.ResponseWriter, r *http.Request)
- func (h *Handler) BootstrapUser(b *BootstrapRequest) *BootstrapRequest
- func (h *Handler) GetHerodot() *herodot.JSONWriter
- func (h *Handler) HydrateObservabilityTenants(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Middleware() func(http.Handler) http.Handler
- func (h *Handler) NewAuthenticationSessionResponse(session *AuthenticationSessionRequest) *AuthenticationSessionRequest
- func (h *Handler) ObservabilityTenantPolicyCheck(w http.ResponseWriter, r *http.Request)
- type PolicyRequest
- type User
Constants ¶
View Source
const ( ProjectKey = "projects.platform.kubricks.io/name" ProjectNSKey = "projects.platform.kubricks.io/namespace" ParentProjectKey = "projects.platform.kubricks.io/parent-project" ParentProjectNSKey = "projects.platform.kubricks.io/parent-project-namespace" PersonalKey = "environment.platform.kubricks.io/personal-namespace" )
Variables ¶
This section is empty.
Functions ¶
func ErrFailedToGetAdmins ¶
func ErrInvalidRequest ¶
Types ¶
type AccountType ¶
type AccountType string
const ( TypeServiceAccount AccountType = "ServiceAccount" TypeUser AccountType = "User" )
type AuthenticationSessionRequest ¶
type AuthenticationSessionRequest struct {
*authn.AuthenticationSession
}
func (*AuthenticationSessionRequest) Bind ¶
func (a *AuthenticationSessionRequest) Bind(r *http.Request) error
func (*AuthenticationSessionRequest) Render ¶
func (a *AuthenticationSessionRequest) Render(w http.ResponseWriter, r *http.Request) error
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 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
// 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) GetHerodot ¶
func (h *Handler) GetHerodot() *herodot.JSONWriter
func (*Handler) HydrateObservabilityTenants ¶
func (h *Handler) HydrateObservabilityTenants(w http.ResponseWriter, r *http.Request)
func (*Handler) Middleware ¶
Middleware decodes the share session cookie and packs the session into context
func (*Handler) NewAuthenticationSessionResponse ¶
func (h *Handler) NewAuthenticationSessionResponse(session *AuthenticationSessionRequest) *AuthenticationSessionRequest
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.