← Back to Pull requests

Declare a permission on API operations that had none #588

Open
unknown opened this pull request with 261 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 17, 2026 21:22 UTC
Author

19 API operations declared no permission in @MirthOperation, so an authorization controller had nothing to check for them. Each now declares an existing permission:

| Operations | Permission |
|---|---|
| Connector tests (Document Writer, File Reader and Writer, HTTP, TCP, SMTP and Web Service senders), the Web Service WSDL operations, Database getTables, JMS template save and delete | manageChannels |
| JMS getTemplates, getTemplate | viewChannels |
| getProperty | viewServerSettings |
| setUpdateSettings | editServerSettings |

Also:

  • JMS deleteTemplate was declared with the operation name saveTemplate, and its API summary described a save.

  • New MirthOperationPermissionTest walks every @MirthOperation in the core API, connectors and bundled plugins. It fails when one declares no permission and isn't on the test's list of operations that need none (each listed with its reason), and when a list entry matches no such operation or more than one overloaded method.
  • Left out on purpose

    These still declare no permission and are on the test's list:

  • The four message audit operations (auditAccessedPHIMessage, auditQueriedPHIMessage, auditExportMessages, auditExportMessagesSuccess). The client calls them to record that a user viewed, searched or exported messages. Whether that auditing belongs on the server is its own question.

  • The user preference operations and setUserNotificationAcknowledged. Every user reads and writes their own preferences through them, so a permission there is a separate change.
  • How to verify

    ./gradlew :server:test --tests com.mirth.connect.client.core.api.MirthOperationPermissionTest: on main it fails and lists the 19; on this branch it passes.

    Tested

  • ./gradlew clean build: 918 tests, 0 failures.

  • Main and this branch booted on Derby with the stock authorization controller: every labelled operation I called as admin gave the same response on both.

  • While I normally run all databases, there is no database change in this PR, so I ran Derby only.
  • Co-authored with Claude Code.

    Diff: 261 lines (+195 / -66) across 3 files Reviewer: mgaffigan Review duration: 18420m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.62) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.62 · 261 lines diff across 3 files
    0.62
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.333
    Sensitive Paths sensitive_paths
    0.062
    Real PR Conversation Timeline
    1 comments
    "Review active on #588"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.4% (MEDIUM) · Higher = larger blast radius
    62.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 33.3% · Safe to merge
    33.3%