Documentation
¶
Index ¶
- Constants
- func ContextCanViewFlow(ctx context.Context) bool
- func ContextCanViewOAS(ctx context.Context) bool
- func ContextHasPermission(ctx context.Context, permissionID int64) bool
- func ContextIsAdminUserMgmtAdmin(ctx context.Context) bool
- func ContextIsAdminUserMgmtViewer(ctx context.Context) bool
- func ContextIsBasicAuthAdmin(ctx context.Context) bool
- func ContextIsBasicAuthViewer(ctx context.Context) bool
- func ContextIsDebugger(ctx context.Context) bool
- func ContextSessionValid(ctx context.Context) bool
- func IsSuperUserContext(ctx context.Context) bool
- func RequireSessionMiddleware() adminapigen.StrictMiddlewareFunc
- func SessionMiddleware(ssi adminapigen.StrictServerInterface) adminapigen.StrictMiddlewareFunc
- type Admin
- func (d Admin) DisableBackend(backend string)
- func (d Admin) EnableBackend(backend string, id int64, expires time.Time)
- func (a *Admin) GetDebugger() composerdebug.Debugger
- func (d Admin) IsEnabled(backend string) (int64, bool)
- func (a *Admin) RegisterAPIProvider(apiProvider adminext.APIProvider) error
- func (a *Admin) SetFlowFetcher(ff adminext.FlowFetcher)
- func (a *Admin) SetOASBackend(backend adminext.OASBackend)
- func (d Admin) Start(ctx context.Context) (composerdebug.DebuggedCall, context.Context)
- type Opts
Constants ¶
const ( PermissionIDFlowViewer = int64(1) PermissionIDOASViewer = int64(2) PermissionIDBasicAuthOrgAdmin = int64(3) PermissionIDBasicAuthOrgViewer = int64(4) PermissionIDAdminUserMgmtAdmin = int64(5) PermissionIDAdminUserMgmtViewer = int64(6) PermissionIDDebugger = int64(7) PermissionNameFlowViewer = "flow-viewer" PermissionNameOASViewer = "oas-viewer" PermissionNameBasicAuthOrgAdmin = "basic-auth-org-admin" PermissionNameBasicAuthOrgViewer = "basic-auth-org-viewer" PermissionNameAdminUserMgmtAdmin = "admin-user-mgmt-admin" PermissionNameAdminUserMgmtViewer = "admin-user-mgmt-viewer" PermissionNameDebugger = "debugger" )
Variables ¶
This section is empty.
Functions ¶
func ContextCanViewFlow ¶ added in v0.9.0
ContextCanViewFlow reports whether the calling admin user has the flowviewer permission.
func ContextCanViewOAS ¶ added in v0.9.0
ContextCanViewOAS reports whether the calling admin user has the oasviewer permission.
func ContextHasPermission ¶ added in v0.9.0
ContextHasPermission reports whether the calling admin user holds the given permission. Superusers implicitly hold all permissions.
func ContextIsAdminUserMgmtAdmin ¶ added in v0.9.0
ContextIsAdminUserMgmtAdmin reports whether the calling admin user has the adminusermgmtadmin permission.
func ContextIsAdminUserMgmtViewer ¶ added in v0.9.0
ContextIsAdminUserMgmtViewer reports whether the calling admin user has the adminusermgmtviewer permission.
func ContextIsBasicAuthAdmin ¶ added in v0.9.0
ContextIsBasicAuthAdmin reports whether the calling admin user has the basicauthorgadmin permission.
func ContextIsBasicAuthViewer ¶ added in v0.9.0
ContextIsBasicAuthViewer reports whether the calling admin user has the basicauthorgviewer permission.
func ContextIsDebugger ¶ added in v1.0.0
ContextIsDebugger reports whether the calling admin user has the debugger permission.
func ContextSessionValid ¶ added in v0.8.1
ContextSessionValid reports whether the context contains an admin session. An admin session being present means it is valid.
func IsSuperUserContext ¶ added in v0.8.1
IsSuperUserContext reports whether the context contains a superuser session.
func RequireSessionMiddleware ¶ added in v0.8.1
func RequireSessionMiddleware() adminapigen.StrictMiddlewareFunc
func SessionMiddleware ¶ added in v0.8.1
func SessionMiddleware( ssi adminapigen.StrictServerInterface, ) adminapigen.StrictMiddlewareFunc
SessionMiddleware provides context population of administration session information. If put in front of a handler, the context to the handler will contain information that can be used to determine if a KRB admin made the call, or if it was external.
Types ¶
type Admin ¶
type Admin struct {
// contains filtered or unexported fields
}
func (Admin) DisableBackend ¶ added in v1.0.0
func (d Admin) DisableBackend(backend string)
DisableBackend disables debugging for the specified backend.
func (Admin) EnableBackend ¶ added in v1.0.0
EnableBackend enables debugging for the specified backend with the given session ID and expiration time.
func (*Admin) GetDebugger ¶ added in v1.0.0
func (a *Admin) GetDebugger() composerdebug.Debugger
GetDebugger returns the debugger used by the admin API to determine if a request should be debugged.
func (Admin) IsEnabled ¶ added in v1.0.0
IsEnabled checks if debugging is enabled for the specified backend and if the session has not expired.
func (*Admin) RegisterAPIProvider ¶ added in v0.8.1
func (a *Admin) RegisterAPIProvider(apiProvider adminext.APIProvider) error
RegisterAPIProvider registers an API provider with the admin API. All adminext.APIProvider implementations must be registered using this method in order for their routes to be served by the admin API.
func (*Admin) SetFlowFetcher ¶ added in v0.8.1
func (a *Admin) SetFlowFetcher(ff adminext.FlowFetcher)
SetFlowFetcher sets the flow fetcher for the admin component. This allows the admin API to serve flow metadata API calls.
func (*Admin) SetOASBackend ¶ added in v0.8.1
func (a *Admin) SetOASBackend(backend adminext.OASBackend)
SetOASBackend sets the OAS backend for the admin component. This allows the admin API to serve OAS to clients per backend providing an OAS.
func (Admin) Start ¶ added in v1.0.0
func (d Admin) Start(ctx context.Context) (composerdebug.DebuggedCall, context.Context)
Start implements [debug.Debugger].