google

package
v0.0.0-...-91f6600 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package google has the implmentations for google oauth and google user profile fetch

Index

Constants

View Source
const (
	//RedirectURLKey is the key storing for the google oauth redirect url
	RedirectURLKey = "OAUTH2_GOOGLE_REDIRECT_URL"
	//ClientIDKey is the key storing for the google oauth client id
	ClientIDKey = "OAUTH2_GOOGLE_CLIENT_ID"
	//ClientSecretKey is the key storing for the google oauth client secret
	ClientSecretKey = "OAUTH2_GOOGLE_CLIENT_SECRET"
	//ProfileScopeKey is the key storing for the google user profile scope
	ProfileScopeKey = "OAUTH2_GOOGLE_USER_PROFILE_SCOPE"
	//EmailScopeKey is the key storing for the google user email scope
	EmailScopeKey = "OAUTH2_GOOGLE_USER_EMAIL_SCOPE"
	//UserInfoURLKey is the key storing the url which gives google user info
	UserInfoURLKey = "OAUTH2_GOOGLE_USER_INFO_URL"
	//UserInfoNameKey is the key storing the name key in the google user info
	UserInfoNameKey = "OAUTH2_GOOGLE_USER_INFO_NAME"
	//UserInfoEmailKey is the key storing the email key in the google user info
	UserInfoEmailKey = "OAUTH2_GOOGLE_USER_INFO_EMAIL"
	//UserInfoPictureKey is the key storing the picture key in the google user info
	UserInfoPictureKey = "OAUTH2_GOOGLE_USER_INFO_PICTURE"
	//UserInfoTimeoutKey is the key storing the user info google fetch timeout
	UserInfoTimeoutKey = "OAUTH2_GOOGLE_USER_INFO_TIMEOUT"
)

Variables

View Source
var Config *oauth2.Config

Config is the google oauth2 config

View Source
var UserInfoMap oauth.UserInfoMap

UserInfoMap has the user info map required for the google use profile

View Source
var UserInfoTimeout = time.Duration(10000 * time.Millisecond)

UserInfoTimeout is the timeout for the fetching the user info from google auth agent

View Source
var UserInfoURL string

UserInfoURL is the url to hit to get the user info from google

Functions

func LoadConfig

func LoadConfig() error

LoadConfig will load the config required for the google oauth

Types

type Agent

type Agent struct{}

Agent is the google oauth agent

func (*Agent) Info

func (a *Agent) Info(ctx context.Context, appCtx *config.AppContext) (*config.UserInfo, error)

Info returns the returns google user's info

func (*Agent) Name

func (a *Agent) Name() string

Name returns the google string as the name of the auth agent

Jump to

Keyboard shortcuts

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