Repository navigation
[access] refactor(public-share): split PublicShareService share creation, opening and lookup into named steps - #1078
Open
rubenvdlinde wants to merge 2 commits into
Open
rubenvdlinde wants to merge 2 commits into
rubenvdlinde wants to merge 2 commits into
Conversation
…ions before the split Assisted-by: ClaudeCode:claude-opus-5-5
…ing and lookup into named steps Assisted-by: ClaudeCode:claude-opus-5-5
rubenvdlinde
requested review from
WilcoLouwerse,
bbrands02 and
rjzondervan
as code owners
November 11, 2026 18:46
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.
What changed
PublicShareServicereads as named steps instead of three long, branchy methods. The public signatures, including the sensitive-parameter markers, are unchanged, and every new step that receives a password carries the same marker.createPublicShare: authorisation first (unchanged), thennewShare→applyPassword→applyExpiry(parseExpiry: the same three formats in the same order and the same message) →storeShare(insertShare, which keeps logging the exception class only).renderShareContent:resolveActiveShare, then the password gate aslacksPassword/rejectsPassword(a wrong password is still recorded before the refusal), thenshareContent(dashboard, view count, placements); the token and IP of the visit travel as aPublicShareVisit.resolveActiveShare→findShareByToken,isExpired(parseStoredExpiry), with the three identical record-and-refuse blocks folded intorefuseAccess.unlockShareand the render gate shareregisterPasswordFailure.Allowed and refused outcomes are unchanged: the same exceptions, the same attempts recorded with the same action and IP in the same order, the same stored fields and log lines.
Characterisation tests
tests/Unit/Service/PublicShareServiceAccessGoldenTest.phpwas committed first, against the old code, and passes before and after: a non-owner non-admin refused before any token is made, the created share's fields, the password hashing (none, empty, set,"0"), every expiry format and the refused ones, the storage-failure log and message, admin creation; every closed share (unknown, revoked, expired in both stored formats) with exactly one recorded access attempt and no view counted; every password-gate case with its recorded events; and every unlock case including the throttle wait before the lookup. Expiry times are relative to now. Mutation check: disabling the revocation check on the old code turned two goldens red; restored before committing.What ran
vendor/bin/phpunit -c phpunit.xml --no-coverage tests/Unit: 2774 tests OK (13 skipped, as on development), including the existing sensitive-parameter test.vendor/bin/phpcsandvendor/bin/phpstan analyseon the touched lib files: clean.Figures (touched files
lib/Service/PublicShareService.php,lib/Service/PublicShareVisit.php)createPublicShare(11)App-wide: unit complexity 4.02 → 4.08, unit size 3.40 → 3.42, unit interfacing 3.14 → 3.16, duplication 4.54 → 4.55.
Maintainability floor: compare against development holds.
AI-assisted: prepared with Claude Code (claude-opus-5-5); reviewed by a maintainer before merge.
Generated by Claude Code