user

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 48 Imported by: 1

Documentation

Index

Constants

View Source
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 represents an error code specified in RFC 6749
	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"
)
View Source
const (

	// TplActivate template path for activate user
	TplActivate base.TplName = "user/auth/activate"
)

Variables

This section is empty.

Functions

func AccessTokenOAuth

func AccessTokenOAuth(ctx *context.Context)

AccessTokenOAuth manages all access token requests by the client

func Action

func Action(ctx *context.Context)

Action response for follow/unfollow user request

func Activate

func Activate(ctx *context.Context)

Activate render activate user page

func ActivateEmail

func ActivateEmail(ctx *context.Context)

ActivateEmail render the activate email page

func ActivatePost

func ActivatePost(ctx *context.Context)

ActivatePost handles account activation with password check

func AuthorizeOAuth

func AuthorizeOAuth(ctx *context.Context)

AuthorizeOAuth manages authorize requests

func AutoSignIn

func AutoSignIn(ctx *context.Context) (bool, error)

AutoSignIn reads cookie and try to auto-login.

func Avatar

func Avatar(ctx *context.Context)

Avatar redirect browser to user avatar of requested size

func AvatarByEmailHash

func AvatarByEmailHash(ctx *context.Context)

AvatarByEmailHash redirects the browser to the appropriate Avatar link

func ConnectOpenID

func ConnectOpenID(ctx *context.Context)

ConnectOpenID shows a form to connect an OpenID URI to an existing account

func ConnectOpenIDPost

func ConnectOpenIDPost(ctx *context.Context)

ConnectOpenIDPost handles submission of a form to connect an OpenID URI to an existing account

func Dashboard

func Dashboard(ctx *context.Context)

Dashboard render the dashboard page

func Email2User

func Email2User(ctx *context.Context)

Email2User show user page via email

func ForgotPasswd

func ForgotPasswd(ctx *context.Context)

ForgotPasswd render the forget password page

func ForgotPasswdPost

func ForgotPasswdPost(ctx *context.Context)

ForgotPasswdPost response for forget password request

func GetNotificationCount

func GetNotificationCount(c *context.Context)

GetNotificationCount is the middleware that sets the notification count in the context

func GetUserByName

func GetUserByName(ctx *context.Context, name string) *models.User

GetUserByName get user by name

func GetUserByParams

func GetUserByParams(ctx *context.Context) *models.User

GetUserByParams returns user whose name is presented in URL paramenter.

func GrantApplicationOAuth

func GrantApplicationOAuth(ctx *context.Context)

GrantApplicationOAuth manages the post request submitted when a user grants access to an application

func HandleSignOut

func HandleSignOut(ctx *context.Context)

HandleSignOut resets the session and sets the cookies

func InfoOAuth

func InfoOAuth(ctx *context.Context)

InfoOAuth manages request for userinfo endpoint

func Issues

func Issues(ctx *context.Context)

Issues renders the user's issues overview page

func LinkAccount

func LinkAccount(ctx *context.Context)

LinkAccount shows the page where the user can decide to login or create a new account

func LinkAccountPostRegister

func LinkAccountPostRegister(ctx *context.Context)

LinkAccountPostRegister handle the creation of a new account for an external account using signUp

func LinkAccountPostSignIn

func LinkAccountPostSignIn(ctx *context.Context)

LinkAccountPostSignIn handle the coupling of external account with another account using signIn

func Milestones

func Milestones(ctx *context.Context)

Milestones render the user milestones page

func MustChangePassword

func MustChangePassword(ctx *context.Context)

MustChangePassword renders the page to change a user's password

func MustChangePasswordPost

func MustChangePasswordPost(ctx *context.Context)

MustChangePasswordPost response for updating a user's password after his/her account was created by an admin

func NotificationPurgePost

func NotificationPurgePost(c *context.Context)

NotificationPurgePost is a route for 'purging' the list of notifications - marking all unread as read

func NotificationStatusPost

func NotificationStatusPost(c *context.Context)

NotificationStatusPost is a route for changing the status of a notification

func Notifications

func Notifications(c *context.Context)

Notifications is the notifications page

func OIDCKeys

func OIDCKeys(ctx *context.Context)

OIDCKeys generates the JSON Web Key Set

func OIDCWellKnown

func OIDCWellKnown(ctx *context.Context)

OIDCWellKnown generates JSON so OIDC clients know Gitea's capabilities

func Profile

func Profile(ctx *context.Context)

Profile render user's profile page

func Pulls

func Pulls(ctx *context.Context)

Pulls renders the user's pull request overview page

func RegisterOpenID

func RegisterOpenID(ctx *context.Context)

RegisterOpenID shows a form to create a new user authenticated via an OpenID URI

func RegisterOpenIDPost

func RegisterOpenIDPost(ctx *context.Context)

RegisterOpenIDPost handles submission of a form to create a new user authenticated via an OpenID URI

func ResetPasswd

func ResetPasswd(ctx *context.Context)

ResetPasswd render the account recovery page

func ResetPasswdPost

func ResetPasswdPost(ctx *context.Context)

ResetPasswdPost response from account recovery request

func ShowGPGKeys

func ShowGPGKeys(ctx *context.Context, uid int64)

ShowGPGKeys output all the public GPG keys of user by uid

func ShowSSHKeys

func ShowSSHKeys(ctx *context.Context, uid int64)

ShowSSHKeys output all the ssh keys of user by uid

func SignIn

func SignIn(ctx *context.Context)

SignIn render sign in page

func SignInOAuth

func SignInOAuth(ctx *context.Context)

SignInOAuth handles the OAuth2 login buttons

func SignInOAuthCallback

func SignInOAuthCallback(ctx *context.Context)

SignInOAuthCallback handles the callback from the given provider

func SignInOpenID

func SignInOpenID(ctx *context.Context)

SignInOpenID render sign in page

func SignInOpenIDPost

func SignInOpenIDPost(ctx *context.Context)

SignInOpenIDPost response for openid sign in request

func SignInPost

func SignInPost(ctx *context.Context)

SignInPost response for sign in request

func SignOut

func SignOut(ctx *context.Context)

SignOut sign out from login status

func SignUp

func SignUp(ctx *context.Context)

SignUp render the register page

func SignUpPost

func SignUpPost(ctx *context.Context)

SignUpPost response for sign up information submission

func TaskStatus

func TaskStatus(ctx *context.Context)

TaskStatus returns task's status

func TwoFactor

func TwoFactor(ctx *context.Context)

TwoFactor shows the user a two-factor authentication page.

func TwoFactorPost

func TwoFactorPost(ctx *context.Context)

TwoFactorPost validates a user's two-factor authentication token.

func TwoFactorScratch

func TwoFactorScratch(ctx *context.Context)

TwoFactorScratch shows the scratch code form for two-factor authentication.

func TwoFactorScratchPost

func TwoFactorScratchPost(ctx *context.Context)

TwoFactorScratchPost validates and invalidates a user's two-factor scratch token.

func U2F

func U2F(ctx *context.Context)

U2F shows the U2F login page

func U2FChallenge

func U2FChallenge(ctx *context.Context)

U2FChallenge submits a sign challenge to the browser

func U2FSign

func U2FSign(ctx *context.Context)

U2FSign authenticates the user by signResp

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 represents the according error in RFC 6749
	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 represents the according error in RFC 6749
	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"
)

type TokenType

type TokenType string

TokenType specifies the kind of token

const (
	// TokenTypeBearer represents a token type specified in RFC 6749
	TokenTypeBearer TokenType = "bearer"
	// TokenTypeMAC represents a token type specified in RFC 6749
	TokenTypeMAC = "mac"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL