Interface AppSecretProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
应用密钥获取函数式接口
用于根据 appId 获取对应的签名密钥,使用者可自行实现该接口
示例实现:
// 从数据库查询
AppSecretProvider dbProvider = appId -> {
return appSecretRepository.findByAppId(appId).getSecret();
};
// 从配置中心获取
AppSecretProvider configProvider = appId -> {
return configService.getSecret(appId);
};
// 简单Map实现
AppSecretProvider mapProvider = appId -> appSecrets.getOrDefault(appId, defaultSecret);
- Author:
- Kerbores(kerbores@riemann.tech)
-
Method Summary
-
Method Details
-
getSecret
-