[web-downloads] main: Mark token as required for PECL api

From: Date: Mon, 10 Nov 2025 02:09:37 +0000
Subject: [web-downloads] main: Mark token as required for PECL api
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-33329@lists.php.net to get a copy of this message
Author: Shivam Mathur (shivammathur) Date: 2025-11-10T07:39:10+05:30 Commit: https://github.com/php/web-downloads/commit/7dd209076a8226a321090f31120d3a922789561b Raw diff: https://github.com/php/web-downloads/commit/7dd209076a8226a321090f31120d3a922789561b.diff Mark token as required for PECL api Changed paths: M .github/workflows/pecl.yml M API.md M src/Http/Controllers/PeclController.php Diff: diff --git a/.github/workflows/pecl.yml b/.github/workflows/pecl.yml index c04ec24..4a2500b 100644 --- a/.github/workflows/pecl.yml +++ b/.github/workflows/pecl.yml @@ -20,4 +20,4 @@ jobs: --request POST \ --location https://downloads.php.net/api/pecl \ --header 'Authorization: Bearer ${{ secrets.AUTH_TOKEN }}' \ - --data '{ "url": "${{ inputs.url }}", "extension": "${{ inputs.extension }}", "ref": "${{ inputs.ref }}" }' + --data '{ "url": "${{ inputs.url }}", "extension": "${{ inputs.extension }}", "ref": "${{ inputs.ref }}", "token": "${{ secrets.TOKEN }}" }' diff --git a/API.md b/API.md index 1bc0735..7056060 100644 --- a/API.md +++ b/API.md @@ -60,7 +60,7 @@ curl -i -X POST \ - url (string, required, URL): Direct download URL of the artifact. - extension (string, required): Extension name (used in filename). - ref (string, required): Reference (e.g., tag/commit) used in filename. - - token (string, optional): Used as a GitHub token if the URL points to api.github.com. + - token (string, required): Used as a GitHub token if the URL points to api.github.com. - Success: 200 OK. - Errors: - 400 with validation details if required fields are missing/invalid. diff --git a/src/Http/Controllers/PeclController.php b/src/Http/Controllers/PeclController.php index 4adbff0..a0194cd 100644 --- a/src/Http/Controllers/PeclController.php +++ b/src/Http/Controllers/PeclController.php @@ -16,6 +16,7 @@ public function validate(array $data): bool 'url' => 'required|url', 'extension' => 'required|string', 'ref' => 'required|string', + 'token' => 'required|string', ]); $validator->validate($data); @@ -37,7 +38,7 @@ public function execute(array $data): void $data['extension'], $data['ref'], $data['url'], - $data['token'] ?? '' + $data['token'], ); } catch (Exception $exception) { http_response_code(500);

« previous php.webmaster (#33329) next »