Documentation ¶
Index ¶
- Constants
- func AddCommonAnnotations(annotations map[string]string, ctx context.Context) map[string]string
- func AuditEventFrom(ctx context.Context) *audit.Event
- func NamespaceFrom(ctx context.Context) (string, bool)
- func NamespaceValue(ctx context.Context) string
- func NewContext() context.Context
- func NewDefaultContext() context.Context
- func UserFrom(ctx context.Context) (user.Info, bool)
- func WithAuditEvent(parent context.Context, ev *audit.Event) context.Context
- func WithNamespace(parent context.Context, namespace string) context.Context
- func WithRequestInfo(parent context.Context, info *RequestInfo) context.Context
- func WithUser(parent context.Context, user user.Info) context.Context
- func WithValue(parent context.Context, key interface{}, val interface{}) context.Context
- type RequestInfo
- type RequestInfoFactory
- type RequestInfoResolver
Constants ¶
View Source
const ( GlobalScope = "Global" WorkspaceScope = "Workspace" NamespaceScope = "Namespace" )
Variables ¶
This section is empty.
Functions ¶
func AddCommonAnnotations ¶
AddCommonAnnotations will add creator into the annotations
func AuditEventFrom ¶
AuditEventFrom returns the audit event struct on the ctx
func NamespaceFrom ¶
NamespaceFrom returns the value of the namespace key on the ctx
func NamespaceValue ¶
NamespaceValue returns the value of the namespace key on the ctx, or the empty string if none
func NewContext ¶
NewContext instantiates a bases context object for request flows.
func NewDefaultContext ¶
NewDefaultContext instantiates a bases context object for request flows in the default namespace
func WithAuditEvent ¶
WithAuditEvent returns set audit event struct.
func WithNamespace ¶
WithNamespace returns a copy of parent in which the namespace value is set
func WithRequestInfo ¶
func WithRequestInfo(parent context.Context, info *RequestInfo) context.Context
Types ¶
type RequestInfo ¶
type RequestInfo struct { *k8srequest.RequestInfo // IsKubernetesRequest indicates whether or not the request should be handled by kubernetes IsKubernetesRequest bool // Workspace of requested resource, for non-workspaced resources, this may be empty Workspace string // Cluster of requested resource, this is empty in single-cluster environment Cluster string // DevOps project of requested resource DevOps string // Scope of requested resource. ResourceScope string // Source IP SourceIP string // User agent UserAgent string }
func RequestInfoFrom ¶
func RequestInfoFrom(ctx context.Context) (*RequestInfo, bool)
type RequestInfoFactory ¶
type RequestInfoFactory struct { APIPrefixes sets.String GrouplessAPIPrefixes sets.String GlobalResources []schema.GroupResource }
func (*RequestInfoFactory) NewRequestInfo ¶
func (r *RequestInfoFactory) NewRequestInfo(req *http.Request) (*RequestInfo, error)
type RequestInfoResolver ¶
type RequestInfoResolver interface {
NewRequestInfo(req *http.Request) (*RequestInfo, error)
}
Click to show internal directories.
Click to hide internal directories.