QoS匿名访问权限验证扩展

扩展说明

QoS匿名访问权限验证扩展点。

扩展接口

org.apache.dubbo.qos.permission.PermissionChecker

扩展配置

Dubbo QoS dubbo.application.qos-anonymous-access-permission-level 匿名访问权限校验。

默认实现

org.apache.dubbo.qos.permission.DefaultAnonymousAccessPermissionChecker

扩展示例

Maven 项目结构:

  1. src
  2. |-main
  3. |-java
  4. |-com
  5. |-xxx
  6. |-XxxPermissionChecker.java (实现PermissionChecker接口)
  7. |-resources
  8. |-META-INF
  9. |-dubbo
  10. |-org.apache.dubbo.qos.permission.PermissionChecker` (纯文本文件,内容为:qosPermissionChecker=com.xxx.XxxPermissionChecker)

XxxPermissionChecker.java:

  1. package com.xxx.qos.permission;
  2. import org.apache.dubbo.qos.permission.PermissionChecker;
  3. public class XxxAnonymousAccessPermissionChecker implements PermissionChecker {
  4. @Override
  5. public boolean access(CommandContext commandContext, PermissionLevel defaultCmdRequiredPermissionLevel) {
  6. // ...
  7. }
  8. }

META-INF/dubbo/org.apache.dubbo.qos.permission.PermissionChecker:

  1. qosPermissionChecker=com.xxx.XxxPermissionChecker

最后修改 December 16, 2022: Fix check (#1736) (97972c1)