auth

package
Version: v0.1.31-0...-b1e5c7a Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: ISC Imports: 12 Imported by: 0

Documentation

Overview

Package auth provides the functions needed to get a user information.

Index

Constants

This section is empty.

Variables

View Source
var (

	// KOfflineMode allows the set the offline mode
	KOfflineMode bool
)

Functions

func CheckAuthenticationData

func CheckAuthenticationData(r *http.Request) *mdl.User

CheckAuthenticationData checks if authorization information in HTTP.Request is valid, ie: if it matches a user.

func CheckUserValidity

func CheckUserValidity(r *http.Request, url string, accessToken string) bool

CheckUserValidity checks user validity from an accessToken string. verify if google user account is valid.

func CurrentOfflineUser

func CurrentOfflineUser(r *http.Request, c appengine.Context) *mdl.User

CurrentOfflineUser returns pointer to current user, from authentication cookie.

func IsGonawinAdmin

func IsGonawinAdmin(c appengine.Context) bool

IsGonawinAdmin checks if user is gonawin admin.

Types

type TwitterUserInfo

type TwitterUserInfo struct {
	Id         int64 `json:"id,omitempty"`
	Name       string
	ScreenName string `json:"screen_name,omitempty"`
}

TwitterUserInfo represents the twitter data needed for authentication.

func FetchTwitterUserInfo

func FetchTwitterUserInfo(r *http.Response) (*TwitterUserInfo, error)

FetchTwitterUserInfo unmarshals twitter response

type UserInfo

type UserInfo struct {
	Id    string
	Email string
	Name  string
}

UserInfo represents the user infor needed for authentication.

func GetUserGoogleInfo

func GetUserGoogleInfo(u *user.User) UserInfo

GetUserGoogleInfo returns user information from Google Accounts user. If on development server only email (example@example.com) will be present. So Id and Name will be added.

Source Files

Jump to

Keyboard shortcuts

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