security

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(handler http.HandlerFunc, security *Config) http.HandlerFunc

Handler takes care of security for a given handler with the given security configuratioon

func Sha512

func Sha512(s string) string

Sha512 hashes a provided string using SHA512 and returns the resulting hash as a string

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
	PasswordSha512Hash string `yaml:"password-sha512"`
}

BasicConfig is the configuration for Basic authentication

func (*BasicConfig) IsValid

func (c *BasicConfig) IsValid() bool

IsValid returns whether the basic security configuration is valid or not

type Config

type Config struct {
	Basic *BasicConfig `yaml:"basic"`
}

Config is the security configuration for Gatus

func (*Config) IsValid

func (c *Config) IsValid() bool

IsValid returns whether the security configuration is valid or not

Jump to

Keyboard shortcuts

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