auth

package
v0.0.0-...-380fd93 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTClaims

type JWTClaims struct {
	jwt.StandardClaims
	//Standard JWT Claim Info
	JTI        string `json:"jti"` //JWT ID
	IAT        int64  `json:"iat"` //Issued at
	Expiration int64  `json:"exp"` //Expiration

	// JWT Extended Info
	ApplicationID string   `json:"application_id"` //App ID this is used for
	Scope         string   `json:"scope"`          //"basic"
	RefreshToken  string   `json:"refresh_token"`  //uuid
	Roles         []string `json:"roles"`          // ["user"]
	Admin         bool     `json:"admin"`

	//Account Basic Info
	ID              string `json:"id"`                //Account ID
	MasterAccountID string `json:"master_account_id"` //Account ID
	FirstName       string `json:"first_name"`
	LastName        string `json:"last_name"`
	Username        string `json:"username"`
	EmailAddress    string `json:"email_address"`

	//Account Extended Info
	GeneratedUsername        bool        `json:"generated_username"` //false?
	Limited                  bool        `json:"limited"`            //Limited access account
	ThirdPartyMarketingOptIn bool        `json:"third_party_marketing_opt_in"`
	CoppaCompliant           bool        `json:"coppa_compliant"`
	Verified                 bool        `json:"verified"`
	AccountState             string      `json:"account_state"`    // "IDENTIFIED"
	ExternalAccount          *struct{}   `json:"external_account"` //Seems to always be empty object
	NewsOffersOptIn          bool        `json:"news_offers_opt_in"`
	OTPDisabled              bool        `json:"otp_disabled"` //MFA
	Language                 string      `json:"language"`     //"en" others??
	Country                  string      `json:"country"`
	Secret1Question          *int        `json:"secret_1_question"` //Needs to be null-able
	Secret2Question          *int        `json:"secret_2_question"`
	Status                   *UserStatus `json:"status"`
}

func (*JWTClaims) String

func (c *JWTClaims) String() (string, error)

type User

type User struct {
	ID           string
	Username     string
	FirstName    string
	LastName     string
	EmailAddress string
}

func BasicAuth

func BasicAuth(username, password string) *User

func (*User) JWT

func (u *User) JWT() *JWTClaims

type UserStatus

type UserStatus struct {
	OutsideGracePeriod      bool   `json:"outside_grace_period"` //false
	Verified                bool   `json:"verified"`
	NeedsDeviceVerification bool   `json:"needs_device_verification"` //false?
	AccountType             string `json:"account_type"`              //"full"
	MissingLegalDocuments   bool   `json:"missing_legal_documents"`
}

Jump to

Keyboard shortcuts

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