Documentation
¶
Index ¶
- Constants
- Variables
- func SessionCheckerMiddleware(checker domain.SessionChecker) mux.MiddlewareFunc
- func Start(ctx context.Context, addr string, conf *config.Settings, ...) error
- func UserIDFromContext(ctx context.Context) string
- func WithUserID(ctx context.Context, id string) context.Context
- type AuthHandler
- type CreateTokenRequest
- type HeaderKey
Constants ¶
View Source
const ( HeaderTokenID = "X-Auth-Id" HeaderTokenName = "X-Auth-Name" HeaderUserID = "X-User-Id" )
Variables ¶
View Source
var ( // ErrInvalidToken returned, if ApiKey/X-Api-Key is not valid. ErrInvalidToken = httputil.NewError(http.StatusUnauthorized, "auth.token.is_not_valid") // ErrTokenRevoked returned, if ApiKey/X-Api-Key was temporary disabled. ErrTokenRevoked = httputil.NewError(http.StatusUnauthorized, "auth.token.revoked") // ErrAccessDenied returned, if ip address is blacklisted. ErrAccessDenied = httputil.NewError(http.StatusForbidden, "auth.access_denied") )
View Source
var (
)
Functions ¶
func SessionCheckerMiddleware ¶ added in v0.0.23
func SessionCheckerMiddleware(checker domain.SessionChecker) mux.MiddlewareFunc
func Start ¶
func Start(ctx context.Context, addr string, conf *config.Settings, pub eventapi.Publisher, store domain.Store, svc domain.UserService, checker domain.SessionChecker) error
Start starts the server with specified store.
func UserIDFromContext ¶ added in v0.0.21
Types ¶
type AuthHandler ¶ added in v0.0.21
type AuthHandler struct {
// contains filtered or unexported fields
}
type CreateTokenRequest ¶ added in v0.0.21
type CreateTokenRequest struct {
Name string `json:"name"`
}
Click to show internal directories.
Click to hide internal directories.