Documentation ¶
Index ¶
- Constants
- func AccessTokenOAuth(ctx *context.Context)
- func Action(ctx *context.Context)
- func Activate(ctx *context.Context)
- func ActivateEmail(ctx *context.Context)
- func ActivatePost(ctx *context.Context)
- func AuthorizeOAuth(ctx *context.Context)
- func AutoSignIn(ctx *context.Context) (bool, error)
- func Avatar(ctx *context.Context)
- func AvatarByEmailHash(ctx *context.Context)
- func ConnectOpenID(ctx *context.Context)
- func ConnectOpenIDPost(ctx *context.Context)
- func Dashboard(ctx *context.Context)
- func Email2User(ctx *context.Context)
- func ForgotPasswd(ctx *context.Context)
- func ForgotPasswdPost(ctx *context.Context)
- func GetNotificationCount(c *context.Context)
- func GetUserByName(ctx *context.Context, name string) *models.User
- func GetUserByParams(ctx *context.Context) *models.User
- func GrantApplicationOAuth(ctx *context.Context)
- func HandleSignOut(ctx *context.Context)
- func InfoOAuth(ctx *context.Context)
- func Issues(ctx *context.Context)
- func LinkAccount(ctx *context.Context)
- func LinkAccountPostRegister(ctx *context.Context)
- func LinkAccountPostSignIn(ctx *context.Context)
- func Milestones(ctx *context.Context)
- func MustChangePassword(ctx *context.Context)
- func MustChangePasswordPost(ctx *context.Context)
- func NotificationPurgePost(c *context.Context)
- func NotificationStatusPost(c *context.Context)
- func Notifications(c *context.Context)
- func OIDCKeys(ctx *context.Context)
- func OIDCWellKnown(ctx *context.Context)
- func Profile(ctx *context.Context)
- func Pulls(ctx *context.Context)
- func RegisterOpenID(ctx *context.Context)
- func RegisterOpenIDPost(ctx *context.Context)
- func ResetPasswd(ctx *context.Context)
- func ResetPasswdPost(ctx *context.Context)
- func ShowGPGKeys(ctx *context.Context, uid int64)
- func ShowSSHKeys(ctx *context.Context, uid int64)
- func SignIn(ctx *context.Context)
- func SignInOAuth(ctx *context.Context)
- func SignInOAuthCallback(ctx *context.Context)
- func SignInOpenID(ctx *context.Context)
- func SignInOpenIDPost(ctx *context.Context)
- func SignInPost(ctx *context.Context)
- func SignOut(ctx *context.Context)
- func SignUp(ctx *context.Context)
- func SignUpPost(ctx *context.Context)
- func TaskStatus(ctx *context.Context)
- func TwoFactor(ctx *context.Context)
- func TwoFactorPost(ctx *context.Context)
- func TwoFactorScratch(ctx *context.Context)
- func TwoFactorScratchPost(ctx *context.Context)
- func U2F(ctx *context.Context)
- func U2FChallenge(ctx *context.Context)
- func U2FSign(ctx *context.Context)
- type AccessTokenError
- type AccessTokenErrorCode
- type AccessTokenResponse
- type AuthorizeError
- type AuthorizeErrorCode
- type BearerTokenError
- type BearerTokenErrorCode
- type TokenType
Constants ¶
const ( // AccessTokenErrorCodeInvalidRequest represents an error code specified in RFC 6749 AccessTokenErrorCodeInvalidRequest AccessTokenErrorCode = "invalid_request" // AccessTokenErrorCodeInvalidClient represents an error code specified in RFC 6749 AccessTokenErrorCodeInvalidClient = "invalid_client" // AccessTokenErrorCodeInvalidGrant represents an error code specified in RFC 6749 AccessTokenErrorCodeInvalidGrant = "invalid_grant" AccessTokenErrorCodeUnauthorizedClient = "unauthorized_client" // AccessTokenErrorCodeUnsupportedGrantType represents an error code specified in RFC 6749 AccessTokenErrorCodeUnsupportedGrantType = "unsupported_grant_type" // AccessTokenErrorCodeInvalidScope represents an error code specified in RFC 6749 AccessTokenErrorCodeInvalidScope = "invalid_scope" )
const ( // TplActivate template path for activate user TplActivate base.TplName = "user/auth/activate" )
Variables ¶
This section is empty.
Functions ¶
func AccessTokenOAuth ¶
AccessTokenOAuth manages all access token requests by the client
func ActivateEmail ¶
ActivateEmail render the activate email page
func ActivatePost ¶
ActivatePost handles account activation with password check
func AuthorizeOAuth ¶
AuthorizeOAuth manages authorize requests
func AutoSignIn ¶
AutoSignIn reads cookie and try to auto-login.
func AvatarByEmailHash ¶
AvatarByEmailHash redirects the browser to the appropriate Avatar link
func ConnectOpenID ¶
ConnectOpenID shows a form to connect an OpenID URI to an existing account
func ConnectOpenIDPost ¶
ConnectOpenIDPost handles submission of a form to connect an OpenID URI to an existing account
func ForgotPasswd ¶
ForgotPasswd render the forget password page
func ForgotPasswdPost ¶
ForgotPasswdPost response for forget password request
func GetNotificationCount ¶
GetNotificationCount is the middleware that sets the notification count in the context
func GetUserByName ¶
GetUserByName get user by name
func GetUserByParams ¶
GetUserByParams returns user whose name is presented in URL paramenter.
func GrantApplicationOAuth ¶
GrantApplicationOAuth manages the post request submitted when a user grants access to an application
func HandleSignOut ¶
HandleSignOut resets the session and sets the cookies
func LinkAccount ¶
LinkAccount shows the page where the user can decide to login or create a new account
func LinkAccountPostRegister ¶
LinkAccountPostRegister handle the creation of a new account for an external account using signUp
func LinkAccountPostSignIn ¶
LinkAccountPostSignIn handle the coupling of external account with another account using signIn
func MustChangePassword ¶
MustChangePassword renders the page to change a user's password
func MustChangePasswordPost ¶
MustChangePasswordPost response for updating a user's password after his/her account was created by an admin
func NotificationPurgePost ¶
NotificationPurgePost is a route for 'purging' the list of notifications - marking all unread as read
func NotificationStatusPost ¶
NotificationStatusPost is a route for changing the status of a notification
func OIDCWellKnown ¶
OIDCWellKnown generates JSON so OIDC clients know Gitea's capabilities
func RegisterOpenID ¶
RegisterOpenID shows a form to create a new user authenticated via an OpenID URI
func RegisterOpenIDPost ¶
RegisterOpenIDPost handles submission of a form to create a new user authenticated via an OpenID URI
func ResetPasswd ¶
ResetPasswd render the account recovery page
func ResetPasswdPost ¶
ResetPasswdPost response from account recovery request
func ShowGPGKeys ¶
ShowGPGKeys output all the public GPG keys of user by uid
func ShowSSHKeys ¶
ShowSSHKeys output all the ssh keys of user by uid
func SignInOAuth ¶
SignInOAuth handles the OAuth2 login buttons
func SignInOAuthCallback ¶
SignInOAuthCallback handles the callback from the given provider
func SignInOpenIDPost ¶
SignInOpenIDPost response for openid sign in request
func SignUpPost ¶
SignUpPost response for sign up information submission
func TwoFactorPost ¶
TwoFactorPost validates a user's two-factor authentication token.
func TwoFactorScratch ¶
TwoFactorScratch shows the scratch code form for two-factor authentication.
func TwoFactorScratchPost ¶
TwoFactorScratchPost validates and invalidates a user's two-factor scratch token.
func U2FChallenge ¶
U2FChallenge submits a sign challenge to the browser
Types ¶
type AccessTokenError ¶
type AccessTokenError struct { ErrorCode AccessTokenErrorCode `json:"error" form:"error"` ErrorDescription string `json:"error_description"` }
AccessTokenError represents an error response specified in RFC 6749
func (AccessTokenError) Error ¶
func (err AccessTokenError) Error() string
Error returns the error message
type AccessTokenErrorCode ¶
type AccessTokenErrorCode string
AccessTokenErrorCode represents an error code specified in RFC 6749
type AccessTokenResponse ¶
type AccessTokenResponse struct { AccessToken string `json:"access_token"` TokenType TokenType `json:"token_type"` ExpiresIn int64 `json:"expires_in"` RefreshToken string `json:"refresh_token"` IDToken string `json:"id_token,omitempty"` }
AccessTokenResponse represents a successful access token response
type AuthorizeError ¶
type AuthorizeError struct { ErrorCode AuthorizeErrorCode `json:"error" form:"error"` ErrorDescription string State string }
AuthorizeError represents an error type specified in RFC 6749
func (AuthorizeError) Error ¶
func (err AuthorizeError) Error() string
Error returns the error message
type AuthorizeErrorCode ¶
type AuthorizeErrorCode string
AuthorizeErrorCode represents an error code specified in RFC 6749
const ( // ErrorCodeInvalidRequest represents the according error in RFC 6749 ErrorCodeInvalidRequest AuthorizeErrorCode = "invalid_request" ErrorCodeUnauthorizedClient AuthorizeErrorCode = "unauthorized_client" // ErrorCodeAccessDenied represents the according error in RFC 6749 ErrorCodeAccessDenied AuthorizeErrorCode = "access_denied" // ErrorCodeUnsupportedResponseType represents the according error in RFC 6749 ErrorCodeUnsupportedResponseType AuthorizeErrorCode = "unsupported_response_type" // ErrorCodeInvalidScope represents the according error in RFC 6749 ErrorCodeInvalidScope AuthorizeErrorCode = "invalid_scope" // ErrorCodeServerError represents the according error in RFC 6749 ErrorCodeServerError AuthorizeErrorCode = "server_error" ErrorCodeTemporaryUnavailable AuthorizeErrorCode = "temporarily_unavailable" )
type BearerTokenError ¶
type BearerTokenError struct { ErrorCode BearerTokenErrorCode `json:"error" form:"error"` ErrorDescription string `json:"error_description"` }
BearerTokenError represents an error response specified in RFC 6750
type BearerTokenErrorCode ¶
type BearerTokenErrorCode string
BearerTokenErrorCode represents an error code specified in RFC 6750
const ( // BearerTokenErrorCodeInvalidRequest represents an error code specified in RFC 6750 BearerTokenErrorCodeInvalidRequest BearerTokenErrorCode = "invalid_request" // BearerTokenErrorCodeInvalidToken represents an error code specified in RFC 6750 BearerTokenErrorCodeInvalidToken BearerTokenErrorCode = "invalid_token" // BearerTokenErrorCodeInsufficientScope represents an error code specified in RFC 6750 BearerTokenErrorCodeInsufficientScope BearerTokenErrorCode = "insufficient_scope" )