上一遍文章介绍了servicecomb中简单的一种接口认证方法,他是基于RSA证书来实现认证,如果需要个性化的认证,还需要尝试其他方案。
ServiceComb-fence
根据官网介绍,就是来处理接口的认证和鉴权
关于认证和鉴权时序图


关于项目结构如下:
.
├── api
│ ├── authentication-server
│ │ ├── endpoint
│ │ │ ├── pom.xml
│ │ │ └── src
│ │ ├── pom.xml
│ │ └── service
│ │ ├── pom.xml
│ │ └── src
│ ├── common
│ │ ├── endpoint
│ │ │ ├── pom.xml
│ │ │ └── src
│ │ ├── pom.xml
│ │ └── service
│ │ ├── pom.xml
│ │ └── src
│ ├── edge-service
│ │ ├── endpoint
│ │ │ ├── pom.xml
│ │ │ └── src
│ │ ├── pom.xml
│ │ └── service
│ │ ├── pom.xml
│ │ └── src
│ ├── pom.xml
│ └── resource-server
│ ├── endpoint
│ │ ├── pom.xml
│ │ └── src
│ ├── pom.xml
│ └── service
│ └── pom.xml
├── authentication-server
│ ├── pom.xml
│ └── src
│ └── main
│ ├── java
启动的
- Client 需要用户自己实现请求接口
- Edge-service在yaml文件中指定auth调用链
- api/Edge-service/config/cse.handler.xml中指定auth对应的handler
<config> <handler id="auth" class="org.apache.servicecomb.authentication.edge.AuthHandler" /> <handler id="internalAccess" class="org.apache.servicecomb.authentication.edge.InternalAccessHandler" /> </config>
网友评论