iap

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheProtocol = "iap"
	CacheUsername = "refresh-token"
)
View Source
const (
	// IAPCookieName is the name of the HTTP Cookie that will be used to send the IAP Token.
	// see: https://cloud.google.com/blog/products/gcp/getting-started-with-cloud-identity-aware-proxy
	IAPCookieName = "GCP_IAAP_AUTH_TOKEN"
)

Variables

This section is empty.

Functions

func GetIAPAuthToken

func GetIAPAuthToken(domain, helperID, helperSecret, IAPclientID string) (string, error)

GetIAPAuthToken returns a raw IAP auth token for the given args

Types

type Cookie struct {
	JarPath string
	Domain  string
	Token   jwt.Token
	Claims  jwt.StandardClaims
}

func NewCookie

func NewCookie(domain string) (*Cookie, error)

NewCookie takes care of the authentication workflow and creates the relevant IAP Cookie on the filesystem

func ReadCookie

func ReadCookie(domain string) (*Cookie, error)

ReadCookie lookup the http.cookieFile for a given domain and try to load it from the filesystem

func (*Cookie) Expired

func (c *Cookie) Expired() bool

Expired returns a boolean that indicate if the expires-at claim is in the future

type Token

type Token struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	Scope       string `json:"scope"`
	TokenType   string `json:"token_type"`
	IDToken     string `json:"id_token"`
}

Jump to

Keyboard shortcuts

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