Documentation ¶
Index ¶
- Constants
- func ConvertTokenResource(schema *types.Schema, token v3.Token) (map[string]interface{}, error)
- func GetTokenAuthFromRequest(req *http.Request) string
- func IsExpired(token v3.Token) bool
- func NewAPIHandler(ctx context.Context, apiContext *config.ScaledContext) (http.Handler, error)
- func SetTokenExpiresAt(token *v3.Token)
- func SplitTokenParts(tokenID string) (string, string)
- func StartPurgeDaemon(ctx context.Context, mgmt *config.ManagementContext)
- type Manager
- func (m *Manager) CreateSecret(userID, provider, secret string) error
- func (m *Manager) CreateTokenAndSetCookie(userID string, userPrincipal v3.Principal, groupPrincipals []v3.Principal, ...) error
- func (m *Manager) EnsureAndGetUserAttribute(userID string) (*v3.UserAttribute, bool, error)
- func (m *Manager) GetGroupsForTokenAuthProvider(token *v3.Token) []v3.Principal
- func (m *Manager) GetSecret(userID string, provider string, fallbackTokens []*v3.Token) (string, error)
- func (m *Manager) IsMemberOf(token v3.Token, group v3.Principal) bool
- func (m *Manager) NewLoginToken(userID string, userPrincipal v3.Principal, groupPrincipals []v3.Principal, ...) (v3.Token, error)
- func (m *Manager) TokenStreamTransformer(apiContext *types.APIContext, schema *types.Schema, ...) (chan map[string]interface{}, error)
- func (m *Manager) UpdateSecret(userID, provider, secret string) error
- func (m *Manager) UpdateToken(token *v3.Token) (*v3.Token, error)
- func (m *Manager) UserAttributeChanged(attribs *v3.UserAttribute, provider string, groupPrincipals []v3.Principal) bool
- func (m *Manager) UserAttributeCreateOrUpdate(userID, provider string, groupPrincipals []v3.Principal) error
Constants ¶
View Source
const ( CookieName = "R_SESS" AuthHeaderName = "Authorization" AuthValuePrefix = "Bearer" BasicAuthPrefix = "Basic" CSRFCookie = "CSRF" )
View Source
const (
UserIDLabel = "authn.management.cattle.io/token-userId"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertTokenResource ¶
func GetTokenAuthFromRequest ¶
func NewAPIHandler ¶
func SetTokenExpiresAt ¶
func SplitTokenParts ¶
func StartPurgeDaemon ¶
func StartPurgeDaemon(ctx context.Context, mgmt *config.ManagementContext)
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(ctx context.Context, apiContext *config.ScaledContext) *Manager
func (*Manager) CreateSecret ¶
CreateSecret saves the secret in k8s. Secret is saved under the userID-secret with key being the provider and data being the providers secret
func (*Manager) CreateTokenAndSetCookie ¶
func (*Manager) EnsureAndGetUserAttribute ¶
func (*Manager) GetGroupsForTokenAuthProvider ¶
func (*Manager) NewLoginToken ¶
func (*Manager) TokenStreamTransformer ¶
func (m *Manager) TokenStreamTransformer( apiContext *types.APIContext, schema *types.Schema, data chan map[string]interface{}, opt *types.QueryOptions) (chan map[string]interface{}, error)
TokenStreamTransformer only filters out data for tokens that do not belong to the user
func (*Manager) UpdateSecret ¶
func (*Manager) UserAttributeChanged ¶
Click to show internal directories.
Click to hide internal directories.