Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorResponse(c *gin.Context, err error)
- func NewAmtRoutes(handler *gin.RouterGroup, d devices.Feature, amt amtexplorer.Feature, ...)
- func NewCIRACertRoutes(handler *gin.RouterGroup, l logger.Interface, cfg *config.Config)
- func NewCIRACertRoutesWithReader(handler *gin.RouterGroup, l logger.Interface, certReader CertReader, ...)
- func NewCIRAConfigRoutes(handler *gin.RouterGroup, t ciraconfigs.Feature, l logger.Interface, ...)
- func NewDeviceRoutes(handler *gin.RouterGroup, t devices.Feature, l logger.Interface)
- func NewDomainRoutes(handler *gin.RouterGroup, t domains.Feature, l logger.Interface)
- func NewIEEE8021xConfigRoutes(handler *gin.RouterGroup, t ieee8021xconfigs.Feature, l logger.Interface)
- func NewPackageRoutes(handler *gin.RouterGroup, t packaging.Feature, l logger.Interface)
- func NewProfileRoutes(handler *gin.RouterGroup, t profiles.Feature, l logger.Interface)
- func NewServerRoutes(handler *gin.RouterGroup, cfg *config.Config)
- func NewWirelessConfigRoutes(handler *gin.RouterGroup, t wificonfigs.Feature, l logger.Interface)
- func RepositoryError(status string) error
- type CertReader
- type DomainCountResponse
- type FileCertReader
- type LoginRoute
- type OData
- type ValidationError
- type VersionRoute
- type WirelessConfigRoutes
Constants ¶
const ( // MaxPageSize is the maximum allowed value for $top parameter. MaxPageSize = 500 // MaxSkipValue is the maximum allowed value for $skip parameter. MaxSkipValue = 100000 // DefaultPageSize is the default value for $top when not specified. DefaultPageSize = 25 // DecimalBase is the base for decimal integer parsing. DecimalBase = 10 // BitSize64 is the bit size for 64-bit integer parsing. BitSize64 = 64 )
Variables ¶
var ( ErrLogin = consoleerrors.CreateConsoleError("LoginHandler") ErrUnexpectedSigningMethod = errors.New("unexpected signing method") )
var ( // ErrInvalidInteger is returned when a query parameter is not a valid integer. ErrInvalidInteger = errors.New("parameter must be a valid integer") // ErrExceedsMaxRange is returned when a query parameter exceeds the maximum allowed range. ErrExceedsMaxRange = errors.New("parameter value exceeds maximum allowed range") // ErrNegativeValue is returned when a query parameter is negative. ErrNegativeValue = errors.New("parameter must be non-negative") // ErrInvalidBoolean is returned when a boolean query parameter is not a valid boolean. ErrInvalidBoolean = errors.New("parameter must be a boolean value") )
var ( ErrGithub = consoleerrors.CreateConsoleError("LatestReleaseHandler") ErrFailedToFetch = errors.New("repositoryError") )
var ErrValidation8021xConfig = dto.NotValidError{Console: consoleerrors.CreateConsoleError("8021xConfigAPI")}
var ErrValidationDevices = dto.NotValidError{Console: consoleerrors.CreateConsoleError("ProfileAPI")}
var ErrValidationDomains = dto.NotValidError{Console: consoleerrors.CreateConsoleError("DomainsAPI")}
var ErrValidationProfile = dto.NotValidError{Console: consoleerrors.CreateConsoleError("ProfileAPI")}
var ErrValidationWifiConfig = dto.NotValidError{Console: consoleerrors.CreateConsoleError("WifiConfigsAPI")}
Functions ¶
func ErrorResponse ¶
func NewAmtRoutes ¶
func NewAmtRoutes(handler *gin.RouterGroup, d devices.Feature, amt amtexplorer.Feature, e export.Exporter, l logger.Interface)
func NewCIRACertRoutes ¶
func NewCIRACertRoutesWithReader ¶
func NewCIRACertRoutesWithReader(handler *gin.RouterGroup, l logger.Interface, certReader CertReader, cfg *config.Config)
NewCIRACertRoutesWithReader creates routes with a custom cert reader (for testing).
func NewCIRAConfigRoutes ¶
func NewCIRAConfigRoutes(handler *gin.RouterGroup, t ciraconfigs.Feature, l logger.Interface, cfg *config.Config)
func NewDeviceRoutes ¶
func NewDomainRoutes ¶
func NewIEEE8021xConfigRoutes ¶
func NewIEEE8021xConfigRoutes(handler *gin.RouterGroup, t ieee8021xconfigs.Feature, l logger.Interface)
func NewPackageRoutes ¶ added in v1.43.0
NewPackageRoutes registers the Download RPC endpoints under the given group.
func NewProfileRoutes ¶
func NewServerRoutes ¶ added in v1.31.0
func NewServerRoutes(handler *gin.RouterGroup, cfg *config.Config)
NewServerRoutes registers server-level capability endpoints. These expose how Console was started so clients can adapt their UI (e.g. show/hide the CIRA tab).
func NewWirelessConfigRoutes ¶
func NewWirelessConfigRoutes(handler *gin.RouterGroup, t wificonfigs.Feature, l logger.Interface)
func RepositoryError ¶
Types ¶
type CertReader ¶
CertReader defines the interface for reading certificate files.
type DomainCountResponse ¶
type FileCertReader ¶
type FileCertReader struct {
Path string
}
FileCertReader reads certificates from the filesystem.
func (*FileCertReader) ReadCert ¶
func (f *FileCertReader) ReadCert() ([]byte, error)
ReadCert reads the certificate from the configured file path.
type LoginRoute ¶
type LoginRoute struct {
Config *config.Config
Verifier *oidc.IDTokenVerifier
}
func NewLoginRoute ¶
func NewLoginRoute(configData *config.Config) *LoginRoute
NewVersionRoute creates a new version route
func (LoginRoute) JWTAuthMiddleware ¶
func (lr LoginRoute) JWTAuthMiddleware() gin.HandlerFunc
JWTAuthMiddleware accepts either the Authorization header (REST clients) or the session cookie (browser). The header wins, so REST clients are unchanged.
func (LoginRoute) Login ¶
func (lr LoginRoute) Login(c *gin.Context)
Login checks configured credentials and returns a JWT token for basic auth
func (LoginRoute) Logout ¶ added in v1.40.1
func (lr LoginRoute) Logout(c *gin.Context)
Logout expires the session cookies. Public, so an already-expired session can still clear its own. Not revocation: the JWT stays valid until it expires.
type OData ¶
type ValidationError ¶ added in v1.41.0
type ValidationError struct {
Max int
}
ValidationError represents a query parameter validation error with additional context.
func (*ValidationError) Error ¶ added in v1.41.0
func (e *ValidationError) Error() string
type VersionRoute ¶
func NewVersionRoute ¶
func NewVersionRoute(configData *config.Config) *VersionRoute
NewVersionRoute creates a new version route
func (VersionRoute) FetchLatestRelease ¶
FetchLatestRelease fetches the latest release information from GitHub API
func (VersionRoute) LatestReleaseHandler ¶
func (vr VersionRoute) LatestReleaseHandler(c *gin.Context)
LatestReleaseHandler is the Gin handler function to check for the latest release
type WirelessConfigRoutes ¶
type WirelessConfigRoutes struct {
// contains filtered or unexported fields
}
Source Files
¶
- alarms.go
- auditlog.go
- boot.go
- certs.go
- ciracert.go
- ciraconfigs.go
- ciradisabled.go
- consent.go
- devicemanagement.go
- devices.go
- domains.go
- error.go
- explorer.go
- export.go
- features.go
- hwinfo.go
- ieee8021xconfigs.go
- kvm.go
- linkpreference.go
- login.go
- network.go
- odata.go
- package.go
- power.go
- profiles.go
- server.go
- version.go
- wificonfigs.go
- wifiprofile.go
- wifiprofilesync.go
- wifistate.go