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

local-identity-database

Maintain local identity database transactions, file locking and atomic persistence, cross-instance credential revocation, authenticated self-service operations, TOTP replay/lockout state, and external-account attachments.

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

설치 방법 보기

포함된 파일(3)

  • SKILL.md6.9 KB
  • agents/openai.yaml304 B
  • references/external-accounts.md15.7 KB

SKILL.md(원문)

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

Local Identity Database

Read external account attachments when changing automatic external/LDAP provisioning, stable identity keys, connection transactions, portal confirmation, administration without local email aliases, attachment configuration, or embedding integration.

Ownership and transaction boundary

The exact :memory: constructor argument selects private memory storage before any filesystem lookup. A file, directory or symlink with that literal name in the working directory must neither seed identities/policy nor prevent startup. Memory mutations leave such entries untouched; an explicit filesystem path whose basename is :memory: still selects normal file storage. Keep constructor boundary tests and the attached-provider TLS isolation journey for this rule.

pkg/identity/database.go, database_atomic_write.go, database_file_lock*.go, identity_request.go, and refresh.go own persistence and security transactions. pkg/ids/local holds the authenticator lock across database replacement and adapts the optional ids.IdentityRequestStore interface. Password hashing belongs to local-password-authentication; portal login proof belongs to refresh-token-identity.

File-backed security decisions use a freshly decoded, normalized and indexed snapshot under the canonical sidecar lock. Hold that lock through password/API-key verification and through current-identity issuance callbacks. A locked read followed by unlocked verification/signing permits revocation to race success. Preserve lock order: local authenticator, live database, canonical file lock; callbacks must not reenter that database or another alias of the same file.

Generic commits compare the persisted Revision with the writer's snapshot. On a stale revision, adopt current state, invalidate the old backend epoch and return a conflict; never overwrite a newer password, role, disabled flag or credential version. Callers must re-evaluate against current state before retry. Do not automatically retry a mutation already authorized with stale evidence. Fresh self-service transactions may commit an isolated current snapshot once.

Normalize legacy policy/password defaults and rebuild all username/ID/email/ API-key indexes when loading transaction snapshots. Adopt the complete committed snapshot; copying only Revision or a TOTP counter can make stale credentials appear current. Preserve the live mutex, path and runtime ownership. Response objects returned to consumers must not alias newly adopted live records.

RequestWithIdentity permits only explicitly listed self-profile operations. Require canonical username/email, immutable user ID, credential version and backend epoch, enabled account and unlocked state inside the transaction. Execute on an isolated in-memory target; persist only a successful mutation, and publish detached live state. The unbound generic Request remains a trusted programmatic/admin API, not a browser authorization mechanism.

Password, MFA, role, account status, challenge policy and explicit revocation changes advance CredentialVersion. Deletion/recreation changes immutable ID; reload changes the backend epoch unless runtime-state restores it for the exact committed database digest. Propagate the state record to self-service and MFA transaction targets; update its digest under the file lock after the database write. A copied database must not alter the source record. When attaching runtime persistence, adopt the identity file read under its lock before associating that digest with the backend epoch. Construction may have loaded an older snapshot before another instance committed a mutation. Role removal must invalidate cached profile and renewable authority even if the access JWT retains its ordinary lifetime.

Successful LookupAPIKey captures server-only AuthenticationEvidence with method api_key and the exact APIKeyID; failed lookups clear old evidence. Direct issuance preserves that proof across IdentifyUser, which only captures an identification snapshot. WithRefreshIdentity checks that this exact key is still present, enabled and unexpired while holding the issuance transaction. Key deletion does not revoke unrelated password/MFA evidence. Never replace the verified key proof with a newer identification version, or repeat bcrypt outside the transaction as a substitute for protecting issuance. The api_key marker is internal proof, not a password/MFA AMR claim or renewable session.

Replay and persistence

TOTP acceptance persists a monotonic LastTOTPCounter before success. Replay and earlier counters fail, including across processes, restart and symlink aliases. Failure increments, resets and expired-lockout clearing are fresh read/mutate/write transactions; stale login evidence cannot affect a replacement or revoked identity. Never treat an ignored conflict as a counted failure. MFA callers must provide original server-held evidence, including failure paths.

Atomic persistence writes a temporary file, syncs it, replaces the destination and syncs its directory where supported. Preserve existing mode bits; new private files use 0600. Copy writes an isolated source snapshot without advancing the live source revision or merging destination TOTP state. Hardlink aliases and network filesystems without reliable advisory locks are outside this contract.

Acceptance and validation

Run identity/local tests plus real TLS identity_alias_e2e_test.go: two realms sharing a file, revoked passwords/API keys, pending TOTP/WebAuthn, refresh revocation, shared lockout, role removal, conflicting writes and backup continuity. Use deterministic synchronization for verification/issuance races. Compile-only Windows/illumos checks are not runtime filesystem-lock evidence.

api_key_evidence_test.go covers proof capture, failed-lookup clearing, exact key ID, disablement/expiry/deletion, and unrelated password-proof continuity. The portal's authentication_challenges_transaction_e2e_test.go checks those issuance boundaries through real TLS direct-login consumers; see authentication challenge policies for current policy, inventory, and direct issuance rules.

make test TEST_DIR='./pkg/identity ./pkg/ids/local ./pkg/authn' TEST='Database|Identity|TOTP|MFA|RoleChange|AuthenticationChallenge' COVERAGE_DIR=.coverage/local-identity

A committed change survives reopening and is visible through another alias. A stale writer adopts current state and returns a conflict without overwriting newer credentials. Two attempts consuming one TOTP step permit at most one success, and a failed commit cannot publish a successful mutation.

리뷰

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

댓글

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

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

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. 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월 20일 업데이트

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월 20일 업데이트

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월 20일 업데이트

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월 20일 업데이트

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월 20일 업데이트

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월 20일 업데이트

greenpau의 스킬 모두 보기

이 스킬의 문제 신고