Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer interface {
Authorize(session.Session) (DeauthorizeFunc, bool, error)
}
Authorizer interface is the basis for authorizers in the namespace ssh.session.authorizers. An erroed authorization should not require a call to DeauthorizeFunc.
type Chained ¶
type Chained struct { // The list of sub-authorizers to loop through to authorize a session. If an authorizer in the chain // fails, all the preiovusly successful authorization will be de-authorized. AuthorizersRaw []json.RawMessage `json:"authorize,omitempty" caddy:"namespace=ssh.session.authorizers inline_key=authorizer"` // contains filtered or unexported fields }
Chained is a multi-authorizer module that authorizes a session against multiple authorizers
func (*Chained) Authorize ¶
Authorize loops through the sub-authorizers in sequence asking for authorization and collects the de-authorizers in a stack. If an authorization fails, it will de-authorize the earlier pushed de-authorizers, except for the failed authorizer.
func (*Chained) CaddyModule ¶
func (c *Chained) CaddyModule() caddy.ModuleInfo
This method indicates that the type is a Caddy module. The returned ModuleInfo must have both a name and a constructor function. This method must not have any side-effects.
type DeauthorizeFunc ¶
type MaxSession ¶
type MaxSession struct { // The maximum number of active sessions MaxSessions uint64 `json:"max_sessions,omitempty"` // contains filtered or unexported fields }
MaxSession is an authorizer that permits sessions so long as the number of active sessions is below the specified maximum.
func (*MaxSession) Authorize ¶
func (ms *MaxSession) Authorize(sess session.Session) (DeauthorizeFunc, bool, error)
Authorize validates the current count of active sessions and issues an authorization if the addition of new session does not exceed the defined maximum number of allowed sessions.
func (*MaxSession) CaddyModule ¶
func (ms *MaxSession) CaddyModule() caddy.ModuleInfo
This method indicates that the type is a Caddy module. The returned ModuleInfo must have both a name and a constructor function. This method must not have any side-effects.
func (*MaxSession) Provision ¶
func (ms *MaxSession) Provision(ctx caddy.Context) error
Provision sets up the MaxSession authorizer
type Public ¶
type Public struct{}
Public authorizes all sessions
func (*Public) CaddyModule ¶
func (ms *Public) CaddyModule() caddy.ModuleInfo
This method indicates that the type is a Caddy module. The returned ModuleInfo must have both a name and a constructor function. This method must not have any side-effects.
type Reject ¶
type Reject struct{}
Reject rejects all sessions
func (*Reject) Authorize ¶
Authorize is an noop for this module, except for returning false to deny the session.
func (*Reject) CaddyModule ¶
func (ms *Reject) CaddyModule() caddy.ModuleInfo
This method indicates that the type is a Caddy module. The returned ModuleInfo must have both a name and a constructor function. This method must not have any side-effects.