m

package
v0.0.0-...-e3f99e4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClient

type AuthClient struct {
	Id          string   `json:"client_id"`
	Name        string   `json:"name"`
	Secret      string   `json:"client_secret"`
	Scopes      []string `json:"scope"`
	RedirectUri []string `json:"redirect_uri"`
}

type AuthCode

type AuthCode struct {
	ClientID string
	UserID   id.ID
	Scope    string
	ExpireAt time.Time
	Code     string
}

type AuthorizeHeader

type AuthorizeHeader struct {
	Authorization string `header:"Authorization"`
}

type AuthorizeLoginReq

type AuthorizeLoginReq struct {
	Username    string `form:"username"`
	Password    string `form:"password"`
	ClientId    string `form:"client_id"`
	RedirectURI string `form:"redirect_uri"`
	Scope       string `form:"scope"`
	State       string `form:"state"`

	CSRFToken string `form:"csrf_token"`
}

type ErrRes

type ErrRes struct {
	Error string `json:"error"`
	Msg   string `json:"msg"`
}

ErrRes is the response body for an error.

type RefreshToken

type RefreshToken struct {
	UserID       id.ID
	RefreshToken string
	ExpireAt     time.Time
	ClientID     string
	Scope        string
}

type SignUpReq

type SignUpReq struct {
	Username  string `form:"username"`
	Password  string `form:"password"`
	CSRFToken string `form:"csrf_token"`
}

UserNewReq is the request body for the POST /auth/user route

type StoreData

type StoreData struct {
	Ts   int64  `json:"ts"`
	Data string `json:"data"`
	From string `json:"from"` // the hostname that set this data
}

type Token

type Token struct {
	AccessToken           string `json:"access_token"`
	TokenType             string `json:"token_type"`
	ExpiresIn             int    `json:"expires_in"`
	Scope                 string `json:"scope"`
	RefreshToken          string `json:"refresh_token"`
	RefreshTokenExpiresIn int    `json:"refresh_token_expires_in"`
}

type TokenReq

type TokenReq struct {
	GrantType    string `form:"grant_type"`
	ClientId     string `form:"client_id"`
	ClientSecret string `form:"client_secret"`
	Code         string `form:"code"`
	RefreshToken string `form:"refresh_token"`
}

type UserInfo

type UserInfo struct {
	Sub   string `json:"sub"` // ID
	Name  string `json:"name"`
	Email string `json:"email"`
}

type UserNewRes

type UserNewRes struct {
	Error string `json:"error"`
	Id    id.ID  `json:"id"`
}

type UserPassword

type UserPassword struct {
	ID       id.ID  `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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