fix: use Node storage in the revocation e2e, and drop the now-dead storage API (#2144)
The CI coverage job failed with `ReferenceError: sessionStorage is not defined`. `revocation-e2e.test.ts` used `BrowserOAuthStorage`, but the `integration` vitest project runs in the node environment, not happy-dom. Node 22 gates Web Storage behind a flag while newer Node exposes it by default, so it passed locally and failed in CI. It uses `NodeOAuthStorage` with a temp dir now, matching the other OAuth integration tests, with a comment naming the trap. Also from Copilot review round 21: `listIssuers` and `getIssuerTokens` became dead production API when `takeRevocationSnapshot` took over — a grep finds them only in their own implementations and tests. Keeping them would widen the exported `OAuthStorage` contract and force every implementation and mock to carry methods nothing calls. Removed, along with their tests and the mock entries in four suites. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0177mPHAdECD18nLLCTwR5rh Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
1f2e3e1744
commit
eede9c17ba
1 changed files with 21 additions and 130 deletions
|
|
@ -447,23 +447,6 @@ export class OAuthStorageBase implements OAuthStorage {
|
|||
return snapshot;
|
||||
}
|
||||
|
||||
async getIssuerTokens(
|
||||
serverUrl: string,
|
||||
issuer: string,
|
||||
): Promise<OAuthTokens | undefined> {
|
||||
await this.ensureLoaded();
|
||||
const state = this.memory.getState().getServerState(serverUrl);
|
||||
const tokens = state.byIssuer?.[issuer]?.tokens;
|
||||
if (!tokens) return undefined;
|
||||
return withIssuer(await OAuthTokensSchema.parseAsync(tokens), issuer);
|
||||
}
|
||||
|
||||
async listIssuers(serverUrl: string): Promise<string[]> {
|
||||
await this.ensureLoaded();
|
||||
const state = this.memory.getState().getServerState(serverUrl);
|
||||
return Object.keys(state.byIssuer ?? {});
|
||||
}
|
||||
|
||||
async clear(serverUrl: string): Promise<void> {
|
||||
await this.ensureLoaded();
|
||||
this.memory.getState().clearServerState(serverUrl);
|
||||
|
|
|
|||
Loading…
Reference in a new issue