glued / stor-client
PHP client and validated upstream-source cache for the Glued Stor API.
Requires
- php: ^8.5
- ext-json: *
- glued/lib: dev-main
- symfony/http-client: ^8.1
- symfony/http-client-contracts: ^3.7
- symfony/mime: ^8.1
Requires (Dev)
- guzzlehttp/psr7: ^3.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-07 23:13:45 UTC
README
glued/stor-client contains the PHP client for Stor's source and exact-version
content API. It is a library loaded by callers, not another service.
if-fio-cz / if-cnb-cz -> stor-client -> lib
stor -> lib
Neither glued/lib nor the Stor server depends on this package. Shared auth,
JWT, SQL and HTTP infrastructure stays in glued/lib; this package owns the
Stor-specific routes, source/object document contract and connector cache flow.
SourceClientsigns requests using the existing shared service context and accesses Stor under concrete bucket/object grants.SourceCachecalls connector-owned PHP fetch and validation callables. It sends upstream HTTP validators, validates new bytes before publication and leaves successful domain processing to the connector.SourceStoreis the Stor source/content boundary used by the client and tests. It is not a generic interchangeable storage-backend abstraction.
Upstream credentials stay inside connector callbacks. Source keys must be
credential-free, for example if-fio-cz://accounts/<uuid>/statements/2026/175/pdf.
Failed validation cannot replace a previously accepted version. A 304 or identical
content keeps the accepted content version; changed content keeps the object UUID
and receives a new version. The separate source revision is a concurrency token.
The client follows Stor's 512 MiB source-upload contract. publishFile() streams
an already-validated local file; SourceCache::fetch() handles bounded strings
with provider-specific validation and read limits. Stor independently enforces
its own server limit. General Stor uploads retain their separate 2 GiB limit.
Role ownership
Glued\StorClient\RoleId::CLIENT publishes the stable Stor route-admission
role UUID 5e0c5f59-eb45-5a96-b40a-d32605985b5d. It is not the client's
identity: PrincipalId::service('if-fio-cz') still identifies the calling
application through the generic helper in glued/lib.
Stor's 20260908000400_seed_stor_client_role.sql migration creates the role's
catalogue row. Router retains its existing stor/* admission policy;
deployments explicitly assign approved callers and grant concrete resource
access separately. Installing/autoloading this package neither provisions nor
claims the role. There is no conditional extension of lib's PrincipalId.
Installation and local development
This revision requires lib's UUID-only authentication contract:
PrincipalId::service() and signed principal kind/application fields.
Publish the matching lib revision before updating deployment lockfiles, and
coordinate the Router/Stor cutover; older prefixed-subject signatures are not
compatible. Passing tests against a sibling lib checkout does not replace
publishing that dependency.
The public package is glued/stor-client on Packagist.
Its Git remote is git@gitlab.com:glued/stor-client.git, default branch main,
matching glued/lib. Existing Glued services already explicitly allow lib's
development branch and can add the client with:
composer require glued/stor-client:dev-main
Consumers and Docker images install the pinned package through composer.lock.
No client source checkout or custom repository entry is needed for installation.
To opt into a sibling client checkout during development, run in the consumer:
composer config repositories.stor-client path ../stor-client
composer update glued/stor-client
Remove that local override and update the client lock entry again before building
a release (composer config --unset repositories.stor-client). This package's
own development checkout uses sibling lib/ for its shared primitives:
composer install
composer test
Tests cover conditional downloads, validation-before-publication, exact-version
reads, signed HTTP requests and a streamed 512 MiB upload. The server's separate
tests cover PostgreSQL, content deduplication, concurrency and authorization.
Connector tests may explicitly load tests/Support/MemorySourceStore.php; it is
a fixture, not a runtime fallback or cache backend.