Status
Published Release Candidate — 1.0.0-rc.3
1.0.0-rc.3 is the published Release Candidate on Packagist. No Stable release or Stable support line exists.
Key Features
- Validate internal return targets without rewriting their original representation.
- Issue opaque, expiring
rt1 HMAC tokens and verify them through a public service.
- Re-apply current target restrictions and expiry rules during verification.
- Keep HTTP, routing, authentication, redirect execution, and key loading under Host ownership.
Requirements
- PHP
>=8.4.27 <8.5.0 || >=8.5.12 <8.6.0 (CI covers PHP 8.4 and 8.5)
ext-hash
ext-json
maatify/crypto ^1.0
maatify/exceptions ^1.0
maatify/shared-common ^1.0
Installation
Install the published Release Candidate through Packagist:
composer require maatify/php-return-target:1.0.0-rc.3@RC
Quick Usage
$service = new HmacReturnTargetService(
new ReturnTargetConfig('admin-auth', 60),
$hostKeyProvider,
$hostClock,
$optionalHostRestrictionPolicy,
);
$token = $service->issue('/orders/15');
$verified = $token === null ? null : $service->verify($token);
The Host supplies the KeyProviderInterface, ClockInterface, and optional restrict-only policy. See the Usage Guide and maintained example for a complete runnable construction.
Public Runtime API
The public substitution boundary is ReturnTargetServiceInterface. The canonical implementation is HmacReturnTargetService; its public collaborators are ReturnTargetConfig, ReturnTargetRestrictionPolicyInterface, KeyProviderInterface, and ClockInterface. Successful verification returns VerifiedReturnTargetDTO; normal target, token, policy, or expiry rejection returns false/null according to the operation. The Package Reference is the complete canonical contract and API inventory.
Boundaries
The package does not execute redirects and does not own HTTP, routing, sessions, authentication, authorization, persistence, databases, or token consumption state. The Host owns those concerns and the construction of key material and time policy.
The canonical rt1 token is signed, not encrypted, and must not carry confidential information or secrets.
Normal target, token, policy, or expiry rejection returns false or null. Invalid canonical configuration throws InvalidReturnTargetConfigurationException; classified canonical crypto/key configuration failures throw ReturnTargetCryptoConfigurationException; unknown provider, external, or Host-policy throwables propagate unchanged.
Documentation
Quality Status
The repository defines local and CI gates for Composer validation, Composer 2.10 dependency policy audit, latest/lowest dependency resolution, PHP 8.4/8.5 tests, PHPStan max, formatting, syntax, whitespace, examples, Consumer Verification, and workflow lint. GitHub Final Gate is the stable aggregate CI check; the actual status for a commit is reported by its GitHub Actions run.
Development and Testing
Before running the local checks, run php scripts/ci/check-php-patch-floor.php 8.4
or pass 8.5 for PHP 8.5. The check prints the installed PHP version and
enforces the CI patch floor for the selected minor.
Latest-compatible local sequence:
composer validate --strict
composer update --no-interaction --prefer-dist --no-progress
composer check-platform-reqs
composer check:php-constraint
composer audit --no-interaction --abandoned=fail
composer check:syntax
composer check:whitespace
composer format:check
composer analyse
composer test:unit
composer test:system
composer check:examples
composer verify:consumer
composer check:workflows
Lowest-supported dependency sequence begins with:
composer update --prefer-lowest --prefer-stable --no-interaction --prefer-dist --no-progress
composer check-platform-reqs
composer check:php-constraint
composer audit --no-interaction --abandoned=fail
composer check:syntax
composer format:check
composer analyse
composer test:unit
composer test:system
composer check:examples
Restore latest-compatible dependencies and rerun the final applicable local sequence after the lowest check. The Consumer Verification Harness performs two independent clean Composer consumer resolutions and removes generated consumer state after each run. CI tests PHP 8.4 and 8.5; its Final Gate aggregates quality, tests, lowest, consumer-verification, and workflow-lint.
License
This package is proprietary software owned by Maatify Ltd. Obtain written
authorization before use by requesting a free license from
[email protected]. Include your organization name,
if applicable, and a contact email for license administration, security
advisories, and critical update notices. See LICENSE for the terms.
Author
Engineered by Mohamed Abdulalim (@megyptm)
Backend Lead & Technical Architect
https://www.maatify.dev
评论