automattic/jetpack-jwt 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

automattic/jetpack-jwt

最新稳定版本:v0.2.2

Composer 安装命令:

composer require automattic/jetpack-jwt

包简介

A JSON Web Token (JWT) implementation for Jetpack.

README 文档

README

This

How to install

composer install automattic/jetpack-jwt

Installation From Git Repo

Contribute

Create a PR in [Jetpack Repo]https://github.com/Automattic/jetpack.

Get Help

Open in issue in the [Jetpack Repo]https://github.com/Automattic/jetpack.

Using this package in your WordPress plugin

If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

How to use the class?

$payload = array(
    'hello' => 'world'
);
$secret = 'abc';

$jwt_string = Automattic/Jetpack/JWT::encode( $payload, $secret );

try{
    $descripted = Automattic/Jetpack/JWT::decode( $jwt_string, $secret );
} catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}

echo $descripted->hello;
// prints "world"

Testing

When introducing new features or making changes to existing code, please add tests.

To run the tests, you can use the following command: Navigate to the JWT package directory and run.

composer test-php

PHP Phan

In the jetpack repo

composer test-php packages/jwt

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

jwt is licensed under GNU General Public License v2 (or later)

统计信息

  • 总下载量: 1.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2025-07-17