添加google接口注释
This commit is contained in:
parent
a9051fdac2
commit
2883804d4d
@ -28,9 +28,30 @@ pub struct GoogleSocial {
|
|||||||
google_public_keys: Arc<Mutex<GooglePublicKeys>>,
|
google_public_keys: Arc<Mutex<GooglePublicKeys>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 假设GOOGLE_PUBLIC_CERT_URL是Google提供的公钥URL
|
/// 说明:
|
||||||
|
/// 1. 获取 Google 的公钥证书,用于验证 JWT token 的签名
|
||||||
|
/// 2. 证书会定期轮换,需要定期获取最新的证书
|
||||||
|
/// 用途:
|
||||||
|
/// - JWT token 签名验证
|
||||||
|
/// - OAuth2 安全验证
|
||||||
|
/// - 确保 token 的真实性和完整性
|
||||||
|
/// 示例响应:
|
||||||
|
/// ```
|
||||||
|
/// {
|
||||||
|
/// "keys": [
|
||||||
|
/// {
|
||||||
|
/// "kty": "RSA", // 密钥类型
|
||||||
|
/// "alg": "RS256", // 算法
|
||||||
|
/// "use": "sig", // 用途(签名)
|
||||||
|
/// "kid": "certificate_id", // 密钥ID
|
||||||
|
/// "n": "public_key_modulus", // 公钥模数
|
||||||
|
/// "e": "AQAB" // 公钥指数
|
||||||
|
/// },
|
||||||
|
/// // 可能有多个证书
|
||||||
|
/// ]
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
const GOOGLE_PUBLIC_CERT_URL: &str = "https://www.googleapis.com/oauth2/v3/certs";
|
const GOOGLE_PUBLIC_CERT_URL: &str = "https://www.googleapis.com/oauth2/v3/certs";
|
||||||
|
|
||||||
/// 用途:授权端点
|
/// 用途:授权端点
|
||||||
/// - 用户登录和授权的入口
|
/// - 用户登录和授权的入口
|
||||||
/// - 获取用户同意访问特定范围的权限
|
/// - 获取用户同意访问特定范围的权限
|
||||||
|
Loading…
Reference in New Issue
Block a user