import type { TokenStore } from '../../src/store/token-store.js' // In-memory TokenStore for tests; mirrors keyring semantics (empty string = missing). export class MemStore implements TokenStore { readonly entries: Map // Seed keys use the composite " " form, e.g. { 'h1 a@x': 'dfoa_a' }. constructor(seed: Record = {}) { this.entries = new Map(Object.entries(seed)) } private k(host: string, email: string): string { return `${host} ${email}` } async read(host: string, email: string): Promise { return this.entries.get(this.k(host, email)) ?? '' } async write(host: string, email: string, bearer: string): Promise { this.entries.set(this.k(host, email), bearer) } async remove(host: string, email: string): Promise { this.entries.delete(this.k(host, email)) } }