aftman icon indicating copy to clipboard operation
aftman copied to clipboard

Add support for personal access tokens

Open sasial-dev opened this issue 2 years ago • 5 comments

Fixes #7

This is my first time using rust, so please let me know if anything needs to be changed as i'm really new to the language!

This PR consists of:

  • A token arg has been added to aftman add & aftman run (allowing for acess to private repos, and 5000 requests instead of 60 per hour*)
  • bin files use the global token field in aftman.toml (optional)

* While (hopfully) no one will hit that rate limit, it's nice to have to option of so many more requests. The first usecase I could think of was for a new user downloading releases for lots of tools

sasial-dev avatar Jun 19 '22 07:06 sasial-dev

The biggest thing is reading the manifest to check for the token before using aftman add/aftman run. I wasn't sure how/where you wanted me to read the manifest - am looking for your direction here before so I don't do it in the wrong place

sasial-dev avatar Jun 19 '22 08:06 sasial-dev

Code-wise, this looks much better!

sasial-dev avatar Jul 03 '22 06:07 sasial-dev

Note that the CI failed due to warning: add_token not being implmented yet, let me know what course of action you'd like me to take (leaving it as deadcode or implmenting a CLI command)

sasial-dev avatar Jul 03 '22 06:07 sasial-dev

Note that the CI failed due to warning: add_token not being implmented yet, let me know what course of action you'd like me to take (leaving it as deadcode or implmenting a CLI command)

CI failed because you didn't run rustfmt! You should turn on "format on save" in your editor so that code gets correctly formatted.

LPGhatguy avatar Jul 06 '22 19:07 LPGhatguy

This PR is definitely useful, I've hit the 60 rate limit via CI.

ok-nick avatar Jul 18 '22 18:07 ok-nick

I can second how useful this would be for us, right now we're unable to completely manage our tools in CI using neither foreman nor aftman. Foreman does not match release artifacts properly for some third party tools we need (such as sentry-cli) and has issues with long-running processes. Aftman is only missing support for private tools/auth. We could completely get rid of our self-hosted and custom setup runners whenever this PR goes through :tada:

filiptibell avatar Aug 09 '22 18:08 filiptibell

Thanks again @filiptibell! I actually tried and pushed commits implimenting both options here! I finally decided on passing the whole manifest for future compatibility (some sources may need more than 1 field etc) and it felt like a cleaner soulution :)

sasial-dev avatar Sep 05 '22 07:09 sasial-dev