| 93 | } |
| 94 | |
| 95 | function makeDirectApiKeySession(apiKey = 'api-key'): ResolvedAuthSession { |
| 96 | return { |
| 97 | principalKind: 'api_key_user', |
| 98 | principalSource: 'direct_api_key_env', |
| 99 | sessionState: 'usable', |
| 100 | headersKind: 'api_key', |
| 101 | providerAuthKind: 'noumena_first_party', |
| 102 | providerPlan: { |
| 103 | mode: 'noumena_managed', |
| 104 | source: 'direct_api_key_env', |
| 105 | staticKeyEnvVarName: 'NOUMENA_API_KEY', |
| 106 | }, |
| 107 | isInteractive: true, |
| 108 | canRefresh: false, |
| 109 | canReauthenticateInteractively: false, |
| 110 | identity: { |
| 111 | email: null, |
| 112 | accountUuid: null, |
| 113 | organizationUuid: null, |
| 114 | organizationName: null, |
| 115 | }, |
| 116 | subscription: { |
| 117 | subscriptionName: null, |
| 118 | subscriptionType: null, |
| 119 | rateLimitTier: null, |
| 120 | }, |
| 121 | scopes: [], |
| 122 | hasUsableToken: false, |
| 123 | hasUsableApiKey: true, |
| 124 | accessToken: null, |
| 125 | accessTokenExpiresAt: null, |
| 126 | refreshTokenPresent: false, |
| 127 | apiKey, |
| 128 | rawAuthTokenSource: null, |
| 129 | rawApiKeySource: 'NOUMENA_API_KEY', |
| 130 | recoveryAction: 'none', |
| 131 | recoveryMessage: null, |
| 132 | sourceDetails: { |
| 133 | usedLegacyCompat: false, |
| 134 | usedEnvVar: true, |
| 135 | usedFileDescriptor: false, |
| 136 | usedHelper: false, |
| 137 | }, |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | function makeServiceOauthSession(scopes: string[]): ResolvedAuthSession { |
| 142 | return { |