Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(ctx context.Context, req *http.Request) (*database.User, *session.Session, error)
- func AuthenticateSocket(ctx context.Context, token, host string) (*configv2.Backend, *database.User, error)
- func Init(conf *configv2.Config, sessionStore session.Store, ...)
- func NewAccessToken(name, userId, issuer string) (*database.AccessToken, error)
- func StreamInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
Constants ¶
View Source
const (
AccessTokenLength = 32
)
Variables ¶
View Source
var ( ErrHostnameNotFound = xerrors.New("auth: hostname not found") ErrSessionNotFound = xerrors.New("auth: session not found") ErrInvalidCertificate = xerrors.New("auth: invalid certificate") ErrInvalidToken = xerrors.New("auth: invalid token") ErrUserNotFound = xerrors.New("auth: user not found") ErrNotAllowed = xerrors.New("auth: not allowed") )
Functions ¶
func Authenticate ¶
func AuthenticateSocket ¶ added in v0.11.0
func Init ¶
func Init(conf *configv2.Config, sessionStore session.Store, userDatabase database.UserDatabase, tokenDatabase database.TokenDatabase, revokedCert revokedCertClient)
Init is initializing authenticator. You must call first before calling Authenticate.
func NewAccessToken ¶
func NewAccessToken(name, userId, issuer string) (*database.AccessToken, error)
func StreamInterceptor ¶
func StreamInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
func UnaryInterceptor ¶
func UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.