Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPAuthConfig ¶
type HTTPAuthConfig struct {
Type string `mapstructure:"type" json:"type" yaml:"type" validate:"required,oneof=basic api_key bearer google_idtoken google_oauth2"`
// basic auth
Username string `mapstructure:"username,omitempty" json:"username,omitempty" yaml:"username,omitempty" validate:"required_if=Type basic"`
Password string `mapstructure:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty" validate:"required_if=Type basic"`
// api key
In string `` /* 132-byte string literal not displayed */
Key string `mapstructure:"key,omitempty" json:"key,omitempty" yaml:"key,omitempty" validate:"required_if=Type api_key"`
Value string `mapstructure:"value,omitempty" json:"value,omitempty" yaml:"value,omitempty" validate:"required_if=Type api_key"`
// bearer
Token string `mapstructure:"token,omitempty" json:"token,omitempty" yaml:"token,omitempty" validate:"required_if=Type bearer"`
// google_idtoken
Audience string `` /* 128-byte string literal not displayed */
// CredentialsJSONBase64 accept a base64 encoded JSON stringified credentials
CredentialsJSONBase64 string `` /* 130-byte string literal not displayed */
}
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient wraps the http client for external approver resolver service
func NewHTTPClient ¶
func NewHTTPClient(config *HTTPClientConfig, clientCreator HttpClientCreator, serviceName string) (*HTTPClient, error)
NewHTTPClient returns *iam.Client
func (*HTTPClient) GetClient ¶ added in v0.12.2
func (c *HTTPClient) GetClient() string
func (*HTTPClient) MakeRequest ¶
type HTTPClientConfig ¶
type HTTPClientConfig struct {
URL string `mapstructure:"url" json:"url" yaml:"url" validate:"required,url"`
Headers map[string]string `mapstructure:"headers,omitempty" json:"headers,omitempty" yaml:"headers,omitempty"`
Auth *HTTPAuthConfig `mapstructure:"auth,omitempty" json:"auth,omitempty" yaml:"auth,omitempty" validate:"omitempty,dive"`
Method string `mapstructure:"method,omitempty" json:"method,omitempty" yaml:"method,omitempty"`
Body string `mapstructure:"body,omitempty" json:"body,omitempty" yaml:"body,omitempty"`
HTTPClient *http.Client `mapstructure:"-" json:"-" yaml:"-"`
Validator *validator.Validate
}
HTTPClientConfig is the configuration required by iam.Client
type HttpClientCreator ¶ added in v0.12.2
type HttpClientCreatorStruct ¶ added in v0.12.2
type HttpClientCreatorStruct struct {
}
func (*HttpClientCreatorStruct) GetHttpClientForGoogleIdToken ¶ added in v0.12.2
func (*HttpClientCreatorStruct) GetHttpClientForGoogleOAuth2 ¶ added in v0.12.2
Click to show internal directories.
Click to hide internal directories.