Skip to content

Conversation

@lykhvar
Copy link
Contributor

@lykhvar lykhvar commented Aug 20, 2025

Introduce an authentication system to fetch scripts from private sources
like GitHub and GitLab.

  • Add --auth-header flag and VET_AUTH_HEADER env var to allow custom
    authentication headers (e.g., "PRIVATE-TOKEN: {}").
  • Support providing tokens via --token-stdin (piping) and the
    VET_TOKEN environment variable, defaulting to "Authorization: Bearer {}".
  • Add support for -n, --netrc.

Closes #4

* add authentication support for private repositories

support for ~/.netrc
support for environment variable
support for stdin

* document authentication methods
Introduce an authentication system to fetch scripts from private sources
like GitHub and GitLab.

- Add `--auth-header` flag and `VET_AUTH_HEADER` env var to allow custom
  authentication headers (e.g., "PRIVATE-TOKEN: {}").
- Support providing tokens via `--token-stdin` (piping) and the
  `VET_TOKEN` environment variable, defaulting to "Authorization: Bearer {}".
- Add support for `-n, --netrc`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am inspired by your tests.

```
---
#### `.netrc` File
As a fallback, `vet` can read credentials from a `~/.netrc` file if the `-n`, `--netrc` flag is used. This method will be ignored if `VET_AUTH_TOKEN` is set or `--token-stdin` is used.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my research, wget will read a .netrc file by default if it exists. Curl required the -n flag to be set. It may be .netrc would take priority over other auth methods if wget were managing the connection.

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.

feat: Support for Private Repositories via Authentication

2 participants