Documentation
¶
Index ¶
- Variables
- func Authenticator(next http.Handler) http.Handler
- func GetID(r *http.Request) (id string, err error)
- func GetRole(r *http.Request) (role user.Role, err error)
- func WithID(id ...string) func(next http.Handler) http.Handler
- func WithRole(roles ...user.Role) func(next http.Handler) http.Handler
- type FirebaseAuth
- type Key
- type Repository
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotAuthorized = errors.New("not authorized") ErrInsufficientPrivileges = errors.New("insufficient privileges") ErrIDNotFound = errors.New("user ID not found") ErrIDNoValid = errors.New("user ID is not valid") ErrRoleNotFound = errors.New("user role not found") ErrRoleNoValid = errors.New("user role is not valid") )
Errors
Functions ¶
func Authenticator ¶
Authenticator is an authentication middleware.
Types ¶
type FirebaseAuth ¶
type FirebaseAuth struct {
// contains filtered or unexported fields
}
FirebaseAuth is a wrapper to firebase client.
func NewFirebaseAuth ¶
func NewFirebaseAuth(ctx context.Context, credentialsFilePath string) (*FirebaseAuth, error)
NewFirebaseAuth returns a new FirebaseAuth with configuration.
func (*FirebaseAuth) GetFirebaseClient ¶
func (fa *FirebaseAuth) GetFirebaseClient() *auth.Client
GetFirebaseClient returns the FireBase's Client.
func (*FirebaseAuth) GetFirebaseUser ¶
GetFirebaseUser returns an user from firebase auth.
Click to show internal directories.
Click to hide internal directories.