Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasicConfig ¶
type BasicConfig struct { // Username is the name which will need to be used for a successful authentication Username string `yaml:"username"` // PasswordSha512Hash is the SHA512 hash of the password which will need to be used for a successful authentication // XXX: Remove this on v4.0.0 // Deprecated: Use PasswordBcryptHashBase64Encoded instead PasswordSha512Hash string `yaml:"password-sha512"` // PasswordBcryptHashBase64Encoded is the base64 encoded string of the Bcrypt hash of the password to use to // authenticate using basic auth. PasswordBcryptHashBase64Encoded string `yaml:"password-bcrypt-base64"` }
BasicConfig is the configuration for Basic authentication
type Config ¶
type Config struct { Basic *BasicConfig `yaml:"basic,omitempty"` OIDC *OIDCConfig `yaml:"oidc,omitempty"` // contains filtered or unexported fields }
Config is the security configuration for Gatus
func (*Config) ApplySecurityMiddleware ¶ added in v3.5.0
ApplySecurityMiddleware applies an authentication middleware to the router passed. The router passed should be a subrouter in charge of handlers that require authentication.
func (*Config) IsAuthenticated ¶ added in v3.5.0
IsAuthenticated checks whether the user is authenticated If the Config does not warrant authentication, it will always return true.
type OIDCConfig ¶ added in v3.5.0
type OIDCConfig struct { IssuerURL string `yaml:"issuer-url"` // e.g. https://dev-12345678.okta.com RedirectURL string `yaml:"redirect-url"` // e.g. http://localhost:8080/authorization-code/callback ClientID string `yaml:"client-id"` ClientSecret string `yaml:"client-secret"` Scopes []string `yaml:"scopes"` // e.g. ["openid"] AllowedSubjects []string `yaml:"allowed-subjects"` // e.g. ["user1@example.com"]. If empty, all subjects are allowed // contains filtered or unexported fields }
OIDCConfig is the configuration for OIDC authentication
Click to show internal directories.
Click to hide internal directories.