MCPcopy Create free account
hub / github.com/Noumena-Network/code / buildSession

Function buildSession

src/commands/env/envCommandSession.test.ts:9–56  ·  view source on GitHub ↗
(
  overrides: Partial<ResolvedAuthSession> = {},
)

Source from the content-addressed store, hash-verified

7} from './envCommandSession.js'
8
9function buildSession(
10 overrides: Partial<ResolvedAuthSession> = {},
11): ResolvedAuthSession {
12 return {
13 principalKind: 'noumena_account',
14 principalSource: 'managed_oauth',
15 sessionState: 'usable',
16 headersKind: 'bearer',
17 providerAuthKind: 'noumena_first_party',
18 providerPlan: {
19 mode: 'noumena_managed',
20 source: 'managed_principal',
21 staticKeyEnvVarName: null,
22 },
23 isInteractive: true,
24 canRefresh: true,
25 canReauthenticateInteractively: true,
26 identity: {
27 email: 'user@noumena.net',
28 accountUuid: 'acct',
29 organizationUuid: 'org',
30 organizationName: 'org',
31 },
32 subscription: {
33 subscriptionName: 'Max',
34 subscriptionType: 'max',
35 rateLimitTier: 'default',
36 },
37 scopes: ['user:inference', 'user:profile'],
38 hasUsableToken: true,
39 hasUsableApiKey: false,
40 accessToken: 'token',
41 accessTokenExpiresAt: null,
42 refreshTokenPresent: true,
43 apiKey: null,
44 rawAuthTokenSource: 'managed-session',
45 rawApiKeySource: null,
46 recoveryAction: 'none',
47 recoveryMessage: null,
48 sourceDetails: {
49 usedLegacyCompat: false,
50 usedEnvVar: false,
51 usedFileDescriptor: false,
52 usedHelper: false,
53 },
54 ...overrides,
55 }
56}
57
58describe('envCommandSession', () => {
59 it('accepts managed remote-env sessions', () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected