Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(req *http.Request) (*database.User, error)
- func AuthenticateForSocket(ctx context.Context, token, host string) (*database.User, error)
- func Init(conf *config.Config, sessionStore session.Store, ...)
- func InitInterceptor(conf *config.Config, user database.UserDatabase, token database.TokenDatabase)
- 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 AuthenticateForSocket ¶
func Init ¶
func Init(conf *config.Config, sessionStore session.Store, userDatabase database.UserDatabase, tokenDatabase database.TokenDatabase, revokedCert revokedCertClient)
Init is initializing authenticator. You must call first before calling Authenticate.
func InitInterceptor ¶
func InitInterceptor(conf *config.Config, user database.UserDatabase, token database.TokenDatabase)
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.