본문으로 건너뛰기
cccskills
무료GitHub에 공개

sqlite-identity-store

Maintain the pure-Go SQLite password identity store, reusable parser, immutable account evidence, idempotent enrollment, portal injection, and login E2E tests. Excludes local JSON database internals and MFA/profile feature implementation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md6.1 KB
  • agents/openai.yaml240 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

SQLite Identity Store

plugins/identity-stores/sqlite implements ids.IdentityStore and the optional WithRefreshIdentity transaction capability. It reports kind sqlite, never local. Inject an open store into authn.PortalParameters.IdentityStores and select its name in PortalConfig.IdentityStores. Root configuration factories remain local/LDAP-only; embedding hosts own selection and Close.

Configuration and provisioning

Import the public parser and call NewSQLiteIdentityStoreConfigFromDirectives([]string). The grammar requires name, realm, and absolute path; optional timeout defaults to 1s and accepts 1ms through 30s. Each setting takes one value and occurs once. Parsing has no filesystem side effects; New(ctx, config) snapshots settings and opens a configured store without creating a default user. GetConfig returns identifiers only. Read private SQLite backends for file/durability/error contracts. Database files are private plaintext with bcrypt hashes; production uses pure Go. Do not share files across categories.

Create(ctx, *Account, password) provisions trusted username/email/name/roles. Usernames and email are canonicalized to lowercase. Usernames use 3–64 ASCII letters/digits/underscore/dot/hyphen, starting with a letter or digit; nobody is reserved for unidentified login attempts. Email must be a bare address. Roles are 1–32 bounded identifiers. Passwords are exact UTF-8 plaintext, 12–72 bytes, nonblank, hashed with bcrypt default cost. No password import grammar is exposed on login, and no password is stored in Account or ordinary metadata.

Use sqlite-registration to change the email confirmation workflow that composes this store with the SQLite outbox.

HashPassword and CreateEnrollment(ctx, UUID, account, hash) support trusted registration composition. Enrollment accepts only validated default-cost bcrypt hashes. Identical enrollment input returns the existing account without mutation; conflicting input fails. Durable enrollment fingerprints survive account deletion, so retries cannot resurrect a deleted account. The lifetime enrollment bound is 10,000 per database, including tombstones; do not prune them casually. A new username after deletion receives a new account UUID and enrollment ID.

Trusted management supports generated-password AddUser/ResetUserPassword, SetPassword, exact username/email DeleteUser/DisableUser/EnableUser, full role replacement, metadata and detached account listing. Generated passwords appear only in the explicit creation/reset result; protect those responses. Unsupported additive roles, stored challenge rules, MFA, API keys, recovery and profile credential operations fail explicitly. Account creation never overwrites an existing username or email. No automatic self-service/admin route is installed.

Authentication and issuance

Request supports IdentifyUser, Authenticate and trusted AddUser. Request context comes from requests.Request.Upstream.Request when supplied; otherwise the operation timeout bounds SQLite work. Bcrypt itself is bounded CPU work and cannot be interrupted mid-comparison. Missing/disabled users follow the password checkpoint with a reserved placeholder and one fixed-cost dummy comparison. Never authenticate from a dummy match. Failed requests clear authentication and response evidence; wrong-realm requests fail.

Successful password verification produces server-only immutable user ID, credential version, per-instance epoch, time and pwd evidence. Each New creates a new epoch, invalidating outstanding proofs from an earlier runtime. Fresh lookups observe cross-instance mutations. Password, role and enabled-state changes advance the credential version; deletion/recreation cannot preserve it. Reload checks current health; it installs no cached account snapshot.

WithRefreshIdentity acquires an immediate SQLite transaction and keeps it through fresh identity checks, challenge evaluation and signing. A callback must not reenter the store or publish results before success. This serializes mutation with issuance; failure/uncertain commit must withhold the token. Already issued access JWTs retain their configured lifetime.

Direct HTTP Basic login applies transaction/policy checks to any selected identity store whose kind matches the request method, including SQLite. Do not restore a local/LDAP-only guard. Sandbox HTML/JSON issuance already selects the capability independently of the kind name. The password-only factor inventory is authoritative; portal rules requiring extra factors must deny issuance. Refresh-engine identity composition is available through the capability, but profile and downstream OIDC adapters retain their separate support restrictions.

Acceptance

Unit tests cover canonical accounts, detached metadata, rejected input, enrollment idempotency, deleted-account replay, instance epochs, credential/role/disable revocation, fresh reopening, and a real second connection blocked while issuance holds its transaction. The portable consumer fixture uses the public parser, serialized config, a real TLS portal, browser sandbox, native login client, direct Basic login, independent JWT verification, policy rejection, backend failure and restart. Its mutation-after-verification fixture proves direct issuance rechecks current identity. Run it both in this module and the isolated external-module driver.

make test TEST_DIR='./plugins/identity-stores/sqlite/... ./internal/tag'
make test TEST_DIR='./pkg/authn' TEST='TestE2EAuthenticationChallengeDirectTransaction|TestDirect|TestTokenIssuer'

Also run the public plugin units/consumer E2E with CGO_ENABLED=0, excluding the external-module driver which intentionally uses the race detector. For changes to shared portal issuance, run the existing authentication/challenge suites.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

authdb

무료

Maintain the standalone cmd/authdb server, pkg/httpserver listener and portal routing, HTTP configuration parser, TLS, shutdown, executable tests, and deployment guidance. Use authdbctl for the management client.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 11일 업데이트

authdbctl

무료

Maintain cmd/authdbctl commands, flags, configuration, terminal input, management retries, output, and executable E2E tests. Use authentication-client for the reusable portal login protocol.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 11일 업데이트

Maintain or embed pkg/authclient for portal login, password/TOTP and API-key authentication, native credential transport, configuration parsing, and credential files. Covers authdbctl login wiring; management commands and the admin API have separate owners.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 11일 업데이트

Maintain conditional authentication challenge policies, reusable authchal and user-transform FromDirectives parsers, safe claim substitution, GitHub ID/organization transforms, registered-factor inventory, passwordless WebAuthn selection, verified AMR access claims, and policy revalidation across portal login, refresh, OIDC, and direct authentication.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 11일 업데이트

Maintain portal cookie configuration, reusable cookie directive parsing, common prefixes and explicit names, domain attributes, factory issuance/deletion, and cookie interoperability with OIDC, refresh, OAuth, and gatekeepers.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 11일 업데이트

Maintain optional cross-device portal login, its directive parser, QR and polling UI, approving-browser binding, single-use transfers, MFA and provider evidence, logout invalidation, and TLS/browser tests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 11일 업데이트

greenpau의 스킬 모두 보기

이 스킬의 문제 신고