Skip to content

fix(core): replace 'any' with typed AuthConfig in EventActions#405

Merged
kalenkevich merged 2 commits into
google:mainfrom
Nithin0620:chore/type-auth-config-event-actions
Jun 8, 2026
Merged

fix(core): replace 'any' with typed AuthConfig in EventActions#405
kalenkevich merged 2 commits into
google:mainfrom
Nithin0620:chore/type-auth-config-event-actions

Conversation

@Nithin0620

@Nithin0620 Nithin0620 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Link to Issue or Description of Change

Problem:
The AuthConfig type in EventActions (defined in core/src/events/event_actions.ts) was typed as any with a TODO: b/425992518. This lacked proper type safety and permitted incorrect assignments elsewhere in the codebase.

Solution:
Replaced any with the proper AuthConfig import from ../auth/auth_tool.js.
To resolve resulting TypeScript compiler errors:

  • Initialized requestedAuthConfigs as an empty object {} instead of an empty array [] inside the default actions block of token_based_context_compactor.ts.
  • Imported AuthConfig and cast actions.requestedAuthConfigs as Record<string, AuthConfig> (rather than Record<string, unknown>) in vertex_ai_session_service.ts.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Summary of passed npm test results:

  • Ran npm run test:unit locally.
  • All 142 test files and 1782/1782 tests passed successfully.

Manual End-to-End (E2E) Tests:

Verified that compiling the workspaces via npm run build succeeds without any TypeScript diagnostic errors (which previously failed on tsc with TS2322).

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

Addresses TODO: b/425992518 - Replace 'any' with a proper AuthConfig.

@kalenkevich kalenkevich merged commit 4172398 into google:main Jun 8, 2026
11 checks passed
@kalenkevich kalenkevich mentioned this pull request Jun 8, 2026
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