Skip to content

New API app to handle upload with a bearer token#576

Closed
charsbar wants to merge 26 commits intoandk:masterfrom
charsbar:api_app_for_bearer_token
Closed

New API app to handle upload with a bearer token#576
charsbar wants to merge 26 commits intoandk:masterfrom
charsbar:api_app_for_bearer_token

Conversation

@charsbar
Copy link
Copy Markdown
Collaborator

This PR adds a new API application to the current PAUSE, as well as two new endpoints to the current web UI for generating and revoking tokens. It lacks proper documentation. A large portion of the code is taken from the files under lib/pause_2017, so there's a huge room to refactor.

If you have a working local PAUSE environment, you can 1) modify the authen_pause schema using one-off util, 2) launch app_2026.psgi (instead of app_2017.psgi), and then you can post a new distribution like this:

my $ua = LWP::UserAgent->new;
my $res = $ua->post(
    "http://your.local.pause/api/upload",
    Authorization => "Bearer $token",
    'Content-Type' => "multipart/form-data",
    Content => {
      file => [ $your_file ],
    },
);

@charsbar charsbar marked this pull request as draft April 25, 2026 07:14
@Leont
Copy link
Copy Markdown
Contributor

Leont commented Apr 25, 2026

Why add Crypt::PRNG when you're already using Crypt::URandom elsewhere? That seems double.

@charsbar
Copy link
Copy Markdown
Collaborator Author

Replaced PRNG with URandom

@charsbar charsbar marked this pull request as ready for review April 26, 2026 14:06
@andk
Copy link
Copy Markdown
Owner

andk commented Apr 26, 2026

Thanks, applied and deployed

@andk andk closed this Apr 26, 2026
@charsbar charsbar deleted the api_app_for_bearer_token branch April 26, 2026 14:34
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.

3 participants