Documentation ¶
Index ¶
- type Handler
- func (h *Handler) Build(opts ...connect.HandlerOption) (string, http.Handler)
- func (h *Handler) Delete(ctx context.Context, req *connect.Request[authentication.DeleteRequest]) (*connect.Response[authentication.DeleteResponse], error)
- func (h *Handler) Get(ctx context.Context, req *connect.Request[authentication.GetRequest]) (*connect.Response[authentication.GetResponse], error)
- func (h *Handler) GetAuthConfig(ctx context.Context, req *connect.Request[authentication.GetAuthConfigRequest]) (resp *connect.Response[authentication.GetAuthConfigResponse], err error)
- func (h *Handler) Login(ctx context.Context, req *connect.Request[authentication.LoginRequest]) (*connect.Response[authentication.LoginResponse], error)
- func (h *Handler) Logout(ctx context.Context, req *connect.Request[authentication.LogoutRequest]) (*connect.Response[authentication.LogoutResponse], error)
- func (h *Handler) RefreshToken(ctx context.Context, req *connect.Request[authentication.RefreshTokenRequest]) (*connect.Response[authentication.RefreshTokenResponse], error)
- func (h *Handler) Register(ctx context.Context, req *connect.Request[authentication.RegisterRequest]) (*connect.Response[authentication.RegisterResponse], error)
- func (h *Handler) ResetPassword(ctx context.Context, req *connect.Request[authentication.ResetPasswordRequest]) (*connect.Response[authentication.ResetPasswordResponse], error)
- func (h *Handler) SendPasswordReset(ctx context.Context, ...) (*connect.Response[authentication.SendPasswordResetResponse], error)
- func (h *Handler) ServiceName() string
- func (h *Handler) VerifyEmail(ctx context.Context, req *connect.Request[authentication.VerifyEmailRequest]) (*connect.Response[authentication.VerifyEmailResponse], error)
- func (h *Handler) VerifyPhoneNumber(ctx context.Context, ...) (*connect.Response[authentication.VerifyPhoneNumberResponse], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
func (*Handler) Delete ¶
func (h *Handler) Delete(ctx context.Context, req *connect.Request[authentication.DeleteRequest]) (*connect.Response[authentication.DeleteResponse], error)
Delete removes a user from the namespace.
func (*Handler) Get ¶
func (h *Handler) Get(ctx context.Context, req *connect.Request[authentication.GetRequest]) (*connect.Response[authentication.GetResponse], error)
Get fetches a user from the namespace using its id in the access token.
func (*Handler) GetAuthConfig ¶
func (h *Handler) GetAuthConfig(ctx context.Context, req *connect.Request[authentication.GetAuthConfigRequest]) (resp *connect.Response[authentication.GetAuthConfigResponse], err error)
GetAuthConfig this returns a config for a specific namespace together with urls to all OIDC providers.
func (*Handler) Login ¶
func (h *Handler) Login(ctx context.Context, req *connect.Request[authentication.LoginRequest]) (*connect.Response[authentication.LoginResponse], error)
Login validates a user credentials and issues a access/refresh token pair used to validate requests.
func (*Handler) Logout ¶
func (h *Handler) Logout(ctx context.Context, req *connect.Request[authentication.LogoutRequest]) (*connect.Response[authentication.LogoutResponse], error)
Logout validates the access token and blocks it in the database for future attempts.
func (*Handler) RefreshToken ¶
func (h *Handler) RefreshToken(ctx context.Context, req *connect.Request[authentication.RefreshTokenRequest]) (*connect.Response[authentication.RefreshTokenResponse], error)
RefreshToken issues a new access/refresh token pair from the refresh token.
func (*Handler) Register ¶
func (h *Handler) Register(ctx context.Context, req *connect.Request[authentication.RegisterRequest]) (*connect.Response[authentication.RegisterResponse], error)
Register inserts new user in the namespace.
func (*Handler) ResetPassword ¶
func (h *Handler) ResetPassword(ctx context.Context, req *connect.Request[authentication.ResetPasswordRequest]) (*connect.Response[authentication.ResetPasswordResponse], error)
ResetPassword updates the users password if the provided code can be validated by the hash.
func (*Handler) SendPasswordReset ¶
func (h *Handler) SendPasswordReset(ctx context.Context, req *connect.Request[authentication.SendPasswordResetRequest]) (*connect.Response[authentication.SendPasswordResetResponse], error)
SendResetPasswordEmail sends an email to the user with a code used to reset his/her password.
func (*Handler) ServiceName ¶
func (*Handler) VerifyEmail ¶
func (h *Handler) VerifyEmail(ctx context.Context, req *connect.Request[authentication.VerifyEmailRequest]) (*connect.Response[authentication.VerifyEmailResponse], error)
func (*Handler) VerifyPhoneNumber ¶
func (h *Handler) VerifyPhoneNumber(ctx context.Context, req *connect.Request[authentication.VerifyPhoneNumberRequest]) (*connect.Response[authentication.VerifyPhoneNumberResponse], error)