Skip to content

Commit d568152

Browse files
committed
test(plugin-auth): AuthManager's mint method is typed as the IAuthService member
Claude-Session: https://claude.ai/code/session_01QBUMRzs2CSSq7QCTU1gT2j Co-authored-by: Claude <noreply@anthropic.com>
1 parent 153141f commit d568152

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎packages/plugins/plugin-auth/src/principal-session-mint.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import { describe, it, expect, vi, beforeAll, beforeEach, afterAll } from 'vitest';
1515
import { SystemUserId } from '@objectstack/spec/system';
16-
import { PRINCIPAL_SESSION_MAX_TTL_SECONDS } from '@objectstack/spec/contracts';
16+
import { PRINCIPAL_SESSION_MAX_TTL_SECONDS, type IAuthService } from '@objectstack/spec/contracts';
1717
import { createMemoryEngine } from './impersonation-bearer-rotation.test';
1818
import { bootMintFixture, expiresAtMs, rawTokenOf, type MintFixture } from './principal-session-mint-test-support';
1919
import { PRINCIPAL_SESSION_TOKEN_PREFIX, holdPrincipalSessionExpiry } from './principal-session-mint';
@@ -120,6 +120,11 @@ describe('[#23772] refusals — before anything is minted', () => {
120120
});
121121

122122
describe('[#23772] the minted session', () => {
123+
it("AuthManager's method IS the contract member (a drift fails the test layer's typecheck)", () => {
124+
const member: Required<IAuthService>['mintPrincipalSession'] = fx.manager.mintPrincipalSession.bind(fx.manager);
125+
expect(typeof member).toBe('function');
126+
});
127+
123128
it('a human principal (principalKind absent or human) mints, branded, impersonatedBy unset', async () => {
124129
for (const ctx of [fx.human(), fx.human({ principalKind: 'human' })]) {
125130
const minted = await fx.manager.mintPrincipalSession(ctx);

0 commit comments

Comments
 (0)