Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Jwt Manager Php Lib Laravel Package

not-empty/jwt-manager-php-lib

A lightweight PHP library for managing JSON Web Tokens, offering helpers for encoding, decoding, signing, and verifying JWTs. It simplifies token handling for authentication and secure API communication, making JWT integration easier in PHP projects.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Assessment basis: Baseline assessment for not-empty/jwt-manager-php-lib at release 8.0.0 (published 2025-12-17). The only release artifact available is a one-line note — "Release 8.0.0 for php-8.4" — with no changelog, upgrade guide, or compatibility matrix. All conclusions below are conditional on a source review and a security spike before any commitment.
  • Architecture fit: The library is a narrow, framework-agnostic JWT primitive: encode/decode claims, configure signing algorithms and secrets, validate signature and expiration. That is not a Laravel authentication solution — it does not ship a service provider, guard driver, config file, migrations, or events. It fits as a low-level signing/verification dependency behind an internal abstraction, not as a replacement for Sanctum, Passport, or tymon/jwt-auth. The strongest legitimate use cases are: machine-to-machine/service tokens, issuing/validating tokens for external API consumers, verifying JWTs minted by a third-party IdP, and multi-tenant key separation where you need direct control over claims and kid handling.
  • Integration feasibility: Feasible, but the integration cost is almost entirely ours. Expect to write: a TokenService wrapper interface, a service provider binding, a config file with per-environment key material sourced from a secret manager, a Guard/middleware that maps verification failures to 401/403 (not 500), and a key-rotation routine. Two hard gates come first: (1) PHP 8.4 availability across local, CI, staging, and production, since 8.0.0 is explicitly targeted at 8.4; and (2) a license review — GPL-3.0 is copyleft, which is acceptable for internal-only SaaS but is a material obligation for anything distributed to customers or embedded in a shipped product. Legal sign-off is a prerequisite, not a formality.
  • Technical risk: High, driven by four independent factors rather than one. License risk (GPL-3.0) is the only one that can block the initiative outright. Maturity risk is significant: 14 stars, zero dependent packages, no visible downstream validation, and a sparse release note imply limited production hardening and a thin regression surface. Security-critical-path risk is inherent to JWT: I need evidence of an algorithm allowlist (rejecting alg: none and blocking HS/RS key-confusion), timing-safe signature comparison, enforced exp/nbf with configurable leeway, and explicit iss/aud validation — none of which the description confirms. Commodity risk is the strategic question: firebase/php-jwt is MIT, has orders of magnitude more adoption, and is the de facto standard, so this package must justify itself on multi-tenant key handling, ergonomics, or a specific constraint we cannot meet otherwise.
  • Key questions:
    • Is GPL-3.0 acceptable for the intended deployment model (internal SaaS vs. distributed/shipped software)? Has legal reviewed?
    • Does 8.0.0 require PHP 8.4, or merely add support? What is the supported PHP range, and is 8.2/8.3 dropped?
    • Which algorithms are supported and which are enabled by default? Is there an explicit allowlist, and is none rejected at parse time?
    • Is signature verification timing-safe? Is there protection against HS256/RS256 public-key confusion?
    • Are exp, nbf, iat, iss, aud, and jti validated, and is clock-skew leeway configurable?
    • Does it support kid-based key lookup, JWKS consumption, and overlapping-key rotation?
    • Is there any revocation/denylist mechanism, or is short TTL the only mitigation for logout and key compromise?
    • Which extensions are required (openssl, sodium), and are the constraints declared in composer.json?
    • What is the CI matrix, test coverage, and security disclosure policy? Who maintains it and what is the bus factor?
    • What concrete capability does this provide that firebase/php-jwt does not?

