verifier_google

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	RedirectURL  string
	Scopes       []string
}

type Metadata

type Metadata struct {
	Primary  bool   `json:"primary"`
	Verified bool   `json:"verified"`
	Source   Source `json:"source"`
}

type Source

type Source struct {
	Type string `json:"type"`
	Id   string `json:"id"`
}

type UserInfo

type UserInfo struct {
	Error struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
		Status  string `json:"status"`
	} `json:"error"`
	ResourceName string `json:"resourceName"`
	Etag         string `json:"etag"`
	Metadata     struct {
		Sources []struct {
			Type            string `json:"type"`
			Id              string `json:"id"`
			Etag            string `json:"etag"`
			ProfileMetadata struct {
				ObjectType string   `json:"objectType"`
				UserTypes  []string `json:"userTypes"`
			} `json:"profileMetadata"`
		} `json:"sources"`
		ObjectType string `json:"objectType"`
	} `json:"metadata"`
	Locales []struct {
		Metadata Metadata `json:"metadata"`
		Value    string   `json:"value"`
	} `json:"locales"`
	Names struct {
		Metadata             Metadata `json:"metadata"`
		DisplayName          string   `json:"displayName"`
		FamilyName           string   `json:"familyName"`
		GivenName            string   `json:"givenName"`
		DisplayNameLastFirst string   `json:"displayNameLastFirst"`
	} `json:"names"`
	CoverPhotos []struct {
		Metadata Metadata `json:"metadata"`
		Url      string   `json:"url"`
		Default  bool     `json:"default"`
	} `json:"coverPhotos"`
	Photos []struct {
		Metadata Metadata `json:"metadata"`
		Url      string   `json:"url"`
	} `json:"photos"`
	Birthdays []struct {
		Metadata Metadata `json:"metadata"`
		Date     []struct {
			Year  int `json:"year"`
			Month int `json:"month"`
			Day   int `json:"day"`
		} `json:"date"`
	} `json:"birthdays"`
	EmailAddresses []struct {
		Metadata Metadata `json:"metadata"`
		Value    string   `json:"value"`
	} `json:"emailAddresses"`
	Urls []struct {
		Metadata      Metadata `json:"metadata"`
		Value         string   `json:"value"`
		Type          string   `json:"type"`
		FormattedType string   `json:"formattedType"`
	} `json:"urls"`
	Organizations []struct {
		Metadata      Metadata `json:"metadata"`
		Type          string   `json:"type"`
		FormattedType string   `json:"formattedType"`
		EndDate       struct {
			Year  int `json:"year"`
			Month int `json:"month"`
			Day   int `json:"day"`
		} `json:"endDate"`
		Current bool   `json:"current"`
		Name    string `json:"name"`
	} `json:"organizations"`
	AgeRanges []struct {
		Metadata Metadata `json:"metadata"`
		AgeRange string   `json:"ageRange"`
	} `json:"ageRanges"`
}

type Verifier

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

func New

func New(cfg Config) *Verifier

func (*Verifier) GetOAuth2Identity

func (prov *Verifier) GetOAuth2Identity(ctx context.Context, accessToken string) (iden *identity.IdentityData, verifierData *identity.VerifierData, err error)

func (*Verifier) GetOAuth2URL

func (prov *Verifier) GetOAuth2URL(state string) string

func (*Verifier) HandleOAuth2Callback

func (prov *Verifier) HandleOAuth2Callback(ctx context.Context, code string) (token *oauth2.Token, err error)

func (*Verifier) Info

func (prov *Verifier) Info() identity.VerifierInfo

func (*Verifier) NormalizeIdentity

func (prov *Verifier) NormalizeIdentity(idn string) string

Jump to

Keyboard shortcuts

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