MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / InMemoryStorage

Class InMemoryStorage

packages/oauth/test/oauth-manager.test.ts:22–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20import type { DeviceAuthorization, OAuthFlowConfig, TokenInfo } from '../src/types';
21
22class InMemoryStorage implements TokenStorage {
23 public store = new Map<string, TokenInfo>();
24
25 async load(name: string): Promise<TokenInfo | undefined> {
26 return this.store.get(name);
27 }
28
29 async save(name: string, token: TokenInfo): Promise<void> {
30 this.store.set(name, token);
31 }
32
33 async remove(name: string): Promise<void> {
34 this.store.delete(name);
35 }
36
37 async list(): Promise<string[]> {
38 return [...this.store.keys()];
39 }
40}
41
42const config: OAuthFlowConfig = {
43 name: 'kimi-code',

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected