AnonymousClientConfig returns a copy of the given config with all user credentials (cert/key, bearer token, and username/password) and custom transports (WrapTransport, Transport) removed
(config *Config)
| 489 | |
| 490 | // AnonymousClientConfig returns a copy of the given config with all user credentials (cert/key, bearer token, and username/password) and custom transports (WrapTransport, Transport) removed |
| 491 | func AnonymousClientConfig(config *Config) *Config { |
| 492 | // copy only known safe fields |
| 493 | return &Config{ |
| 494 | Host: config.Host, |
| 495 | APIPath: config.APIPath, |
| 496 | ContentConfig: config.ContentConfig, |
| 497 | TLSClientConfig: TLSClientConfig{ |
| 498 | Insecure: config.Insecure, |
| 499 | ServerName: config.ServerName, |
| 500 | CAFile: config.TLSClientConfig.CAFile, |
| 501 | CAData: config.TLSClientConfig.CAData, |
| 502 | }, |
| 503 | RateLimiter: config.RateLimiter, |
| 504 | UserAgent: config.UserAgent, |
| 505 | QPS: config.QPS, |
| 506 | Burst: config.Burst, |
| 507 | Timeout: config.Timeout, |
| 508 | Dial: config.Dial, |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | // CopyConfig returns a copy of the given config |
| 513 | func CopyConfig(config *Config) *Config { |
no outgoing calls