Documentation ¶
Overview ¶
refer to: https://github.com/rancher/k3s/blob/master/pkg/clientaccess/clientaccess.go
Index ¶
- Constants
- func AgentAccessInfoToKubeConfig(destFile, server, token string) error
- func Get(path string, info *Info) ([]byte, error)
- func GetCACerts(u url.URL) ([]byte, error)
- func GetHTTPClient(cacerts []byte) *http.Client
- func GetJWTSecretTokenName(token string) (string, error)
- func GetTokenAuthFromRequest(req *http.Request) string
- func NormalizeAndValidateTokenForUser(server, token, user string) (string, error)
- func ParseUsernamePassword(token string) (string, string, bool)
- func SplitJWTTokenParts(token string) ([]string, error)
- func SplitTokenParts(tokenID string) (string, string)
- func ToAuthMiddleware(a Authenticator) auth.Middleware
- type Authenticator
- type Handler
- type Info
- type K3sAuthenticator
- type OverrideURLCallback
- type TokenSecretData
Constants ¶
View Source
const ( CookieName = "R_SESS" AuthHeaderName = "Authorization" AuthValuePrefix = "Bearer" BasicAuthPrefix = "Basic" OctopusAPILabel = "authn.management.octopusapi.io/octopus-api" TokenNamespace = "kube-system" )
Variables ¶
This section is empty.
Functions ¶
func GetHTTPClient ¶
func GetJWTSecretTokenName ¶
func GetTokenAuthFromRequest ¶
func SplitJWTTokenParts ¶
func SplitTokenParts ¶
func ToAuthMiddleware ¶
func ToAuthMiddleware(a Authenticator) auth.Middleware
Types ¶
type Authenticator ¶
type Authenticator interface {
Authenticate(req *http.Request) (authed bool, user string, err error)
}
func NewK3sAuthenticator ¶
func NewK3sAuthenticator(ctx context.Context, endpoint string, client *kubernetes.Clientset) Authenticator
type Handler ¶
type Handler struct { Host string // contains filtered or unexported fields }
func NewAuthHandler ¶
NewHandler creates a new AuthHandler
type Info ¶
type Info struct { URL string `json:"url,omitempty"` CACerts []byte `json:"cacerts,omitempty"` Token string `json:"token,omitempty"` // contains filtered or unexported fields }
func ParseAndValidateToken ¶
func (*Info) KubeConfig ¶
func (i *Info) KubeConfig() *clientcmdapi.Config
func (*Info) WriteKubeConfig ¶
type K3sAuthenticator ¶
type K3sAuthenticator struct {
// contains filtered or unexported fields
}
func (*K3sAuthenticator) Authenticate ¶
Click to show internal directories.
Click to hide internal directories.