(ctx context.Context)
| 133 | } |
| 134 | |
| 135 | func (repo *RemoteGitRepository) remoteCacheKey(ctx context.Context) (string, error) { |
| 136 | clientMetadata, err := engine.ClientMetadataFromContext(ctx) |
| 137 | if err != nil { |
| 138 | return "", err |
| 139 | } |
| 140 | inputs := []string{clientMetadata.SessionID, repo.URL.Remote()} |
| 141 | inputs = append(inputs, repo.remoteCacheScope()...) |
| 142 | return hashutil.HashStrings(inputs...).String(), nil |
| 143 | } |
| 144 | |
| 145 | // Pipelines could query the same remote with different creds (e.g. a pipeline checking that creds were properly rotated) |
| 146 | // instead of being too smart, we just scope the cache key to the auth configuration: less chance of cache poisoning |
no test coverage detected