feat: support access logs — endpoint + auto-registration - #1544
Open
ludoviccardinale wants to merge 6 commits into
Open
feat: support access logs — endpoint + auto-registration#1544ludoviccardinale wants to merge 6 commits into
ludoviccardinale wants to merge 6 commits into
Conversation
Add a public front controller (SupportLogs) that exposes paginated log files to the PrestaShop support tool, protected by a per-shop Bearer token stored in PS Configuration (PS_CHECKOUT_SUPPORT_TOKEN). The token is generated at install time and can be viewed/rotated from the backoffice debug panel via two new AJAX actions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…troller Add SupportRegistrationService that periodically registers the shop (UUID, URL, Bearer token) with the internal support tool API, triggered from hookActionAdminControllerSetMedia with a 24h cooldown. Rewrite SupportLogs front controller to list and stream log files directly from var/logs/ without using LoggerFileFinder, avoiding a crash caused by non-date filenames in the log directory. Add PS_CHECKOUT_SUPPORT_TOOL_REGISTER_URL, PS_CHECKOUT_SUPPORT_API_KEY, and PS_CHECKOUT_SUPPORT_REGISTERED_AT configuration keys. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generates PS_CHECKOUT_SUPPORT_TOKEN for all existing shops that don't have one yet, and resets PS_CHECKOUT_SUPPORT_REGISTERED_AT so the auto-registration with the support tool fires on the next admin page load after the module is updated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove PS_CHECKOUT_SUPPORT_TOOL_REGISTER_URL and PS_CHECKOUT_SUPPORT_API_KEY from PS Configuration (would always be empty for merchants). Read them instead from the module .env via EnvInterface — same pattern as PayPal credentials, filled at packaging time and never committed for production. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Files named with a Monolog channel prefix (e.g. ps_checkout-1-http-2026-05-06) caused DateUtility::formatDate to throw, crashing the admin log viewer. Skip those entries instead of aborting the whole listing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
@ludoviccardinale Hello, the latest version is currently available on the 5.5.x branch. The main branch appears to be outdated and is still on 5.2.x. |
Matt75
requested changes
May 21, 2026
Matt75
left a comment
Contributor
There was a problem hiding this comment.
Please rebase on branch 5.5.x
- Delete SupportLogs front controller (ps8 + ps9) - Delete SupportTokenService and SupportRegistrationService from core - Remove DI entries from config/common.yml (ps8 + ps9) - Remove use statement and hookActionAdminControllerSetMedia call from ps_checkout.php (ps8 + ps9) - Remove upgrade-8.5.2.0.php (ps8 + ps9) - Remove PS_CHECKOUT_SUPPORT_TOKEN and PS_CHECKOUT_SUPPORT_REGISTERED_AT from DefaultConfiguration All support tooling functionality is now in the standalone ps_support_tooling module. Co-Authored-By: Claude Sonnet 4.6 <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
How it works
On first BO page load after install/upgrade, the module POSTs `{shopUrl, shopUuid, token}` to the support tool API. The support agent can then fetch logs directly from the merchant's shop using the token — no manual copy-paste needed.
The `SupportLogs` endpoint is a standard PS front controller secured by a Bearer token. It returns a JSON list of log files or streams a paginated file.
Related PRs
Test plan
🤖 Generated with Claude Code