Repository navigation
feat(hydra): filter the Hydra documentation and the entrypoint per caller (0.10.0) - #27
Merged
Merged
Conversation
…rationAccessDecider [*] GrantSetResolver delegates the security and access_control decision to a decider that judges a single HttpOperation, whether or not it has an OpenAPI entry. The grant set and the OpenAPI filter are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…OperationMap [*] The mapping from a documented Hydra entry to its operation moves out of HydraDocumentationSubscriber into a service of its own, so a later filter can share it. The enriched documentation is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…es [*] discovery.filter_operations_by_security and discovery.show_object_dependent_operations switch every discovery document. The openapi.* keys stay as deprecated aliases until 0.12.0; a contradiction between old and new key, an env placeholder in the filter switch and values that cannot be proven equal fail the container build. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
/api/docs.jsonld shows a caller only the operations the caller may execute, by security expression and access_control. A class that lost all its operations is removed with its entrypoint property; error classes and classes without operations stay. Unmatched entries are denied, and a document of unknown shape (no hydra: prefix) becomes an empty document. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
/api and /api/index.<format> in JSON-LD, HAL and JSON:API show a link only when the caller may execute the operation that format links to. The decision is made on the emitted URL, so no format falls back to another allowed operation; an unmatched URL is dropped. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rivate [*] /api/docs.jsonld and the entrypoint in every format now depend on the caller, so they carry Cache-Control: private and Vary: Authorization like the OpenAPI document, also under a public cache configuration. With the filter off API Platform's headers stay. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ntation [*] A remaining class no longer names a removed class in range, hydra:expects or subClassOf; the property or operation itself stays documented. hydra:returns keeps its name on purpose: api-doc-parser discards an operation without it, and the caller sees that type in the response. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…point, release 0.10.0 [*] Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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
The per-caller filter of 0.9.0 now covers all three discovery documents: the OpenAPI document, the Hydra documentation
/api/docs.jsonldand the entrypoint/api(JSON-LD, HAL, JSON:API). Same rule everywhere: the operation'ssecurityexpression plus the firewall'saccess_control.OperationAccessDecider, the positional Hydra entry mapping intoDocumentedOperationMap; no behaviour change for the OpenAPI document.discovery.filter_operations_by_securityanddiscovery.show_object_dependent_operations; theopenapi.*keys stay as deprecated aliases until0.12.0. Contradictory values, an environment placeholder in the filter switch and values that cannot be proven equal fail the container build.hydra:prefix is answered with a document without classes. References to removed classes are dropped fromrange,hydra:expectsandsubClassOf;hydra:returnskeeps its name on purpose.Cache-Control: privateandVary: Authorization.Consumer action
Set
api_platform.serializer.hydra_prefix: trueor switch the filter off, otherwise/api/docs.jsonldloses its classes. Move fromopenapi.*todiscovery.*before0.12.0. Details inCHANGELOG.md(0.10.0) andREADME.md.Tests
724 tests green locally (PHP 8.4, API Platform 4.4.10), up from 506. The new kernel test classes run in separate processes because the suite is close to PHP's 128 MB memory limit.
The JSON-LD contexts (
/api/contexts/*) are not filtered yet.Part of #21
🤖 Generated with Claude Code