Skip to content

Commit c0412ee

Browse files
refactor(detection-emulation): move resolveCurrentUsername to shared lib
Relocates resolve_current_user.ts from the skill-specific directory to server/lib/detection_emulation/ so it's importable from both the Agent Builder tool handlers and the REST routes without a cross-concern import path. Previously flagged in the code itself as "should be upstreamed" — this is the short-term path (shared within the plugin) while awaiting an export from @kbn/agent-builder-server.
1 parent bf9706a commit c0412ee

3 files changed

Lines changed: 2 additions & 2 deletions

File tree

x-pack/solutions/security/plugins/security_solution/server/agent_builder/skills/detection_emulation/validate_rule_tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import {
4646
resolveRateLimiterConfig,
4747
} from '../../../lib/detection_emulation/runtime_config_resolver';
4848
import { buildAgentBuilderActor } from '../../../lib/detection_emulation/execution/audit_context';
49-
import { resolveCurrentUsername } from './resolve_current_user';
49+
import { resolveCurrentUsername } from '../../../lib/detection_emulation/resolve_current_user';
5050
import { validateRuleSchema } from './validate_rule_input';
5151
import { toolError, type EmulationErrorContext } from './emulation_tool_errors';
5252

x-pack/solutions/security/plugins/security_solution/server/agent_builder/skills/detection_emulation/with_command_gates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { buildIdempotencyKey } from '../../../lib/detection_emulation/execution/
2424
import type { ActorContext } from '../../../lib/detection_emulation/execution/audit_context';
2525
import { createSavedObjectRuleBindingLookup } from '../../../lib/detection_emulation/rule_binding_lookup';
2626
import { emulationRuleBindingTypeName } from '../../../lib/detection_emulation/rule_binding';
27-
import { resolveCurrentUsername } from './resolve_current_user';
27+
import { resolveCurrentUsername } from '../../../lib/detection_emulation/resolve_current_user';
2828
import { toolError, type EmulationErrorContext } from './emulation_tool_errors';
2929
import {
3030
checkRealExecutionFeatureFlags,

x-pack/solutions/security/plugins/security_solution/server/agent_builder/skills/detection_emulation/resolve_current_user.ts renamed to x-pack/solutions/security/plugins/security_solution/server/lib/detection_emulation/resolve_current_user.ts

File renamed without changes.

0 commit comments

Comments
 (0)