Skip to content

cmd/tailcat: Add support for --allow-list flag - #175

Open
dolchi21 wants to merge 1 commit into
tailscale:mainfrom
dolchi21:cmd/serve-allow-list
Open

dolchi21 wants to merge 1 commit into
tailscale:mainfrom
dolchi21:cmd/serve-allow-list

Conversation

@dolchi21

Copy link
Copy Markdown

Summary

This PR adds support for loading allowed client public keys from a file via a new --allow-list flag for tailcat serve.

This makes access control easier to manage in real deployments, especially when the list of trusted clients is longer than a single CLI argument or needs to be maintained outside of the command line.

Changes

  • Added --allow-list to the server CLI
  • Reads a text file containing one public key per line
  • Supports blank lines and comment lines starting with #
  • Merges file-based entries with the existing --allow behavior
  • Validates each key at startup and fails early on malformed input
  • Adds tests covering parsing, validation, and CLI flag registration

Why

Previously, allowed clients had to be specified through a comma-separated list in --allow. That works for small setups, but it becomes cumbersome and error-prone for larger or more dynamic deployments.

Using a file-based allow list makes it easier to:

  • manage trusted clients in version control
  • rotate access lists without editing shell command strings
  • keep long allow lists readable and maintainable

Example

tailcat serve --allow-list=/etc/tailcat/allowed-clients.txt

Example file:

# Trusted clients
8R1K...WQ7
9F2M...A3Q

Testing

  • Added CLI and parsing tests for allow-list validation
  • Verified behavior for:
    • valid public keys
    • blank/comment lines
    • invalid entries
    • CLI flag parsing

If you want, I can also give you:

  • a shorter PR version for GitHub
  • a more formal maintainer-style description
  • a version tailored specifically to the branch/commit you’re working on.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant