Documentation ¶
Index ¶
- func FetchJWKS() error
- func GenerateTokensAndSetCookies(user *user.User, c echo.Context) error
- func GetJWTRefreshSecret() string
- func GetJWTSecret() string
- func GetUserClaims(c echo.Context) *ent.User
- func GetUserMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func GuardMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func JWTErrorChecker(err error, c echo.Context) error
- func UserRoleMiddleware(role utils.Role) echo.MiddlewareFunc
- type ChangePassword
- type Claims
- type CustomContext
- type OAuthClaims
- type OAuthResponse
- type Service
- func (s *Service) ChangePassword(c *CustomContext, passwordDto ChangePassword) error
- func (s *Service) Login(c echo.Context, uDto user.User) (*ent.User, error)
- func (s *Service) Me(c *CustomContext) (*ent.User, error)
- func (s *Service) OAuthCallback(c echo.Context) error
- func (s *Service) OAuthLogout(c echo.Context) error
- func (s *Service) OAuthRedirect(c echo.Context) error
- func (s *Service) OAuthTokenRefresh(c echo.Context, refreshToken string) error
- func (s *Service) OAuthUserCheck(c echo.Context, idTokenClaims UserInfo) error
- func (s *Service) Refresh(c echo.Context, refreshToken string) error
- func (s *Service) Register(c echo.Context, user user.User) (*ent.User, error)
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTokensAndSetCookies ¶
GenerateTokensAndSetCookies generates jwt token and saves it to the http-only cookie.
func GetJWTRefreshSecret ¶
func GetJWTRefreshSecret() string
func GetJWTSecret ¶
func GetJWTSecret() string
func GetUserClaims ¶
GetUserClaims - returns user's claims
func GetUserMiddleware ¶
func GetUserMiddleware(next echo.HandlerFunc) echo.HandlerFunc
func GuardMiddleware ¶ added in v1.0.8
func GuardMiddleware(next echo.HandlerFunc) echo.HandlerFunc
func JWTErrorChecker ¶
JWTErrorChecker will be executed when user try to access a protected path.
func UserRoleMiddleware ¶
Types ¶
type ChangePassword ¶
type CustomContext ¶
type OAuthClaims ¶ added in v1.0.8
type OAuthClaims struct { jwt.RegisteredClaims // contains filtered or unexported fields }
type OAuthResponse ¶ added in v1.0.8
type Service ¶
type Service struct { Store *database.Database OAuth struct { Provider *oidc.Provider Config oauth2.Config } }
func NewService ¶
func (*Service) ChangePassword ¶
func (s *Service) ChangePassword(c *CustomContext, passwordDto ChangePassword) error
func (*Service) OAuthCallback ¶ added in v1.0.8
func (*Service) OAuthLogout ¶ added in v1.0.8
func (*Service) OAuthRedirect ¶ added in v1.0.8
func (*Service) OAuthTokenRefresh ¶ added in v1.0.8
func (*Service) OAuthUserCheck ¶ added in v1.0.8
type UserInfo ¶ added in v1.0.8
type UserInfo struct { Sub string `json:"sub"` Exp int64 `json:"exp"` Iat int64 `json:"iat"` Name string `json:"name"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` PreferredUsername string `json:"preferred_username"` NickName string `json:"nickname"` Groups []string `json:"groups"` }
func CheckOAuthAccessToken ¶ added in v1.0.8
Click to show internal directories.
Click to hide internal directories.