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

Function makeManagedErrorSession

src/services/api/errors.auth.test.ts:92–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90}
91
92function makeManagedErrorSession(): ResolvedAuthSession {
93 return {
94 principalKind: 'noumena_account',
95 principalSource: 'managed_oauth',
96 sessionState: 'usable',
97 headersKind: 'bearer',
98 providerAuthKind: 'noumena_first_party',
99 providerPlan: {
100 mode: 'noumena_managed',
101 source: 'managed_principal',
102 staticKeyEnvVarName: null,
103 },
104 isInteractive: true,
105 canRefresh: true,
106 canReauthenticateInteractively: true,
107 identity: {
108 email: 'user@example.com',
109 accountUuid: 'acct-123',
110 organizationUuid: 'org-123',
111 organizationName: 'Acme',
112 },
113 subscription: {
114 subscriptionName: 'Noumena Pro',
115 subscriptionType: 'pro',
116 rateLimitTier: 'tier-1',
117 },
118 scopes: ['user:profile', 'user:inference'],
119 hasUsableToken: true,
120 hasUsableApiKey: false,
121 accessToken: 'oauth-token',
122 accessTokenExpiresAt: Date.now() + 10 * 60_000,
123 refreshTokenPresent: true,
124 apiKey: null,
125 rawAuthTokenSource: 'noumena.com',
126 rawApiKeySource: null,
127 recoveryAction: 'none',
128 recoveryMessage: null,
129 sourceDetails: {
130 usedLegacyCompat: false,
131 usedEnvVar: false,
132 usedFileDescriptor: false,
133 usedHelper: false,
134 },
135 }
136}
137
138function makeDirectEnvApiKeySession(params: {
139 apiKey: string

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected