这是indexloc提供的服务,不要输入任何密码
Skip to content

Support for non-Bearer Authorization header #465

@simonireilly

Description

@simonireilly

Describe the feature you'd like to request

Currently, authorization for the remote cache is configured in the client.go to be Bearer based:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cachingIssues reported about incorrect cache hits or missesarea: ergonomicsIssues and features impacting the developer experience of using turbo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions