user

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package user package is to manage the context of user information

Package user package is to manage the context of user information

Package user package is to manage the context of user information

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntityFromContext added in v0.8.0

func EntityFromContext(ctx context.Context) *unstructured.Unstructured

EntityFromContext will read entity from context up to now, we will use it to save operation target object in UserOwnedResouorceFilter and you could use EntityFromContext to avoid reading and unmarshall data from request again

func GetBaseUserInfoFromReq

func GetBaseUserInfoFromReq(req *restful.Request) *metav1alpha1.GitUserBaseInfo

GetBaseUserInfoFromReq get the base userinfo from the request object

func UserInfoFilter

func UserInfoFilter(req *restful.Request, res *restful.Response, chain *restful.FilterChain)

UserInfoFilter is to parse the user login information from the request header into userinfo, and store it in the context

func UserInfoFrom

func UserInfoFrom(ctx context.Context) (metav1alpha1.UserInfo, bool)

UserInfoFrom returns the value of the userinfo key on the ctx

func UserInfoValue

func UserInfoValue(ctx context.Context) (result metav1alpha1.UserInfo)

UserInfoValue returns the value of the userinfo key on the ctx, or the empty string if none

func UserOwnedResourcePermissionFilter added in v0.8.0

func UserOwnedResourcePermissionFilter(appCtx context.Context, groupVersionResource *schema.GroupVersionResource) restful.FilterFunction

UserOwnedResourcePermissionFilter provides a mechanism to check permissions for user owned resource the user owned resource could use annotation to annotated owner name and the filter will check if current user could execcute the `verb` for the resource more doc about it please see Spec: user owned resource permission check

func WithEntity added in v0.8.0

func WithEntity(ctx context.Context, entity *unstructured.Unstructured) context.Context

WithEntity will save entity into context up to now, we will use it to save operation target object in UserOwnedResouorceFilter and you could use EntityFromContext to avoid reading and unmarshall data from request again

func WithUserInfo

func WithUserInfo(parent context.Context, userinfo metav1alpha1.UserInfo) context.Context

WithUserInfo returns a copy of parent in which the userinfo value is set

Types

This section is empty.

Directories

Path Synopsis
Package matching contains useful functionality for matching users
Package matching contains useful functionality for matching users

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL