# spring-cloud-pupil-framework **Repository Path**: wywteach/spring-cloud-pupil-framework ## Basic Information - **Project Name**: spring-cloud-pupil-framework - **Description**: 微服务架构,慢慢学习 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-12-31 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # spring-cloud-framework ## 介绍 >微服务架构,后续慢慢搭建, zk 是AP nacos 是CP ## 软件架构 ### 软件架构说明 >实现 Oauth2标准,协议,使用的是Spring Security框架 对内rpc 对外rest,dubbo ```java /**oauth2 默认端点URL * /oauth/authorize:授权端点 * /oauth/token:令牌端点 * /oauth/confirm_access:用户确认授权提交端点 * /oauth/error:授权服务错误信息端点 * /oauth/check_token:用于资源服务访问的令牌解析端点 * /oauth/token_key:提供公有密匙的端点,如果你使用 JWT 令牌的话 * # 初始化 oAuth2 相关表 */ ``` ### 访问获取授权码 ```json http://localhost:8080/oauth/authorize?client_id=client&response_type=code ``` ### 通过授权码向服务器申请令牌 通过 CURL 或是 Postman 请求 ``` curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'grant_type=authorization_code&code=1JuO6V' "http://client:secret@localhost:8080/oauth/token" ``` ### 认证授权 >角色不一定只是人而已 - 认证 - 验证账号密码 - 授权 - 你这个角色能操作那些数据 - 人 - 运营,编辑 - 系统 - 日志系统,监控系统 - 时间 定时清理 - 基于角色访问机制(权限控制模型) - RBAC 基于角色 - ACL 访问控制列表 - ABAC 基于属性 - PBAC 基于策略 > 来源于 论文,社区,论坛 RFC6749 - Who 权限拥有者的主题 需要认证服务器 - What 权限针对的对象或资源 需要资源服务器 - How 具体权限 怎么操作 ## 问题 ### swagger 问题 ##### swagger-2.9.x /csrf is 404 问题 1. 这个问题在 2.9.x 版本中有(``https://github.com/springfox/springfox/issues/2603``) ,暂时还没有找到好的解决方案,回退到 2.8.0 版本。 2. OAuth2.0 协议在 2.8.0 版本中无问题 ## 对内rpc 对外rest,apache-dubbo - ``spring-cloud-apache-dubbo-provider-api`` 专门提供暴露接口模块 - ``spring-cloud-apache-dubbo-provider-service`` 专门实现上面接口的模块 1. xxxx 2. xxxx 3. xxxx