Skip to content

Show a session's reason as text - #108

Merged
jeremy merged 1 commit into
masterfrom
session-reason-text
Nov 2, 2026
Merged

jeremy merged 1 commit into
masterfrom
session-reason-text

Conversation

@jeremy

@jeremy jeremy commented Nov 2, 2026

Copy link
Copy Markdown
Member

A session's reason and a sensitive access's justification are text that a console user typed. The session header and the executed-code card passed them to Rinku.auto_link and then html_safe. Rinku links URLs but passes everything else through as markup, so a reason containing <b> rendered bold.

This adds text_with_links, which escapes the text and then links it. Both views use it. URLs are still linked: one with a query string keeps its & in the href, and anything else shows as the characters typed.

Every other place audits1984 shows session data already escapes it. That covers the username in the header, the breadcrumb and the session list; the reason in the session list (<%= %>); executed code, which goes through Rouge's HTML formatter; and the JSON views, which go through Jbuilder.

test/integration/session_text_test.rb renders a session whose reason, justification and command contain markup and URLs. For the reason and the justification, it checks that no element is created, that the text shows as typed, and that the URL is linked. Without the view change, both of those tests fail. It also pins that executed code shows as text. Full suite: 62 runs, 0 failures.

A session's reason and a sensitive access's justification are text a
console user typed. Rinku links their URLs but passes everything else
through as markup, so render them escaped first: Rinku still links the
URLs, and anything else shows as the characters typed.

Tests cover both, with a URL carrying a query string, and pin that
executed code shows as text too.
Copilot AI balanced review requested due to automatic review settings November 2, 2026 21:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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 ⚠️ Failed 2026-11-02T22:14:51.079663Z
We couldn’t complete this review. Comment @codex review to try again.
527c3fe Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

No active review issues are reported for the changes that render user-entered reasons and justifications as text while preserving clickable URLs.

No open issues 🎉

What changed in this PR

This PR renders user-entered session reasons and sensitive-access justifications as text rather than HTML, while preserving clickable URLs in the audit interface.

Changes:

  • Adds text_with_links to escape text before linking URLs.
  • Uses the helper in the session header and executed-code card.
  • Adds integration coverage for literal markup, linked URLs, and escaped executed code.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
test/​integration/​session_text_test.rb Tests text rendering, URL preservation, and escaped executed code.
app/​views/​audits1984/​sessions/​_header.html.erb Renders session reasons through the new helper.
app/​views/​audits1984/​sessions/​_executed_code.html.erb Renders sensitive-access justifications through the new helper.
app/​helpers/​audits1984/​application_helper.rb Adds shared escaping and URL-linking behavior.

Review effort: Balanced

@jeremy

jeremy commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@jeremy

jeremy commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

Review threads: none. Copilot approved 527c3fe.
Not reported on the head: Codex, at 527c3fe. Its reviews failed on its usage limit, including after one @codex review.
CI: green except the six rails_8_0 jobs. Their system tests fail on json 3.1.0, released since master last passed: ArgumentError: unknown keyword: quirks_mode from ActiveSupport 8.0.5.1's encoder, called through ferrum. This change doesn't touch that path.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

@jeremy
jeremy merged commit f99fc64 into master Nov 2, 2026
25 of 31 checks passed
@jeremy
jeremy deleted the session-reason-text branch November 2, 2026 22:19
jeremy added a commit to basecamp/fizzy that referenced this pull request Nov 2, 2026
basecamp/audits1984#108: the session header and the sensitive access card
render the reason and justification escaped, with URLs still linked.
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.

2 participants