(
overrides: Partial<ResolvedAuthSession> = {},
)
| 5 | import { resolveFeedbackAuthHeaders } from './feedbackSession.js' |
| 6 | |
| 7 | function makeSession( |
| 8 | overrides: Partial<ResolvedAuthSession> = {}, |
| 9 | ): ResolvedAuthSession { |
| 10 | return { |
| 11 | principalKind: 'noumena_account', |
| 12 | principalSource: 'managed_oauth', |
| 13 | sessionState: 'usable', |
| 14 | headersKind: 'bearer', |
| 15 | providerAuthKind: 'noumena_first_party', |
| 16 | providerPlan: { |
| 17 | mode: 'noumena_managed', |
| 18 | source: 'managed_principal', |
| 19 | staticKeyEnvVarName: null, |
| 20 | }, |
| 21 | isInteractive: true, |
| 22 | canRefresh: true, |
| 23 | canReauthenticateInteractively: true, |
| 24 | identity: { |
| 25 | email: 'user@noumena.net', |
| 26 | accountUuid: 'acct-1', |
| 27 | organizationUuid: 'org-1', |
| 28 | organizationName: 'Noumena', |
| 29 | }, |
| 30 | subscription: { |
| 31 | subscriptionName: 'Noumena Max', |
| 32 | subscriptionType: 'max', |
| 33 | rateLimitTier: 'tier-1', |
| 34 | }, |
| 35 | scopes: ['user:inference'], |
| 36 | hasUsableToken: true, |
| 37 | hasUsableApiKey: false, |
| 38 | accessToken: 'managed-token', |
| 39 | accessTokenExpiresAt: Date.now() + 60_000, |
| 40 | refreshTokenPresent: true, |
| 41 | apiKey: null, |
| 42 | rawAuthTokenSource: 'noumena.com', |
| 43 | rawApiKeySource: null, |
| 44 | recoveryAction: 'none', |
| 45 | recoveryMessage: null, |
| 46 | sourceDetails: { |
| 47 | usedLegacyCompat: false, |
| 48 | usedEnvVar: false, |
| 49 | usedFileDescriptor: false, |
| 50 | usedHelper: false, |
| 51 | }, |
| 52 | ...overrides, |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | describe('resolveFeedbackAuthHeaders', () => { |
| 57 | const runtime = getAuthRuntime() as { |
no outgoing calls
no test coverage detected