Documentation
¶
Overview ¶
Package config contains common configuration values that are used by the various commands and subcommands in the CLI.
Index ¶
- func InitializeLogging(cmd *cobra.Command, rootFlags *RootFlags) svc1log.Logger
- func SetProxyConfig(ctx context.Context, httpProxy, socksProxy string) context.Context
- func WithClientCertificate(ctx context.Context, encoded, password string, targets []string) (context.Context, error)
- func WithProbeClientCertificate(ctx context.Context, encoded, password string, targets []string) (context.Context, error)
- type ClientCertificate
- type ProxyConfig
- type RootFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeLogging ¶
InitializeLogging initializes the logging configuration for the CLI. It sets the log level based on the verbose and quiet flags provided by the user. If the quiet flag is set, the logger is set to discard all logs. If the verbose flag is set, the log level is set to debug. Otherwise, the log level is set to info. The logger is then returned for use by caller. We are using Palantir's Witchcraft logging library to structure our logging output.
func SetProxyConfig ¶ added in v0.0.283
SetProxyConfig stores proxy configuration in the context
Types ¶
type ClientCertificate ¶ added in v0.43.0
type ClientCertificate struct {
// contains filtered or unexported fields
}
ClientCertificate holds an in-memory identity scoped to explicitly supplied HTTPS targets. Its fields are private so it cannot accidentally be serialized into a report.
func GetClientCertificate ¶ added in v0.43.0
func GetClientCertificate(ctx context.Context) *ClientCertificate
GetClientCertificate retrieves the identity without putting secrets in generated config types.
func (*ClientCertificate) Allows ¶ added in v0.43.0
func (c *ClientCertificate) Allows(rawURL string) bool
Allows prevents redirects and crawled links from sending the identity to another origin.
func (*ClientCertificate) TLSIdentity ¶ added in v0.43.0
func (c *ClientCertificate) TLSIdentity() tls.Certificate
TLSIdentity returns the parsed identity for configuring an HTTP transport.
type ProxyConfig ¶ added in v0.0.283
ProxyConfig holds proxy configuration for HTTP requests
func GetProxyConfig ¶ added in v0.0.283
func GetProxyConfig(ctx context.Context) *ProxyConfig
GetProxyConfig retrieves proxy configuration from the context