matthewwong525/WongStack / .agents/plugins/access
access
VerifiedSee who can sign in and what each person may use; add, change or remove a person.
signin/cloudflare-list.test.mjs
View on GitHubimport { afterEach, expect, test, vi } from 'vitest';
import { provider } from './cloudflare-list.mjs';
afterEach(() => { vi.unstubAllGlobals(); });
test('limits the key to fixed provider destinations, refuses redirects and hides provider errors', async () => {
const fetch = vi.fn(async () => Response.json({ ok: true })); vi.stubGlobal('fetch', fetch);
expect(await provider('/app', 'secret')).toEqual({ ok: true });
await provider('/app', 'secret', 'POST', { safe: true });
expect(fetch.mock.calls[1]).toMatchObject(['https://api.cloudflare.com/client/v4/app', { redirect: 'manual', body: '{"safe":true}' }]);
for (const path of ['https://other.example.com', '//other.example.com', '/../secret']) {
await expect(provider(path, 'secret')).rejects.toMatchObject({ code: 'provider_destination_invalid' });
}
for (const status of [302, 401, 404, 500]) {
fetch.mockImplementationOnce(async () => new Response('secret diagnostics', { status }));
await expect(provider('/app', 'secret')).rejects.toMatchObject({ code: status === 404 ? 'provider_not_found' : 'provider_unavailable' });
}
fetch.mockImplementationOnce(async () => new Response(null, { status: 204 }));
expect(await provider('/installation/token', 'secret', 'DELETE')).toBeNull();
fetch.mockImplementationOnce(async () => new Response(' '.repeat(1_048_577)));
await expect(provider('/app', 'secret')).rejects.toMatchObject({ code: 'json_body_too_large' });
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |