Search by

arraypress / wp-s3-signer

arraypress

AWS Signature Version 4 signing for S3-compatible object storage in WordPress. Presigned URLs, signed request headers, and a thin WP HTTP API transport. No SDK.

Package info

github.com/arraypress/wp-s3-signer

pkg:composer/arraypress/wp-s3-signer

Statistics

Installs: 10

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-08-25 17:01 UTC

This package is auto-updated.

Last update: 2026-09-02 16:27:40 UTC


README

Sign requests to S3-compatible storage, so a file can be handed out without being made public or streamed through PHP.

What it does

Selling a file means the URL has to work for the buyer and nobody else. The answer is a presigned URL — a link that carries its own signature and expires — and producing one means AWS Signature Version 4, which is a specific sequence of canonicalising, hashing and HMAC steps that fails silently if any of it is wrong.

This implements the signing and nothing else. No HTTP client, no SDK, no config file: pass keys, get a URL.

Features

  • Produce a download link that expires in the number of seconds you choose
  • Set the filename the browser saves as, regardless of the object's key
  • Produce an upload link, so a file goes to storage without touching the server
  • Sign delete, head and multipart requests, when a URL is not what you need
  • Point at any S3-compatible provider — R2, B2, Wasabi, DigitalOcean, MinIO
  • Get regional endpoints and addressing style right per provider

Installation

composer require arraypress/wp-s3-signer

Quick start

A sixty-second link, which the browser saves under a name of your choosing:

use ArrayPress\S3Signer\Provider;

$signer = Provider::R2->signer( $access_key, $secret_key, account_id: $account_id );

$url = $signer->presign_get( 'my-bucket', 'masters/a1.wav', 60, 'Album Master.wav' );

The object stays private. The link works until it expires, and then does not.

What it does not do

It signs; it does not send. Nothing here makes an HTTP request, lists a bucket or manages a file — arraypress/wp-s3-browser is the layer that does, and it is built on this.

Requirements

  • PHP 8.3 or later
  • WordPress 7.1 or later

License

GPL-2.0-or-later