Логотип Hor Cookie Authentication

Hor Cookie Authentication

Організація
openreachtech
hor-cookie-authentication

Password sign-in with cookie-based sessions for a renchan backend, per actor: the credential and token models (password hash, access + rotating refresh tokens with reuse detection), the refresh-token HttpOnly cookie, the signIn / signUp / signOut / renewAccessToken resolvers, and the engine's public-operation policy. Use when adding password auth to an actor/role. Boundary: external identity provider sign-in and other credential routes have their own conventions.

Огляд

Видавецьopenreachtech
Репозиторійhora-skills-ort-renchan
Назва навичкиhor-cookie-authentication
Зірки
32
Форки
0
Файли в пакеті
9
ЛіцензіяApache-2.0
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 9

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем openreachtech. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Hor Cookie Authentication у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-cookie-authentication
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/openreachtech/hora-skills-ort-renchan.git /tmp/hora-skills-ort-renchan
mkdir -p .claude/skills
cp -r /tmp/hora-skills-ort-renchan/kit/skills/hor-cookie-authentication .claude/skills/hor-cookie-authentication
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Hor Cookie Authentication в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Hor Cookie Authentication, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Hor Cookie Authentication не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Cookie Authentication (Backend)

Use this skill when adding password sign-in with cookie-based sessions to a renchan backend: storing an actor's credential and tokens, the sign-in / sign-out / renew operations, the refresh-token cookie, and deciding which operations are public.

An authenticated actor (a role such as user, customer, admin, or tenant) keeps its password as a hash and authenticates with two tokens: a short-lived access token the client sends as a header, and a long-lived refresh token kept in the DB and handed to the browser as an HttpOnly cookie. signIn issues both; renewAccessToken reads the cookie, rotates the refresh token (detecting reuse of a retired one), and returns a fresh access token; signOut revokes the series and clears the cookie. Only renewAccessToken and signOut authenticate by the cookie — every other operation authenticates by the access-token header.

This skill covers the password route only. An actor who signs in at an external OpenID Connect provider follows /hor-oidc-sign-in, which ends where this skill's session begins and reuses it unchanged. A request that carries its credential in a cookie, a Bearer header, an IAP JWT or an HMAC signature instead of x-renchan-access-token, and an application behind IAP that has no sign-in of its own, are in /hor-restfulapi-architecture.

You build this per actor, on top of the boilerplate's base classes — it is not shipped in the boilerplate; each app builds it for the actors its spec declares. Design the actor entity and its profile first with [[hor-database-design]] / [[hor-sequelize-model]]; this skill adds the credential, tokens, operations, and cookie to it. It says what the auth cluster contains and how the pieces fit — writing each piece follows its own convention ([[hor-sequelize-model]], [[hor-sequelize-seeder]], [[hor-mutation-resolver]], [[hor-type-interface]]), and the engine is [[hor-graphql-server-engine]].

This replaces the older access-token-only flow. In the old flow the access token was the durable credential — stored on the client and sent on every request, with no refresh cookie. Here the access token is short-lived and held only in memory on the client; durability comes from the refresh cookie. Do not mix the two: when this skill applies, there is no long-lived access token. The frontend half is [[hof-cookie-authentication]].

Snippets throughout use <Actor> for the role being authenticated — substitute your own (Member, Operator, Account, …). Not every app has a "customer"; the reference implementation these snippets are drawn from happens to use Customer and Admin.

Core

TopicDescriptionReference
Environment & configStep-by-step setup: the cookie dependency, the AUTH_* env vars + facade, the per-actor cookie-name constant, and the engine's refresh-token cookie configenvironment
Token & credential modelsPer actor: the password-hash model and the access / refresh token models, with sessionKey rotation columns and the backup mixintoken-models
MigrationsThe create-table migrations for the credential and token tablesmigrations
Session clerkSessionClerk — the injected orchestrator over the token tables (saveSession / rotateSession / revokeSession / findRefreshToken), returning throwable-save result objectssession-clerk
Refresh-token cookieThe HttpOnly cookie clerk and reading / setting the cookie in the GraphQL contextcookie-context
Auth resolverssignIn / signUp / signOut / renewAccessToken — token issue, rotation, and reuse detectionresolvers
Auth-filter policyschemasToSkipFiltering + generateFilterHandler — which operations are public (cookie) vs header-guardedauth-filter
Error codesThe Unauthenticated and RefreshTokenReused codes and where they are thrownerror-codes
Dev-login seederA development seeder so npm run dev can sign in against real datadev-login-seeder

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Hor Cookie Authentication?

Password sign-in with cookie-based sessions for a renchan backend, per actor: the credential and token models (password hash, access + rotating refresh tokens with reuse detection), the refresh-token HttpOnly cookie, the signIn / signUp / signOut / renewAccessToken resolvers, and the engine's public-operation policy. Use when adding password auth to an actor/role. Boundary: external identity provider sign-in and other credential routes have their own conventions.

Навіщо використовувати Hor Cookie Authentication у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Hor Cookie Authentication — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Hor Cookie Authentication у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-cookie-authentication. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Hor Cookie Authentication?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Hor Cookie Authentication?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Hor Cookie Authentication — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Hor Cookie Authentication?

Так. Навичку опубліковано на GitHub: openreachtech, за ліцензією Apache-2.0. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