config

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 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 `json:"oauthClientId" yaml:"oauthClientId"`
	OAuthClientSecret     string `json:"oauthClientSecret" yaml:"oauthClientSecret"`
	IapClientId           string `json:"iapClientId" yaml:"iapClientId"`
	IapClientRefresh      string `json:"iapClientRefresh" yaml:"iapClientRefresh"`
	IapIdToken            string `json:"iapIdToken" yaml:"iapIdToken"`
	ServiceAccountKeyPath string `json:"serviceAccountKeyPath" 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