matthewwong525/WongStack / .agents/plugins/access
access
VerifiedSee who can sign in and what each person may use; add, change or remove a person.
signin/computer.test.mjs
View on GitHubimport { expect, test } from 'vitest';
import { headers, signInHelp, tokenClaims } from './computer.mjs';
const ORIGIN = 'https://app.example.com';
const token = claims => `eyJ.${Buffer.from(JSON.stringify(claims)).toString('base64url')}.sig`;
test('sends the saved sign-in while it is valid or near its end, and nothing once it is missing or expired', () => {
const read = state => () => ({ state, origin: ORIGIN, token: 'the-token' });
expect(headers(ORIGIN, read('valid'))).toEqual({ 'cf-access-token': 'the-token' });
expect(headers(ORIGIN, read('near'))).toEqual({ 'cf-access-token': 'the-token' });
expect(headers(ORIGIN, read('expired'))).toBeNull();
expect(headers(ORIGIN, read('missing'))).toBeNull();
});
test('reads a token\'s claims without verifying them, and a malformed token as none', () => {
expect(tokenClaims(token({ sub: 'ana', email: 'ana@example.com' }))).toEqual({ sub: 'ana', email: 'ana@example.com' });
expect(tokenClaims('not a token')).toBeNull();
expect(signInHelp(ORIGIN)).toContain(`cloudflared access login ${ORIGIN}`);
});
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 |