Skip to content

Auditor can be given additional context information - #26913

Open
luk-kaminski wants to merge 1 commit into
masterfrom
mcp_tools/audit_log/id_present_in_context
Open

Auditor can be given additional context information#26913
luk-kaminski wants to merge 1 commit into
masterfrom
mcp_tools/audit_log/id_present_in_context

Conversation

@luk-kaminski

Copy link
Copy Markdown
Contributor

Description

Auditor can be given additional context information.
/nocl

Motivation and Context

Sometimes, when audit logs are not created from the REST layer, some important pieces of information can be missing.
You can append them manually do the context.

How Has This Been Tested?

Manually.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@luk-kaminski
luk-kaminski requested a review from monrax August 6, 2026 12:12
@luk-kaminski
luk-kaminski marked this pull request as ready for review August 6, 2026 12:12
return audited(username, eventType, actionInput, auditableAction, SUCCESS_ON_NON_NULL, null);
}

public <T> T audited(final String username,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this guy has no call sites. Should we drop it?

null,
Map.of(ERROR, String.valueOf(e.getMessage())));
final Map<String, Object> extraWithError = new LinkedHashMap<>();
if (extra != null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what about passing Map.of() in the overloads? then

final Map<String, Object> extraWithError = new LinkedHashMap<>(extra);
extraWithError.put(ERROR, String.valueOf(e.getMessage()));

@monrax monrax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

except for the incredibly minor nitpicks, LGTM!

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