Class ThirdPartyAppService

java.lang.Object
io.github.xezzon.zeroweb.third_party_app.internal.ThirdPartyAppService
All Implemented Interfaces:
IThirdPartyAppService4Call

@Service public class ThirdPartyAppService extends Object implements IThirdPartyAppService4Call

第三方应用服务

提供第三方应用的业务逻辑处理,包括应用管理、密钥管理、JWT签名等功能

Author:
xezzon
  • Constructor Details

    • ThirdPartyAppService

      public ThirdPartyAppService(ThirdPartyAppDAO thirdPartyAppDAO, AccessSecretRepository accessSecretRepository, ThirdPartyAppMemberRepository thirdPartyAppMemberRepository, io.github.xezzon.zeroweb.common.config.ZerowebConfig zerowebConfig)
      依赖注入
      Parameters:
      thirdPartyAppDAO - 第三方应用的数据库操作
      accessSecretRepository - 访问凭据的 JPA 接口
      thirdPartyAppMemberRepository - 第三方应用成员的 JPA 接口
      zerowebConfig - JWT 相关设置
  • Method Details

    • signJwt

      public String signJwt(String accessKey, byte[] body, String signature, Instant iat)

      校验摘要并签发JWT

      首先验证消息摘要的有效性,然后为第三方应用签发包含认证信息的JWT

      Specified by:
      signJwt in interface IThirdPartyAppService4Call
      Parameters:
      accessKey - 访问密钥
      body - 消息内容
      signature - 消息摘要
      iat - 消息签发时间
      Returns:
      签发的JWT字符串
      Throws:
      InvalidAccessKeyException - 签名验证未通过时抛出