August 12, 2022
Read more
August 4, 2022
Client依赖1234567891011121314151617181920<!-- spring boot web starter --><dependency> <groupId>org.springframework.boot</gro ...
Read more
August 3, 2022
OAuth2 设计暴露的端点
GET /oauth/authorize该端点采用 GET 请求,主要是让用户能够跳转到授权页面。
GET /oauth/confirm_access提供用户确认授权的视图
POST /oauth/ ...
Read more
July 30, 2022
Spring MVC ReturnValueHandler 原理本文章中提及的 ReturnValueHandler 实际为 HandlerMethodReturnValueHandler 类型。
该 ReturnValueHandler 会在调用 handler 方法的时候发挥作用,其中通 ...
Read more
July 28, 2022
12345678910111213141516171819202122function getIp(){ $ips = array(); if ($_SERVER['HTTP_CLIENT_IP']) { $ips[] = $_SERVER[ ...
Read more
July 27, 2022
校验 Referer 头部
签名校验
mobile 参数可以略微进行 AES 加密等,增加复杂度
IP + UA 限制次数例如,使用 Redis 记录次数
假设 key 特定前缀是 code_send_limit_
key = code_send_limit_ + <IP ...
Read more
July 27, 2022
Integration
Message ConversionWebMvcConfigurationSupport 内含默认的 Converter
BufferedImageHttpMessageConverter 返回图片
12345@RequestMapping(path = " ...
Read more
July 26, 2022
1.1. Roles 角色
OAuth 定义了四个角色:
resource owner 资源拥有者:
一个实体,其能够授予受保护的资源的访问权限。当 resource owner 是一个人,他被称之为一个终端用户。
resource server 资源服务器
一个服务,其托管受保护的 ...
Read more
July 25, 2022
更新所有已安装的 rpm 包yum -y update
yum clean all
Read more
July 24, 2022
Redis
Redis 面试预备为什么用 Redis
高并发
高可用
缓存缓存穿透: 缓存中查不到,数据库中也差不多
解决方案: 1. 对参数进行合法性校验 2. 将数据库中没有查到的也写入到缓存
为了防止缓存垃圾,这一类的缓存可以设置短一些
BloomFilter ,MySQL 的 id 引入该过 ...
Read more