Skip to content

Add veto event before portal domain redirects - #666

Merged
mesilov merged 2 commits into
v3-devfrom
codex/632-redirect-veto
Sep 30, 2026
Merged

mesilov merged 2 commits into
v3-devfrom
codex/632-redirect-veto

Conversation

@mesilov

@mesilov mesilov commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator
Q A
Bug fix? yes
New feature? yes
Deprecations? no
Issues Fix #632
License MIT

A cross-domain HTTP 302 currently repeats the API call with OAuth credentials before applications can intervene. Add PortalDomainUrlChangingEvent before credential mutation and the retry. A listener can call deny() to reject the transition with PortalDomainChangeRejectedException (a PortalUnavailableException subclass), retaining the current domain and sending no request to the denied destination.

$dispatcher->addListener(
    PortalDomainUrlChangingEvent::class,
    static function (PortalDomainUrlChangingEvent $event): void {
        $event->deny('Portal domain must be updated through reinstallation');
    }
);

The first denial wins. Stopping event propagation alone does not veto a transition. Existing automatic following without a denial and the post-success PortalDomainUrlChangedEvent remain compatible. This is an application-controlled veto, not a default destination restriction. See docs/portal-domain-redirects.md for builder wiring, exception handling and multi-hop behavior.

Test plan

  • make lint-cs-fixer
  • make lint-rector
  • make lint-phpstan
  • make lint-deptrac
  • make test-unit — 1964 tests, 6492 assertions; exit 0 with 11 deprecations. The new focused tests emit none.
  • Focused redirect regression tests — 4 tests, 33 assertions, covering veto, unchanged credentials, listener ordering, first denial, default following, stopPropagation and later-hop denial. Initial RED run reproduced two failures before the fix.
  • make test-file path=tests/Integration/Core/CoreTest.php — 3 tests, 3 assertions.
  • make test-integration-core — 24 tests, 3174 assertions, one error and one failure: the 2510-contact fixture hit the portal operation-time limit during deletion; ScopeTest found catalog drift (aiassistant, biconnectormobile, bizprocdesigner, mailsender). Those source/test files are unchanged from the base. This PR remains draft because the full gate is not green.
  • Independent code review — no actionable findings.

Closes #632

Generated with Codex using the repository b24phpsdk-maintainer workflow.

@mesilov mesilov self-assigned this Sep 30, 2026
@mesilov mesilov added this to the 3.7.0 milestone Sep 30, 2026
@mesilov
mesilov marked this pull request as ready for review September 30, 2026 07:37
@mesilov
mesilov merged commit 063e256 into v3-dev Sep 30, 2026
12 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T07:39:26.014534Z 60d7b7e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant