Multi-tenant enhancements: JWT resolver, PHPStan, HTTP layer, coverage#7
Merged
Conversation
…key handling - Add `sortByDependencies` to ensure entities with dependencies are generated in the correct order. - Detect and report circular dependencies during sorting. - Enhance handling of primary keys in `EntityGenerator` and `MigrationBuilder` to support entities with non-standard primary key names. - Update `EntitySchema` to expose primary key details.
Extracts tenant_id (or a configurable claim) from a signed JWT in the Authorization header. Registered in TenantResolverFactory as resolver type 'jwt'. Configurable via tenancy.jwt_public_key, jwt_algorithm (default RS256), and jwt_tenant_claim (default tenant_id). 8 tests covering happy path, custom claim, case-insensitive header, missing header, wrong scheme, invalid token, missing claim, and expiry.
User.json: rename id→user_id, add unique email index and name index. Post.json: new entity with belongsTo User relation and composite indexes. application.yaml: switch active resolver back to header, leave JWT config commented for reference.
The unsupported-type test was using 'jwt' as the unknown resolver, which is now valid. Changed to 'unknown' so the test correctly exercises the default throw branch.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
as resolver: jwt; configurable algorithm, claim name, and public key
so migration timestamps are ordered correctly across related entities
tenant lifecycle, migration dry-run, boot sequence, and key invariants