Skip to content

Suggest multiple tokens when multiple remotes are configured (or consolidating on a single instance) #3622

Open
@stefanvanburen

Description

@stefanvanburen

Feature

In the case that someone has configured their buf.gen.yaml with multiple remotes, e.g.:

version: v2
# ...
plugins:
  - remote: buf.build/protocolbuffers/go
    out: gen/go
  - remote: buf.example.com/example/example
    out: gen/go

... it would be nice to suggest to them that they may want to configure multiple tokens. In this instance, configuring a single token for buf.build will result in token failures for buf.example.com, and configuring a single token for buf.example.com will either result in token failures (for private buf.build modules), or eventually hitting buf.build's rate limits on generation, which is confusing when a token is technically provided.

Additionally/alternatively, we could consider pointing out that generally users don't want to use multiple remotes (since plugins are typically synced to other BSR instances), and may want to consider consolidating on a single instance.

We could say something like:

$ buf generate
Failure: the BUF_TOKEN environment variable is set, but is not valid. Set BUF_TOKEN to a valid Buf API key, or unset it.
NOTE: You have multiple plugin remotes configured (`buf.build` and `buf.example.com`), you may either want to configure a token for each remote <link-to-docs / example>, or consolidate on a single remote.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions