domain

package
v0.0.0-...-634509b Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Token     string    `gorm:"primaryKey"`
	UserId    string    `gorm:"not null"`
	ClientId  string    `gorm:"not null"`
	Scope     string    `gorm:"not null"`
	ExpiredAt time.Time `gorm:"not null"`
}

type AuthorizationCode

type AuthorizationCode struct {
	Code        string    `gorm:"primaryKey"`
	UserId      string    `gorm:"not null"`
	ClientId    string    `gorm:"not null"`
	Scope       string    `gorm:"not null"`
	RedirectUri string    `gorm:"not null"`
	ExpiredAt   time.Time `gorm:"not null"`
}

type Authorize

type Authorize struct{}

type AuthorizeRequest

type AuthorizeRequest struct {
	ResponseType        ResponseType            `form:"response_type" binding:"required"`
	ClientId            string                  `form:"client_id" binding:"required"`
	RedirectUri         string                  `form:"redirect_uri" binding:"required"`
	Scope               string                  `form:"scope" binding:"required"`
	State               string                  `form:"state" binding:"required"`
	CodeChallenge       string                  `form:"code_challenge" binding:"required"`
	CodeChallengeMethod CodeChallengeMethodType `form:"code_challenge_method" binding:"required"`
}

func (*AuthorizeRequest) CodeChallengeMethodS256

func (r *AuthorizeRequest) CodeChallengeMethodS256() bool

func (*AuthorizeRequest) ResponseTypeCode

func (r *AuthorizeRequest) ResponseTypeCode() bool

type Client

type Client struct {
	ClientId     string
	ClientName   string
	RedirectUris []string
}

func (*Client) FindRedirectUri

func (c *Client) FindRedirectUri(uri string) (string, error)

type CodeChallenge

type CodeChallenge struct {
	AuthorizationCode   string                  `gorm:"primaryKey"`
	CodeChallenge       string                  `gorm:"not null"`
	CodeChallengeMethod CodeChallengeMethodType `gorm:"not null;type:char(4)"`
}

func (*CodeChallenge) Verify

func (c *CodeChallenge) Verify(verifier string) bool

type CodeChallengeMethodType

type CodeChallengeMethodType string
const (
	CodeChallengeMethodS256 CodeChallengeMethodType = "S256"
)

type Decision

type Decision struct {
	Location string
}

type DecisionRequest

type DecisionRequest struct {
	Email    string `form:"email" binding:"required"`
	Password string `form:"password" binding:"required"`
}

type ErrorCode

type ErrorCode string
const (
	InvalidRequest       ErrorCode = "invalid_request"
	InvalidClient        ErrorCode = "invalid_client"
	InvalidGrant         ErrorCode = "invalid_grant"
	UnauthorizedClient   ErrorCode = "unauthorized_client"
	UnsupportedGrantType ErrorCode = "unsupported_grant_type"
	InvalidScope         ErrorCode = "invalid_scope"
)

type HTTPEmpty

type HTTPEmpty struct{}

type HTTPError

type HTTPError struct {
	Error            ErrorCode `json:"error"`
	ErrorDescription string    `json:"error_description"`
	ErrorUri         string    `json:"error_uri"`
}

type ResponseType

type ResponseType string
const (
	ResponseTypeCode ResponseType = "code"
)

type Scope

type Scope struct {
	Name string
}

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiredIn   int    `json:"expired_in"`
	Scope       string `json:"scope"`
}

type TokenRequest

type TokenRequest struct {
	GrantType    string `json:"grant_type" binding:"required,oneof=authorization_code"`
	Code         string `json:"code" binding:"required"`
	RedirectUri  string `json:"redirect_uri" binding:"required"`
	ClientId     string `json:"client_id" binding:"required"`
	CodeVerifier string `json:"code_verifier" binding:"required"`
}

type User

type User struct {
	Id       string `gorm:"primaryKey"`
	Email    string `gorm:"not null;type:varchar(320)"`
	Password string `gorm:"not null"`
}

Jump to

Keyboard shortcuts

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