mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 07:06:36 +08:00
代码质量优化
This commit is contained in:
@@ -75,7 +75,7 @@ func (m *Manager) Generate(ctx context.Context, scope string) (*ChallengeRespons
|
||||
Count: m.getChallengeCount(ctx),
|
||||
Size: m.getChallengeSize(ctx),
|
||||
Difficulty: m.getChallengeDifficulty(ctx),
|
||||
ExpiresMs: m.getChallengeTTL(ctx),
|
||||
Expires: m.getChallengeTTL(ctx),
|
||||
}
|
||||
return GenerateChallenge(m.conf.Secret, c, scope)
|
||||
}
|
||||
@@ -190,14 +190,6 @@ func (m *Manager) VerifyToken(ctx context.Context, token string, expectedScope s
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// sGet safely calls store.Get, treating a nil store as a miss.
|
||||
func sGet(ctx context.Context, store Store, key string) (string, bool, error) {
|
||||
if store == nil {
|
||||
return "", false, nil
|
||||
}
|
||||
return store.Get(ctx, key)
|
||||
}
|
||||
|
||||
// sGetAndDelete safely calls store.GetAndDelete, treating a nil store as a miss.
|
||||
func sGetAndDelete(ctx context.Context, store Store, key string) (string, bool, error) {
|
||||
if store == nil {
|
||||
|
||||
Reference in New Issue
Block a user