authed

package
v0.0.0-...-8c2001a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type About

type About struct {
	UserInfo User `json:"user_info,omitempty"`
	OrgInfo  Org  `json:"org_info,omitempty"`
}

type AltAuthMethod

type AltAuthMethod struct {
	Id       int64  `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	Type     string `json:"type,omitempty"`
	Provider string `json:"provider,omitempty"`
}

type AuthFinishRequest

type AuthFinishRequest struct {
	SiteToken      string `json:"site_token,omitempty"`
	PreAuthedToken string `json:"preauthed_token,omitempty"`
	ProofToken     string `json:"proof_token,omitempty"`
}

type AuthFinishResponse

type AuthFinishResponse struct {
	UserToken string `json:"user_token,omitempty"`
}

type AuthGenerateRequest

type AuthGenerateRequest struct {
	Id        int64  `json:"-"`
	SiteToken string `json:"site_token,omitempty"`
	UserGroup string `json:"user_group,omitempty"`
}

type AuthGenerateResponse

type AuthGenerateResponse struct {
	StateToken string   `json:"state_token,omitempty"`
	AuthURL    string   `json:"auth_url,omitempty"`
	Scopes     []string `json:"scopes,omitempty"`
	ClientId   string   `json:"client_id,omitempty"`
}

type AuthNextFirstRequest

type AuthNextFirstRequest struct {
	Id        int64  `json:"-"`
	AuthCode  string `json:"auth_code,omitempty"`
	AuthState string `json:"auth_state,omitempty"`
	SiteToken string `json:"site_token,omitempty"`
	UserGroup string `json:"user_group,omitempty"`
}

type AuthNextFirstResponse

type AuthNextFirstResponse struct {
	Message     string   `json:"message,omitempty"`
	Ok          bool     `json:"ok,omitempty"`
	FirstToken  string   `json:"first_token,omitempty"`
	NewUser     bool     `json:"new_user,omitempty"`
	Email       string   `json:"email,omitempty"`
	UserIdHints []string `json:"user_id_hints,omitempty"`
}

type AuthNextSecondRequest

type AuthNextSecondRequest struct {
	SiteToken  string `json:"site_token,omitempty"`
	FirstToken string `json:"first_token,omitempty"`
	SignUpdata struct {
		UserId   string `json:"user_id"`
		Bio      string `json:"bio"`
		FullName string `json:"full_name"`
		Profile  string `json:"profile"`
	} `json:"signup_data,omitempty"`
}

type AuthNextSecondResponse

type AuthNextSecondResponse struct {
	Ok          bool   `json:"ok,omitempty"`
	Message     string `json:"message,omitempty"`
	NextToken   string `json:"next_token,omitempty"`
	UserId      string `json:"user_id,omitempty"`
	EmailVerify bool   `json:"email_verify,omitempty"`
}

type AuthSubmitRequest

type AuthSubmitRequest struct {
	NextToken string `json:"next_token,omitempty"`
	SiteToken string `json:"site_token,omitempty"`
}

type AuthSubmitResponse

type AuthSubmitResponse struct {
	SubmitResponse
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func New

func New(coredb store.CoreHub, signer service.Signer, seq xplane.IDService) *Controller

func (*Controller) About

func (c *Controller) About(uclaim *claim.User) (*About, error)

func (*Controller) AuthFinish

func (c *Controller) AuthFinish(opts AuthFinishRequest, deviceName, addr string) (*AuthFinishResponse, error)

func (*Controller) AuthGenerate

func (c *Controller) AuthGenerate(opts AuthGenerateRequest) (*AuthGenerateResponse, error)

func (*Controller) AuthListMethods

func (c *Controller) AuthListMethods(sitetoken, ugroup string) (*ListAuthResponse, error)

func (*Controller) AuthNextFirst

func (c *Controller) AuthNextFirst(opts AuthNextFirstRequest) (*AuthNextFirstResponse, error)

func (*Controller) AuthNextSecond

func (c *Controller) AuthNextSecond(opts AuthNextSecondRequest) (*AuthNextSecondResponse, error)

func (*Controller) AuthSubmit

func (c *Controller) AuthSubmit(opts AuthSubmitRequest) (*AuthSubmitResponse, error)

func (*Controller) LoginNext

func (c *Controller) LoginNext(opts LoginNextRequest) (*LoginNextResponse, error)

func (*Controller) LoginSubmit

func (c *Controller) LoginSubmit(opts LoginSubmitRequest) (*LoginSubmitResponse, error)

func (*Controller) RefreshService

func (c *Controller) RefreshService(uclaim *claim.User, opts RefreshReq) *RefreshResp

type EData

type EData struct {
	// contains filtered or unexported fields
}

type ListAuthResponse

type ListAuthResponse struct {
	PasswordAuth   bool            `json:"pass_auth,omitempty"`
	OpenSignUp     bool            `json:"open_signup,omitempty"`
	AltAuthMethods []AltAuthMethod `json:"alt_auth_method,omitempty"`
}

type LoginNextRequest

type LoginNextRequest struct {
	UserIdent string `json:"user_ident,omitempty"`
	Password  string `json:"password,omitempty"`
	SiteToken string `json:"site_token,omitempty"`
}

type LoginNextResponse

type LoginNextResponse struct {
	Ok          bool   `json:"ok,omitempty"`
	Message     string `json:"message,omitempty"`
	NextToken   string `json:"next_token,omitempty"`
	UserId      string `json:"user_id,omitempty"`
	EmailVerify bool   `json:"email_verify,omitempty"`
	PassChange  bool   `json:"pass_change,omitempty"`
}

type LoginSubmitRequest

type LoginSubmitRequest struct {
	SiteToken string `json:"site_token,omitempty"`
	NextToken string `json:"next_token,omitempty"`
}

type LoginSubmitResponse

type LoginSubmitResponse struct {
	SubmitResponse
}

type OauthExchanger

type OauthExchanger struct {
	// contains filtered or unexported fields
}

func (*OauthExchanger) Exchange

func (oe *OauthExchanger) Exchange() (*EData, error)

type Org

type Org struct {
	Name   string `json:"name,omitempty"`
	Slug   string `json:"slug,omitempty"`
	OrgBio string `json:"org_bio,omitempty"`
}

type RefreshReq

type RefreshReq struct {
	UserToken string         `json:"user_token,omitempty"`
	Options   map[string]any `json:"options,omitempty"`
	OldToken  string         `json:"old_token,omitempty"`
}

type RefreshResp

type RefreshResp struct {
	Token    string `json:"token,omitempty"`
	Expiry   string `json:"expiry,omitempty"`
	Message  string `json:"message,omitempty"`
	StatusOk bool   `json:"status_ok,omitempty"`
}

type SubmitResponse

type SubmitResponse struct {
	Message        string `json:"message,omitempty"`
	Ok             bool   `json:"ok,omitempty"`
	PreAuthedToken string `json:"preauthed_token,omitempty"`
	HasExecHook    bool   `json:"has_exec_hook,omitempty"`
	HookPlugId     string `json:"hook_plug_id,omitempty"`
	HookAgentId    string `json:"hook_agent_id,omitempty"`
	HookExecToken  string `json:"hook_exec_token,omitempty"`
}

type User

type User struct {
	UserId    string `json:"user_id,omitempty"`
	FullName  string `json:"full_name,omitempty"`
	Bio       string `json:"bio,omitempty"`
	GroupID   string `json:"group_id,omitempty"`
	PublicKey string `json:"pub_key,omitempty"`
	GroupName string `json:"group_name,omitempty"`
}

Jump to

Keyboard shortcuts

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