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

Class MemoryTokenStorage

packages/oauth/test/toolkit.test.ts:16–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14} from '../src';
15
16class MemoryTokenStorage implements TokenStorage {
17 readonly tokens = new Map<string, TokenInfo>();
18
19 async load(name: string): Promise<TokenInfo | undefined> {
20 return this.tokens.get(name);
21 }
22
23 async save(name: string, token: TokenInfo): Promise<void> {
24 this.tokens.set(name, token);
25 }
26
27 async remove(name: string): Promise<void> {
28 this.tokens.delete(name);
29 }
30
31 async list(): Promise<string[]> {
32 return [...this.tokens.keys()];
33 }
34}
35
36function token(accessToken: string): TokenInfo {
37 return {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected