refreshToken reads the token from file and updates the cached data.
()
| 134 | |
| 135 | // refreshToken reads the token from file and updates the cached data. |
| 136 | func (c *jwtTokenFileCallCreds) refreshToken() { |
| 137 | // Deliberately not locking c.mu here. This way other RPCs can proceed |
| 138 | // while we read the token. This is per gRFC A97. |
| 139 | token, expiry, err := c.fileReader.readToken() |
| 140 | |
| 141 | c.mu.Lock() |
| 142 | defer c.mu.Unlock() |
| 143 | c.updateCacheLocked(token, expiry, err) |
| 144 | c.pendingRefresh = false |
| 145 | } |
| 146 | |
| 147 | // updateCacheLocked updates the cached token, expiry, and error state. |
| 148 | // If an error is provided, it determines whether to set it as an UNAVAILABLE |
no test coverage detected