Repository navigation
fix(audit): text columns for URL and User-Agent; mask credentials in the audited URL - #70
Merged
Merged
Conversation
…dentials in the URL The columns were varchar(255) while the values were cut to 2048/1024: on PostgreSQL an OAuth callback URL failed the audit insert and the request with it. A migration makes both text. AuditLog::requestContext() builds the context once, masking the query parameters listed in admin.audit.redacted_query (code, state, tokens, signature…). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
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.
Found by printable's SSO end-to-end run against a real Keycloak on PostgreSQL: the sign-in callback answered 500.
Bug.
admin_audit_logs.urland.user_agentwerevarchar(255), while the values are cut toadmin.audit.url_max_length(2048) anduser_agent_max_length(1024). Any longer value — an OAuth callback carrying its code, a long User-Agent — failed the insert on PostgreSQL/MySQL, and the audited request with it. SQLite does not check string lengths, so the suite never saw it. A migration turns both columns intotext.Security. The audited URL kept credentials from the query string (the OAuth authorization code and state in this case; signed links' signatures elsewhere). The new
admin.audit.redacted_querylists parameter names masked as[redacted];AuditLog::requestContext()/AuditLog::redactUrl()build the context forLoggable,AuthAuditListenerand packages writing their own rows.Tests: redaction, context lengths, column types after the migration.
🤖 Generated with Claude Code