wingletplatform / auth-client
Typed server-side client for Winglet.Auth authorization snapshots.
Package info
github.com/WingletPlatform/php-auth-client-dist
pkg:composer/wingletplatform/auth-client
Requires
- php: ^8.4
- wingletplatform/client: ^0.1
- wingletplatform/identity-client: ^0.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This PHP 8.4+ (64-bit) client reads Winglet.Auth actor and caller authorization snapshots. Its Composer name is wingletplatform/auth-client; it requires the shared wingletplatform/client and wingletplatform/identity-client packages, both at ^0.1. The planned packages use the included MIT license with Eventteri Oy copyright.
Installation
The Auth client and both dependencies are not published and have no assigned release versions. After their approved releases are available from Packagist, install the Auth client with:
composer require wingletplatform/auth-client:^0.1
Composer will resolve the shared client and Identity client dependencies. This command is conditional on publication and is not currently usable from a public registry.
Use
Configure ServiceClient instances for Identity and Auth, then provide explicit codec limits and the Identity service caller credentials:
use Winglet\Auth\Client\AuthClient; use Winglet\Auth\Client\IdentityServiceAuthenticationTokenProvider; use Winglet\Client\Core\JsonCodec\CodecLimits; use Winglet\Client\Core\Http\ServiceClient; use Winglet\Identity\Client\IdentityClient; // $identityService and $authService are configured ServiceClient instances. $limits = new CodecLimits(8192, 16, 128, 64, 4096, 32); $identity = new IdentityClient($identityService, $limits); $tokens = new IdentityServiceAuthenticationTokenProvider( $identity, serviceId: 'winglet.billing', credential: getenv('WINGLET_SERVICE_CREDENTIAL') ?: throw new RuntimeException('Missing service credential'), ); $auth = new AuthClient($authService, $tokens, $limits); $snapshot = $auth->callerGlobalSnapshot('winglet.billing');
The client exposes four read-only operations: global or tenant snapshots for an actor or a service caller. Tenant IDs and revision values are signed Int64 values and require 64-bit PHP. Supply CodecLimits selected for your service; the package has no production limit defaults. The separate wingletplatform/client dependency retains the third-party codec license notice.
IdentityServiceAuthenticationTokenProvider requests a token for the fixed winglet.auth audience through Identity's existing service-authentication endpoint and caches it in that provider instance until its refresh margin. Callers may instead supply their own AuthServiceAuthenticationTokenProviderInterface. Business calls cannot select another audience. This client does not decode JWT claims or fall back to user, tenant, session, or ordinary service-access credentials. Auth remains responsible for validating token signature, audience, claims, expiry, and caller capabilities.
Mock transport tests cover client request and response behavior only; they do not prove live Auth authorization, deployment exposure, or credential custody. The separate SDK-5X.2d audience-policy proposal is deferred and is not a gate for this package. The exporter omits source-development Composer scripts and test-only metadata from the archive projection while preserving the source manifest.