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

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.

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

설치 방법 보기

포함된 파일(3)

  • SKILL.md10.3 KB
  • agents/openai.yaml283 B
  • references/configuration-and-operations.md1.7 KB

SKILL.md(원문)

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

AuthDB Server

cmd/authdb runs AuthCrunch with Go's net/http, without Caddy. The user-facing cmd/authdb/README.md owns usage instructions, the JSON envelope, bootstrap, listener settings, and operating guidance. Keep its examples synchronized with the executable and the credential-free cmd/authdb/config.json. Use configuration integration for the reusable Go host boundary.

Ownership

  • cmd/authdb/main.go owns command flags, strict bounded JSON file loading, version metadata, production logging, TCP binding, and SIGINT/SIGTERM handling.
  • pkg/httpserver.Config and PortalRoute own transport defaults and semantic validation. The CLI's http object is this public config; security is the existing root authcrunch.Config, not a new copy of its feature models.
  • pkg/httpserver/parser.NewHTTPServerConfigFromDirectives([]string) returns (*httpserver.Config, error). It parses encoded block-body statements and calls Config.Validate; no file access, listeners, or provisioning occur.
  • pkg/httpserver.Serve(ctx, listener, config, security, logger) takes ownership of the listener immediately, including on error, and owns its constructed root runtime until all admitted requests have finished. Pass a fresh security graph and do not mutate it while serving.

The host checks serialized object collections before provisioning: optional objects can be absent, but typed collections cannot contain null objects. Use explicit typed traversal and generic pointer-collection checks, without runtime reflection. TestSecurityConfigurationObjectCoverage discovers the declared JSON model in test code and checks concrete/null objects at every collection path. Extend the typed traversal whenever that model adds a new object collection, including policy access_list_fields. Keep provider params values owned by their validators. Errors identify field paths and indices, never map keys or configured values. Guard incomplete raw crypto statements before calling the legacy KMS decoder. Initialization errors expose a redacted message; their wrapped causes are available to embedding code for private diagnostics and may contain credentials. Do not print those causes from the executable.

Keep portal authentication, APIs, provider callbacks, cookies, MFA, refresh, and OIDC behavior in their existing packages. The HTTP host supplies routing and lifecycle, rather than copying endpoint logic. It does not provide an application reverse proxy or a forward-auth endpoint; merely declaring root authorization_policies does not publish a new HTTP resource.

Configuration Parser

Host adapters encode each complete statement with cfgutil.EncodeArgs after checking for empty tokens. The public parser uses cfgutil.DecodeArgs.

StatementMeaning/default
listen <host:port>TCP address; omitted means 127.0.0.1:8443; numeric port 0 selects an ephemeral port
tls certificate <path>PEM certificate chain; required for HTTPS
tls key <path>PEM private key; required for HTTPS
insecure http enabled / insecure http disabledExplicit plaintext opt-in; disabled by default; cannot combine enabled with TLS files
timeout read header <duration>Header deadline; 10s
timeout read <duration>Entire request read deadline; 30s
timeout write <duration>Response write deadline; 60s
timeout idle <duration>Keep-alive idle deadline; 120s
timeout shutdown <duration>Graceful drain window; 30s
max header bytes <number>Header limit; zero/omitted means 1048576, otherwise 1024–16777216
portal <name> <path>Repeatable named portal mounts; at least one required

Durations must be positive and at most 24 hours. Singleton directives cannot repeat, including enabled/disabled spellings. Portal names are unique and paths cannot overlap. Reject CR/LF, malformed quoting, wrong arity, empty values, and unknown settings without echoing untrusted statement contents. Errors return a nil result. Typed validation owns defaults and constraints; do not reproduce them in CLI parsing. New settings need typed, parser, and consumer coverage.

Routing and Lifecycle

Keep paths intact when delegating to authn.Portal.ServeHTTP. Mount roots redirect temporarily to their own /login, preserving the query; nonmatching paths return 404. Routes use segment boundaries, canonical paths, and reserved portal namespace/prefix checks. Do not let http.ServeMux clean a malformed path into a different namespace, and do not strip a mount before delegation. Refresh base paths and OIDC issuer paths must match their portal mounts.

Follow the shared reserved route and mount contract when changing mount validation. The independent catalogue distinguishes forbidden whole segments (saml, oauth2, provider, discovery and other namespaces) from legacy prefix reservations (login-service, profile-ui). Check every segment of nested mounts, preserve /auth and /xauth, and reject reservations before provisioning even when a feature is disabled. Catalogue-driven typed, parser and listener-startup tests must accompany new route reservations.

