Documentation
¶
Index ¶
- Variables
- func PrincipalACLHandlerFunc(cfg PrincipalACLConfig, logger zerolog.Logger, next http.Handler) http.HandlerFunc
- type Listener
- type NetworkACL
- func (a *NetworkACL) Allow(n *net.IPNet)
- func (a *NetworkACL) AllowFromString(n string) error
- func (a *NetworkACL) Authorise(addr *net.TCPAddr) bool
- func (a *NetworkACL) AuthoriseConn(c net.Conn) (bool, error)
- func (a *NetworkACL) AuthoriseFromString(addr string) (bool, error)
- func (a *NetworkACL) Deny(net *net.IPNet)
- func (a *NetworkACL) DenyFromString(n string) error
- type NetworkACLConfig
- type PrincipalACLConfig
- type PrincipalACLHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EmptyGitHubAuthClientConfig = NetworkACLConfig{}
)
View Source
var (
EmptyPrincipalACLConfig = PrincipalACLConfig{}
)
Functions ¶
func PrincipalACLHandlerFunc ¶
func PrincipalACLHandlerFunc(cfg PrincipalACLConfig, logger zerolog.Logger, next http.Handler) http.HandlerFunc
Types ¶
type Listener ¶
type Listener struct {
NetworkACL *NetworkACL
Listener net.Listener
Logger zerolog.Logger
}
type NetworkACL ¶
type NetworkACL struct {
Config NetworkACLConfig
// contains filtered or unexported fields
}
func NewNetworkACL ¶
func NewNetworkACL(cfg NetworkACLConfig) (*NetworkACL, error)
func (*NetworkACL) Allow ¶
func (a *NetworkACL) Allow(n *net.IPNet)
func (*NetworkACL) AllowFromString ¶
func (a *NetworkACL) AllowFromString(n string) error
func (*NetworkACL) Authorise ¶
func (a *NetworkACL) Authorise(addr *net.TCPAddr) bool
Authorise if both allow is checked first, if empty if ip is in allow but also matches deny, authorisation is denied this is to allow people to deny subsets of allowed CIDR ranges.
func (*NetworkACL) AuthoriseConn ¶
func (a *NetworkACL) AuthoriseConn(c net.Conn) (bool, error)
func (*NetworkACL) AuthoriseFromString ¶
func (a *NetworkACL) AuthoriseFromString(addr string) (bool, error)
func (*NetworkACL) Deny ¶
func (a *NetworkACL) Deny(net *net.IPNet)
func (*NetworkACL) DenyFromString ¶
func (a *NetworkACL) DenyFromString(n string) error
type NetworkACLConfig ¶
type NetworkACLConfig struct {
AllowedNets []string `mapstructure:"allow"`
DeniedNets []string `mapstructure:"deny"`
AllowByDefault bool `mapstructure:"allow-by-default"`
}
func (NetworkACLConfig) IsEmpty ¶
func (n NetworkACLConfig) IsEmpty() bool
type PrincipalACLConfig ¶
type PrincipalACLConfig struct {
AllowList []string `mapstructure:"allow-list"`
DenyList []string `mapstructure:"deny-list"`
}
func (PrincipalACLConfig) IsEmpty ¶
func (c PrincipalACLConfig) IsEmpty() bool
type PrincipalACLHandler ¶
type PrincipalACLHandler struct {
Config PrincipalACLConfig
Logger zerolog.Logger
// contains filtered or unexported fields
}
func (PrincipalACLHandler) ServeHTTP ¶
func (h PrincipalACLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.