auth repository

runphp 2b3fece169 chore(deps): 更新 firebase/php-jwt 依赖版本 1 hónapja
database 361ff44d10 feat(auth): 添加认证模块 7 hónapja
src 4a61385681 feat(auth): 添加权限缓存机制以提升性能 5 hónapja
test 0ae7c82631 feat(sixshop-auth): 新增应用状态上报功能并更新配置地址新增 `AppStatusHook` 类用于在应用状态变更时向指定服务器发送 POST 请求,同时将配置中的默认市场服务器地址由 HTTP 更新为 HTTPS。 6 hónapja
.gitignore 361ff44d10 feat(auth): 添加认证模块 7 hónapja
LICENSE feed385be4 Initial commit 7 hónapja
README.md 361ff44d10 feat(auth): 添加认证模块 7 hónapja
command.php 361ff44d10 feat(auth): 添加认证模块 7 hónapja
composer.json 2b3fece169 chore(deps): 更新 firebase/php-jwt 依赖版本 1 hónapja
config.php 33ddafcc54 feat(auth): 引入配置类以管理SSL验证选项 6 hónapja
info.php 361ff44d10 feat(auth): 添加认证模块 7 hónapja

README.md

Auth 模块说明

Auth 模块是 SixShop 的权限管理模块,用于管理用户、角色、权限等。

接口

AuthInterface 生成token和验证token

interface AuthInterface
{
    /**
     * 用户ID生成token
     */
    public function generateToken(string $userId): string;

    /**
     * 验证token是否有效,并返回用户ID
     */
    public function verifyToken(string $jwt): string;

    /**
     * 刷新token,返回新的token
     */
    public function refreshToken(string $jwt): string;

    /**
     * 注销token
     */
    public function revokeToken(string $jwt): void;
    
    /**
     * 获取用户类型
     */
    public function getUserType(): UserTypeEnum;
}

HOOKS

  1. token_verify: token验证触发
  2. token_revoke: token注销触发