/
keys.go
35 lines (26 loc) · 1019 Bytes
/
keys.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package redis
import "fmt"
func codeGrantKey(appID, codeHash string) string {
return fmt.Sprintf("app:%s:code-grant:%s", appID, codeHash)
}
func settingsActionGrantKey(appID, codeHash string) string {
return fmt.Sprintf("app:%s:settings-action-grant:%s", appID, codeHash)
}
func accessGrantKey(appID, tokenHash string) string {
return fmt.Sprintf("app:%s:access-grant:%s", appID, tokenHash)
}
func offlineGrantKey(appID, id string) string {
return fmt.Sprintf("app:%s:offline-grant:%s", appID, id)
}
func offlineGrantMutexName(appID, id string) string {
return fmt.Sprintf("app:%s:offline-grant-mutex:%s", appID, id)
}
func offlineGrantListKey(appID, userID string) string {
return fmt.Sprintf("app:%s:offline-grant-list:%s", appID, userID)
}
func appSessionTokenKey(appID string, tokenHash string) string {
return fmt.Sprintf("app:%s:app-session-token:%s", appID, tokenHash)
}
func appSessionKey(appID string, tokenHash string) string {
return fmt.Sprintf("app:%s:app-session:%s", appID, tokenHash)
}