north69 / lexik-jose-bridge
允许使用 web-token/jwt-framework 与 Lexik JWT 认证包的桥梁
Requires
- lexik/jwt-authentication-bundle: ^2.0
- psr/event-dispatcher: ^1.0
- thecodingmachine/safe: ^0.1.15|^1.0
- web-token/jwt-bundle: ^2.0.3
- web-token/jwt-checker: ^2.0.3
- web-token/jwt-encryption: ^2.0.3
- web-token/jwt-key-mgmt: ^2.0.3
- web-token/jwt-signature: ^2.0.3
- web-token/jwt-signature-algorithm-rsa: ^2.0.3
Requires (Dev)
- behat/behat: ^3.0
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.3
- behat/symfony2-extension: ^2.1
- caciobanu/behat-deprecation-extension: ^2.1
- phpstan/phpstan: ^0.12
- phpstan/phpstan-beberlei-assert: ^0.12
- phpstan/phpstan-deprecation-rules: ^0.12
- phpstan/phpstan-strict-rules: ^0.12
- sensio/framework-extra-bundle: ^4.0|^5.0
- symfony/dependency-injection: ^4.3|^5.0
- symfony/expression-language: ^4.3|^5.0
- symfony/finder: ^4.3|^5.0
- symfony/form: ^4.3|^5.0
- symfony/templating: ^4.3|^5.0
- symfony/twig-bundle: ^4.3|^5.0
- symfony/var-dumper: ^4.3|^5.0
- thecodingmachine/phpstan-safe-rule: ^1.0
- web-token/jwt-encryption-algorithm-aesgcm: ^2.0.3
- web-token/jwt-encryption-algorithm-aesgcmkw: ^2.0.3
- web-token/jwt-signature-algorithm-hmac: ^2.0.3
This package is auto-updated.
Last update: 2023-11-21 21:44:46 UTC
README
此 Symfony 扩展包为 LexikJWTAuthenticationBundle 提供了 JWT 编码器,该 Bundle 使用 web-token/jwt-framework 作为 JWT 创建器/加载器。
发布流程
发布流程 在此描述。
先决条件
此库至少需要
持续集成
已成功使用 PHP 7.2
和 PHP 7.3
进行测试。
我们还使用 Scrutinizer-CI 和 Sensio Insight 跟踪错误和代码质量。
编码标准通过 StyleCI 验证。
未执行代码覆盖率,但使用 行为驱动开发
(BDD) 测试此 Bundle。
安装
Symfony Flex
安装此 Bundle 的首选方法是依靠 Symfony Flex
composer req "spomky-labs/lexik-jose-bridge:^3.0"
手动安装
如果您不使用 Symfony Flex,则使用 Composer 手动安装该 Bundle。
composer require spomky-labs/lexik-jose-bridge
然后,将此 Bundle 和 web-token/jwt-framework
Bundle 添加到您的内核中
<?php use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\HttpKernel\Kernel; class AppKernel extends Kernel { public function registerBundles() { $bundles = [ ... new Jose\Bundle\JoseFramework\JoseFrameworkBundle(), new SpomkyLabs\LexikJoseBundle\SpomkyLabsLexikJoseBundle(), ]; return $bundles; } }
签名/加密算法
此 Bundle 只安装基于 RSA 的签名算法(RS256
、RS384
和 RS512
)。如果您需要其他签名算法(例如基于 EC 的,HMAC)或想使用加密功能,则必须安装相应的包
- 签名算法
- 全部:
composer require web-token/signature-pack
- HMAC:
composer require web-token/jwt-signature-algorithm-hmac
- ECDSA:
composer require web-token/jwt-signature-algorithm-ecdsa
- EdDSA:
composer require web-token/jwt-signature-algorithm-eddsa
- 无:
composer require web-token/jwt-signature-algorithm-none
(不推荐) - 实验性:
composer require web-token/jwt-signature-algorithm-experimental
(不推荐)
- 全部:
- 加密算法
- 全部:
composer require web-token/encryption-pack
- 密钥加密
- ECDH-ES:
composer require web-token/jwt-encryption-algorithm-ecdh-es
- AES 密钥包装:
composer require web-token/jwt-encryption-algorithm-aeskw
- RSA:
composer require web-token/jwt-encryption-algorithm-rsa
- AES GCM 密钥包装:
composer require web-token/jwt-encryption-algorithm-aesgcmkw
- 直接:
composer require web-token/jwt-encryption-algorithm-dir
(不推荐) - PBES 2:
composer require web-token/jwt-encryption-algorithm-pbes2
(不推荐)
- ECDH-ES:
- 内容加密
- AES GCM:
composer require web-token/jwt-encryption-algorithm-aesgcm
- AES CBC:
composer require web-token/jwt-encryption-algorithm-aescbc
- AES GCM:
- 实验性:
composer require web-token/jwt-encryption-algorithm-experimental
(不推荐)
- 全部:
配置
此 Bundle 需要配置。请查看此页了解如何配置。
如何使用
没有要做的。就像平常一样使用您的应用程序。
支持
我为您的问题提供解决方案并回答您的问题。
如果您真的喜欢那个项目和我完成的工作,或者您希望我优先处理您的问题,那么您可以帮帮我喝几杯🍻或者更多!
贡献
欢迎提出新功能、错误修复以及所有其他使此库有用的想法。请遵循这些最佳实践。
许可
本软件采用MIT许可发布。