security

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JWTSigningMethod string
	JWTSigningKey    []byte
)

JWT config values

Functions

func CreateJWTToken

func CreateJWTToken() *jwt.Token

CreateJWTToken return token based on config value. `security.auth_schemes.jwt_auth.signing_method` on security.conf

Types

type AuthenticationProvider

type AuthenticationProvider struct{}

AuthenticationProvider struct implements `authc.Authenticator` interface.

func (*AuthenticationProvider) GetAuthenticationInfo

func (a *AuthenticationProvider) GetAuthenticationInfo(authcToken *authc.AuthenticationToken) (*authc.AuthenticationInfo, error)

GetAuthenticationInfo method is `authc.Authenticator` interface. It is called by Security Manager.

func (*AuthenticationProvider) Init

func (a *AuthenticationProvider) Init(cfg *config.Config) error

Init method initializes the AuthenticationProvider, this method gets called during server start up.

type AuthorizationProvider

type AuthorizationProvider struct{}

AuthorizationProvider struct implements `authz.Authorizer` interface.

func (*AuthorizationProvider) GetAuthorizationInfo

func (a *AuthorizationProvider) GetAuthorizationInfo(authcInfo *authc.AuthenticationInfo) *authz.AuthorizationInfo

GetAuthorizationInfo method is `authz.Authorizer` interface.

GetAuthorizationInfo method gets called after authentication is successful to get Subject's (aka User) access control information such as roles and permissions. It is called by Security Manager.

func (*AuthorizationProvider) Init

func (a *AuthorizationProvider) Init(cfg *config.Config) error

Init method initializes the AuthorizationProvider, this method gets called during server start up.

Jump to

Keyboard shortcuts

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