server

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const BasicAuthRefreshTokenLifetime = 24 * time.Hour

After 24 hours, the user will need to enter his credentials (password) again.

View Source
const OIDCAuthRefreshTokenLifetime = 30 * time.Minute

After 30 minutes, the user will be redirected to the OIDC provider to authenticate again. This does NOT mean that the user will need to enter his credentials again, as the OIDC provider is likely to rely on its own cookies.

Variables

This section is empty.

Functions

This section is empty.

Types

type OIDCProvider added in v0.2.0

type OIDCProvider struct {
	// contains filtered or unexported fields
}

func NewOIDCProvider added in v0.2.0

func NewOIDCProvider(
	logger logr.Logger,
	serverURL string,
	issuerURL string,
	discoveryURL string,
	clientID string,
	clientSecret string,
	logoutURLTemplate string,
) (*OIDCProvider, error)

func (*OIDCProvider) BuildLogoutURL added in v0.2.0

func (p *OIDCProvider) BuildLogoutURL(idToken string) (string, error)

func (*OIDCProvider) GetOAuth2State added in v0.2.0

func (p *OIDCProvider) GetOAuth2State(redirectURL string) (*oauth2State, string, error)

func (*OIDCProvider) Init added in v0.2.0

func (p *OIDCProvider) Init(ctx context.Context) error

func (*OIDCProvider) OAuth2Config added in v0.2.0

func (p *OIDCProvider) OAuth2Config() *oauth2.Config

func (*OIDCProvider) ParseOAuth2State added in v0.2.0

func (p *OIDCProvider) ParseOAuth2State(raw string) (*oauth2State, error)

func (*OIDCProvider) Verify added in v0.2.0

func (p *OIDCProvider) Verify(ctx context.Context, rawIDToken string) (*oidc.IDToken, error)

type Server added in v0.2.0

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	logger logr.Logger,
	k8sClient dynamic.Interface,
	traceflowRequestsHandler traceflow.RequestsHandler,
	k8sProxyHandler http.Handler,
	antreaSvcRequestsHandler antreasvc.RequestsHandler,
	passwordStore password.Store,
	tokenManager auth.TokenManager,
	oidcProvider *OIDCProvider,
	config *serverconfig.Config,
) *Server

func (*Server) AddAuthRoutes added in v0.2.0

func (s *Server) AddAuthRoutes(r *gin.RouterGroup)

func (*Server) AddOAuth2Routes added in v0.2.0

func (s *Server) AddOAuth2Routes(r *gin.RouterGroup)

func (*Server) AddRoutes added in v0.2.0

func (s *Server) AddRoutes(router *gin.Engine)

func (*Server) LogError added in v0.2.0

func (s *Server) LogError(sError *errors.ServerError, msg string, keysAndValues ...interface{})

func (*Server) Login added in v0.2.0

func (s *Server) Login(c *gin.Context)

func (*Server) Logout added in v0.2.0

func (s *Server) Logout(c *gin.Context)

func (*Server) OAuth2Callback added in v0.2.0

func (s *Server) OAuth2Callback(c *gin.Context)

func (*Server) OAuth2Login added in v0.2.0

func (s *Server) OAuth2Login(c *gin.Context)

func (*Server) RefreshToken added in v0.2.0

func (s *Server) RefreshToken(c *gin.Context)

Directories

Path Synopsis
utils

Jump to

Keyboard shortcuts

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