Releases: LegionIO/legion-crypt
Releases · LegionIO/legion-crypt
v1.5.13
Removed
- Logging compat shims (
lib/legion/logging.rbandlib/legion/logging/helper.rb) that redefinedLegion::Logging::Helper#logwith aCompatLogger, preventing TaggedLogger segment tags from rendering in log output for all modules loaded after crypt
Added
legion-jsongemspec dependency (was used but undeclared)
v1.5.12
Fixed
LeaseManager#trigger_reconnectfor:postgresqlnow callsLegion::Data::Connection.reconnect_with_fresh_creds(legion-data >= 1.6.26) instead ofsequel.disconnect+sequel.test_connection— Sequel bakes credentials into the pool atSequel.connecttime, so the old approach reused stale credentials after Vault lease rotation, causing Apollo and other DB-backed services to silently lose access to data- Fallback to legacy
disconnect/test_connectionpath whenreconnect_with_fresh_credsis not available, with explicit warning about potential stale credentials - Reconnect failures now log at
:errorlevel (was:warn) since a failed reconnect means Apollo and DB-backed services are unavailable until the next rotation cycle - Lease shutdown, logging fallback, and SPIFFE socket cleanup paths now emit warnings/debug logs instead of silently swallowing unexpected failures.
v1.5.10
Fixed
handle_exceptionnow passes the caller'slevel:kwarg through toLegion::Logging.log_exceptioninstead of always defaulting to:error— optional missing-gemLoadErrors log at the intended level (e.g.:debug). Fixes LegionIO/LegionIO#155exception_log_messagenow suppresses backtrace for:debuglevel — previously only suppressed when the backtrace was empty
v1.5.9
Fixed
- Vault lease cascade revocation: all three service credentials (RabbitMQ, PostgreSQL, Redis) died at exactly 2 hours when the Vault Kerberos auth token expired — Vault cascade-revokes all child leases when the parent token dies, regardless of individual lease TTLs (closes #29)
TokenRenewernow detects non-renewable tokens (renewable=false) and skipsrenew_self(which always fails for non-renewable tokens), going straight toreauth_kerberosbefore the token expiresTokenRenewer#reauth_kerberosnow triggersLeaseManager.reissue_allafter obtaining a new token, re-issuing all active leases under the new token so they are not orphaned when the old token expiresLeaseManager#push_to_settingssymbol/string key mismatch:resolve_secrets!registers refs with string keys ("rabbitmq") vialease://URI parsing, butcache_leasestores leases with symbol keys (:rabbitmqfromLegion::JSON.load) — now tries both key typesLeaseManager#trigger_reconnectfor:postgresql— uses surgical Sequel pooldisconnect+test_connectioninstead ofData.shutdown + Data.setupwhich tore down unrelated connections (Apollo SQLite, Local cache)LeaseManager#trigger_reconnectfor:redis— usesCache.restart(the actual method) instead ofCache.reconnect(which does not exist)
Added
LeaseManager#reissue_all— re-issues all active leases under the current vault client token; called byTokenRenewerafter successful Kerberos re-authentication to prevent cascade revocation of orphaned leases
v1.5.8
Added
- Configurable SSL verification for Vault connections via
crypt.vault.tls.verifysetting (peer/none/mutual, defaults topeer) - Global Vault client (
vault.rb) now sets::Vault.ssl_verifyfromvault.tls.verifysetting - Per-cluster Vault clients (
vault_cluster.rb) now passssl_verify:to::Vault::Client.newfromconfig[:tls][:verify] - JWKS client (
jwks_client.rb) now setsNet::HTTP#verify_modefromcrypt.jwt.jwks_tls_verifysetting (peer/none, defaults topeer) jwks_tls_verify: 'peer'default added to JWT settingstls: { verify: 'peer' }default added to Vault settings
v1.5.7
Fixed
LeaseManager#cache_leasenow stores the:pathfrom static lease definitions, enablingreissue_leasefallback whensys.renewfails or leases hit max_ttl — previously static leases (configured viacrypt.vault.leases) would silently expire after their TTL with no recovery (fixes #28)LeaseManager#renew_leasenow logs a warning and falls back to reissue when the path is available, or warns explicitly when no path is available — previously renewal failures for pathless leases were silent
Added
LeaseManager#trigger_reconnect(name)— dispatches reconnect to the appropriate service after credential reissue::rabbitmq→Transport::Connection.force_reconnect,:postgresql→Data.reconnect,:redis→Cache.reconnect; all guarded withdefined?/respond_to?and rescue-safe- Comprehensive INFO/WARN logging across the entire lease lifecycle:
- INFO on lease fetch attempt, fetch success (with lease_id/ttl/renewable), renewal attempt, renewal success (with new_ttl), reissue attempt, reissue success (with new_lease_id/ttl), approaching expiry detection (with remaining/renewable/has_path), credentials changed during renewal, reconnect triggered, renewal loop start/exit
- WARN on non-renewable lease with no reissue path, renewal failure with no reissue path, reissue returning no data, reconnect failure, cannot reissue due to missing path
Changed
LeaseManager#reissue_leasenow callstrigger_reconnect(name)instead of inline:rabbitmq-onlyforce_reconnect, extending credential rotation reconnect support to PostgreSQL and Redis
v1.5.5
Added
RMQ_ROLE_MAPconstant mapping:agent/:infra→'legionio-infra'and:worker→'legionio-worker'for Vault RabbitMQ role selection (Phase 5 credential scoping)dynamic_rmq_creds?helper readsSettings[:crypt][:vault][:dynamic_rmq_creds]flagfetch_bootstrap_rmq_creds— fetches short-lived bootstrap RabbitMQ credentials fromrabbitmq/creds/legionio-bootstrapand writes them toSettings[:transport][:connection]; gated onvault_connected? && dynamic_rmq_creds?; stores@bootstrap_lease_idfor later revocation; rescue-safeswap_to_identity_creds(mode:)— fetches identity-scoped RabbitMQ credentials from the role matchingmode, registers them withLeaseManagerfor renewal, updates transport settings, callsTransport::Connection.force_reconnect, and revokes the bootstrap lease; raises if reconnect fails (before revoking bootstrap)revoke_bootstrap_lease— revokes@bootstrap_lease_idviaLeaseManager#vault_sys; non-fatal on failure; idempotentLeaseManager#register_dynamic_lease— registers a dynamically-fetched Vault lease into the cache and active lease tracking with mutex, storespathforreissue_lease, registers settings refs for rotation push-backLeaseManager#reissue_lease(name)— performs a full re-read (logical.read(path)) at credential rotation time, updates cache + active_leases in mutex, callspush_to_settings, triggersTransport::Connection.force_reconnectfor:rabbitmqleasesLeaseManager#vault_logicalandLeaseManager#vault_sys— public delegators to the privatelogical/sysmethods for use byCryptbootstrap/swap operationsdynamic_rmq_creds: falseanddynamic_pg_creds: falsedefaults added to vault settings
Changed
start_lease_managernow starts the renewal thread whendynamic_rmq_creds: trueeven if no static leases are configured, ensuring the renewal loop is running before identity-scoped leases are registered post-boot
v1.5.4
Added
JWT.issue_identity_token— convenience method wrappingJWT.issuewith identity claims fromIdentity::Process(Wire Format Phase 3); acceptsissuer:kwarg (defaults to'legion') passed through toJWT.issue; normalizes and rejects conflicting string-keyed extra claims before merging
v1.5.3
Added
JwksClient.prefetch!(url)— fire-and-forget JWKS key fetch in background threadJwksClient.start_background_refresh!(url, interval:)—Concurrent::TimerTaskfor hourly key refreshJwksClient.stop_background_refresh!— stops background refresh timer taskbootstrap_lease_ttl: 300in vault defaults (5-minute TTL for bootstrap credentials)
Changed
JwksClient.clear_cachenow also stops any running background refresh task
v1.5.2
Fixed
- LeaseManager
at_exithook now wraps shutdown in a 10s timeout to prevent process hang when Logger Monitor or network I/O is blocked during crash exit