-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Describe the feature you'd like to request
Currently, authorization for the remote cache is configured in the client.go to be Bearer based:
turborepo/cli/internal/client/client.go
Line 107 in e5b6baa
req.Header.Set("Authorization", "Bearer "+c.Token) |
This is preventing the use of AWS as a remote cache:
Authorization: AWS4-HMAC-SHA256
Credential=xxxxxxxx/20211230/us-east-1/execute-api/aws4_request,
SignedHeaders=host;x-amz-date;x-amz-security-token,
Signature=xxxxxx
A solution to allow custom authentication headers would be ideal.
Benefits
Highly regulated orgs can't share source code as freely, plus due to security concerns of build logs and plain text env vars.
Describe the solution you'd like
Basic
--authorization
flag would supersede the --token
flag and set the entire header.
Potentially this would be a key-value pair, as the header and value may be different in different remote caching schemas.
npx run turbo --authorization 'X-API-Key: <value here>'
Signed requests
Some auth strategies such as AWS Sig v4 require signed requests which is a more involved process.
In this instance an adapter would be better, hence the option of a local proxy to perform header re-write with the request (dismissed below).
Native support would require a modular build that supports plugins for remote caches. This would maybe cause a requirement to expose internal API's e.g. the API client struct itself, or the cache struct for fully custom caches.
Describe alternatives you've considered
- Changing my remote caches auth, isn't an option for me
- A proxy could be used for auth, but that seems like a workaround
- Use Vercel free cache; unfortunately I can't share my source code.