The direct listener discards Forwarded, all X-Forwarded-*, and X-Real-IP headers before invoking AuthCrunch. TLS terminates locally; there is no trusted proxy configuration. Preserve a cloned request so an embedding caller's headers are not mutated. The portal retains responsibility for its own origin checks.

Load TLS keys before constructing the runtime, use TLS 1.2 or newer, and leave HTTP/2 negotiation to net/http. Snapshot transport decisions before starting Serve/ServeTLS: the standard library may initialize Server.TLSConfig while starting even an HTTP listener. Reading it concurrently caused a race caught by the executable test.

On shutdown, stop admitting requests, call http.Server.Shutdown with a fresh bounded context, and keep accepted request contexts alive during the drain. At the deadline, cancel them and close connections. Await handler completion before authcrunch.Server.Close; a shutdown timeout remains an error. The deadline bounds graceful HTTP draining, not arbitrary blocking code in a custom provider. Unexpected accept failures also drain and dispose resources and return an error. Normal signal-driven shutdown returns success. The executable synchronously restores default signal handling before publishing the first signal's cancellation, so a second SIGINT/SIGTERM can interrupt a blocked drain or provider initialization instead of racing asynchronous cleanup.

Track whether a portal committed its response: an unwritten handler error gets 500; a committed response must not receive another status/body. Never put raw handler errors, requests, configuration objects, or credentials in host logs. Log readiness using the actual listener address, including an ephemeral port.

Command-Line Contract

Use urfave/cli/v2, as in authdbctl. authdb run --config PATH starts the server; no command shows help. Preserve help, help run, version, and the --help/-h, --version/-v, --config/-c, and --debug flags. Help and version write to the app's stdout writer without loading configuration. main owns process exit; built-in help errors must return through run.

Create fresh apps and flags for each invocation. Config/debug flag actions apply root values first and explicit run values second, so options work on both sides of the command. Only the root config flag reads AUTHDB_CONFIG_PATH; otherwise a child flag's environment/default could overwrite an explicit global option. Command flags take precedence over global flags, then environment, then the existing working-directory authdb.json default. Honor --debug=false. The version banner retains the repository's versioned build metadata.

Debug switches the structured JSON logger from info to debug, retaining real portal logging and stderr output. Keep credential-redaction assertions active in the executable TLS login journey with debug enabled. E2E subprocesses remove ambient AUTHDB_* variables and add only their own configuration environment.

Persistent Runtime State

security.state passes directly to authcrunch.Config.State. Use runtime-state to change persistent storage configuration, parsing, and lifecycle. persistent_state_e2e_test.go runs inside TestE2EAuthdb, kills the built process after real login, and verifies JWKS, old JWT and browser session continuity. Keep the omitted-state behavior documented separately.

Validation

cmd/authdb/e2e_test.go builds the real executable with the race detector and uses private temporary JSON files, TLS certificates, and identity databases. It covers root/nested mounts, HTTP/2 login and browser assets, native login, authenticated/anonymous APIs, listener conflicts, bad configuration and redacted startup failures, multiple portals, HTTP opt-in, persistence across restart, clean process shutdown, and interruption by a second signal during a drain. Keep failures bounded and reap subprocesses. Configure HTTP/2 on TLS fixture clients before using or closing their fixture: transport protocol setup is lazy and runs only once.

pkg/httpserver/server_e2e_test.go imports the public transport, refresh, and OIDC parsers, serializes their results, and starts httpserver.Serve. It checks OIDC discovery/keys, native refresh rotation/logout, and the actual TLS header read deadline. server_test.go checks graceful drain, forced cancellation, listener failure, routing, and initialization cleanup. Parser grammar tests and its executable example stay in external package parser_test.

make test TEST_DIR='./cmd/authdb ./pkg/httpserver/...' COVERAGE_DIR=.coverage/authdb
make ci-check

make build builds both executables. Keep VERSION projections and isolated release fixtures synchronized when changing server metadata; adding this binary does not authorize a version bump or release. Packaging ownership remains with release-and-versioning.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

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

Maintain the opt-in encrypted Documents API, immutable account ownership, SQLite ciphertext storage, chunk transactions, recipient key envelopes, configuration parser, and TLS/browser cryptographic tests. The separately maintained React application has its own integration skill.

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

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

greenpau의 스킬 모두 보기

이 스킬의 문제 신고