-
Notifications
You must be signed in to change notification settings - Fork 27
/
store_grant.go
51 lines (41 loc) · 1.75 KB
/
store_grant.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package oauth
import (
"time"
"github.com/authgear/authgear-server/pkg/lib/session/access"
)
type CodeGrantStore interface {
GetCodeGrant(codeHash string) (*CodeGrant, error)
CreateCodeGrant(*CodeGrant) error
DeleteCodeGrant(*CodeGrant) error
}
type SettingsActionGrantStore interface {
GetSettingsActionGrant(codeHash string) (*SettingsActionGrant, error)
CreateSettingsActionGrant(*SettingsActionGrant) error
DeleteSettingsActionGrant(*SettingsActionGrant) error
}
type OfflineGrantStore interface {
GetOfflineGrant(id string) (*OfflineGrant, error)
CreateOfflineGrant(offlineGrant *OfflineGrant, expireAt time.Time) error
DeleteOfflineGrant(*OfflineGrant) error
AccessWithID(id string, accessEvent access.Event, expireAt time.Time) (*OfflineGrant, error)
UpdateOfflineGrantDeviceInfo(id string, deviceInfo map[string]interface{}, expireAt time.Time) (*OfflineGrant, error)
UpdateOfflineGrantAuthenticatedAt(id string, authenticatedAt time.Time, expireAt time.Time) (*OfflineGrant, error)
UpdateOfflineGrantApp2AppDeviceKey(id string, newKey string, expireAt time.Time) (*OfflineGrant, error)
ListOfflineGrants(userID string) ([]*OfflineGrant, error)
ListClientOfflineGrants(clientID string, userID string) ([]*OfflineGrant, error)
}
type AccessGrantStore interface {
GetAccessGrant(tokenHash string) (*AccessGrant, error)
CreateAccessGrant(*AccessGrant) error
DeleteAccessGrant(*AccessGrant) error
}
type AppSessionStore interface {
GetAppSession(tokenHash string) (*AppSession, error)
CreateAppSession(*AppSession) error
DeleteAppSession(*AppSession) error
}
type AppSessionTokenStore interface {
GetAppSessionToken(tokenHash string) (*AppSessionToken, error)
CreateAppSessionToken(*AppSessionToken) error
DeleteAppSessionToken(*AppSessionToken) error
}