config

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIDTokenWithServiceAccount

func GetIDTokenWithServiceAccount(config Config) (string, error)

GetIDTokenWithServiceAccount gets an IAP ID Token required for authenticating a service account with IAP. For more info, see https://cloud.google.com/iap/docs/authentication-howto#authenticating_from_a_service_account

func GetIapToken

func GetIapToken(iapConfig Config) (string, error)

returns the token get from google for IAP

func RequestIapIDToken

func RequestIapIDToken(token string, clientId string, clientSecret string, iapClientId string) (string, error)

RequestIapIDToken implements the audience parameter required for accessing IAP, see for more https://cloud.google.com/iap/docs/authentication-howto

func ValidIAPStateToken

func ValidIAPStateToken(state, clientState string) bool

check the iap's state

Types

type Config

type Config struct {
	OAuthClientId         string `yaml:"oauthClientId"`
	OAuthClientSecret     string `yaml:"oauthClientSecret"`
	IapClientId           string `yaml:"iapClientId"`
	IapClientRefresh      string `yaml:"iapClientRefresh"`
	IapIdToken            string `yaml:"iapIdToken"`
	ServiceAccountKeyPath string `yaml:"serviceAccountKeyPath"`
}

Config mapping to the config file for IAP

Jump to

Keyboard shortcuts

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