Search by

glued / stor-client

killua-eu

PHP client and validated upstream-source cache for the Glued Stor API.

Package info

gitlab.com/glued/stor-client

Issues

pkg:composer/glued/stor-client

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

dev-main 2026-09-08 01:13 UTC

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.

  • SourceClient signs requests using the existing shared service context and accesses Stor under concrete bucket/object grants.
  • SourceCache calls 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.
  • SourceStore is 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.