callCreds provides the implementation of call credentials based on an STS token exchange.
| 137 | // callCreds provides the implementation of call credentials based on an STS |
| 138 | // token exchange. |
| 139 | type callCreds struct { |
| 140 | opts Options |
| 141 | client httpDoer |
| 142 | |
| 143 | // Cached accessToken to avoid an STS token exchange for every call to |
| 144 | // GetRequestMetadata. |
| 145 | mu sync.Mutex |
| 146 | tokenMetadata map[string]string |
| 147 | tokenExpiry time.Time |
| 148 | } |
| 149 | |
| 150 | // GetRequestMetadata returns the cached accessToken, if available and valid, or |
| 151 | // fetches a new one by performing an STS token exchange. |
nothing calls this directly
no outgoing calls
no test coverage detected