Integration Approach

  • Stack fit: Treat the library as an infrastructure dependency, not an application feature. Isolate it behind a first-party TokenIssuer/TokenVerifier interface so the vendor package is swappable and so tests can substitute a fake. Keep Laravel-native auth (Sanctum/Passport) for human sessions and use this package only for the machine-to-machine or external-consumer surface, which caps the blast radius if the package proves unstable or licensing forces a swap. Confirm the runtime target is PHP 8.4 and that required extensions are present in every environment, including the production container image.
  • Migration path: Do not rip-and-replace. Introduce the wrapper interface, implement it with this package, and run the new implementation in shadow mode alongside the existing signer/verifier — dual-issue tokens where possible and dual-verify on ingress, logging mismatches without failing requests. Promote to authoritative by audience (e.g., start with a single internal service, then external consumers). This converts an unproven dependency into a measured one and gives a clean rollback: flip a config flag back to the prior implementation.
  • Compatibility: Audit composer.json constraints for PHP, extension requirements, and transitive dependencies. Critically, check whether it conflicts with or duplicates an already-present firebase/php-jwt (a very common transitive dependency via other packages) — duplicate JWT libraries in one tree is a classic source of class-collision and audit confusion. "PSR-friendly" should be verified concretely: confirm PSR-3 logger injection and confirm there is no hard PSR-7/PSR-15 coupling you would have to satisfy. Verify the exact Laravel minor in use, not just the major.
  • Sequencing:
    1. Legal gate: GPL-3.0 review against the deployment model. No engineering work proceeds until resolved.
    2. Security spike (timeboxed): read the verification path in source, run it against the JWT RFC 7519 test vectors and known-negative cases (none algorithm, tampered payload, expired token, wrong aud, truncated signature).
    3. Decision check: compare against firebase/php-jwt on effort-to-integrate, license, and maintenance. Document the rationale either way.
    4. Adapter build: wrapper interface, service provider, config, secret-manager integration, exception-to-HTTP mapping, structured failure logging.
    5. Compatibility validation: Composer resolution in a clean environment, CI matrix on PHP 8.4 plus the supported Laravel versions, static analysis, extension checks.
    6. Staging with production-like keys: shadow-mode verification against real traffic; validate key rotation end-to-end with overlapping keys.
    7. Canary rollout: one audience or one service, monitored for 401-rate and latency deltas.
    8. Production cutover with version pinning, feature flag retained for rollback, and an owner assigned for ongoing patch review.
  • Acceptance criteria for go/no-go: legal approval recorded; all negative test vectors behave correctly; p99 verification latency measured and within budget; rotation rehearsed in staging; documented rollback exercised once.

Operational Impact

  • Maintenance: Pin an exact version and treat upgrades as reviewable events, not composer update byproducts — a security library on the auth path deserves the same change control as the auth code itself. Low adoption means fewer eyes on upstream defects, so we carry the burden of watching releases ourselves. Track GPL obligations (license notice retention, and — if any distribution occurs — source availability). Budget a named owner and a recurring review cadence; if upstream goes quiet, the wrapper interface makes a vendor fork or swap contained.
  • Support: There is no commercial support, no visible security disclosure process, and a release note that conveys nothing about changes. That is an unacceptable support posture for the only unauthenticated code path in the system. Mitigate with: an internal security review before adoption, an internal SLA for applying upstream fixes (e.g., critical within 5 business days), and a documented fallback to firebase/php-jwt that has been prototyped — not just theorized — behind the same interface.
  • Scaling: Verification is stateless and horizontally friendly; signature operations are cheap relative to typical request work, so this is unlikely to be a bottleneck. Three real scaling concerns: (1) if JWKS is remote-fetched, cache public keys aggressively with a sane TTL and a stale-while-error fallback, otherwise every request carries a network hop and an availability dependency; (2) any denylist/revocation store reintroduces shared state (Redis) into the auth path and must be sized and fail-open-or-closed deliberately — decide which and document it; (3) token size in headers, since claims are carried on every request.
  • Failure modes: The realistic incidents are: clock skew between issuers and verifiers causing a mass 401 event; key rotation performed without an overlap window, invalidating outstanding tokens; a misconfigured aud/iss after a config change, breaking all consumers at once; a cached JWKS outliving a rotation; the none-algorithm or HS/RS confusion class of vulnerability if the allowlist is wrong; weak HMAC secrets checked into config; exceptions from the library escaping as 500s instead of clean 401s; and, most insidiously, composer update silently pulling a changed dependency that alters verification behavior. Because there is no revocation primitive, a leaked signing key is a full-blast-radius incident — the runbook must cover rotate-then-invalidate, and short access-token TTLs must be a design constraint from day one.
  • Ramp-up: Moderate — roughly one to two sprints for a mid-level engineer, plus a security engineer's review time, plus legal. Documentation is the weak point: expect engineers to read the source to understand algorithm defaults and validation semantics, and budget for writing internal documentation and a runbook that the package does not provide. Required artifacts before production: a one-page architecture note explaining where this sits relative to Sanctum, a key-rotation runbook, an incident playbook for signing-key compromise, and a short "why this instead of firebase/php-jwt" decision record. The decision record is the highest-leverage document — it is what a future TPM will read when asking whether this dependency is still worth its risk.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log