forked from ory/fosite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage.go
36 lines (25 loc) · 1.18 KB
/
storage.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
package oauth2
import (
"github.com/ory-am/fosite"
"golang.org/x/net/context"
)
type CoreStorage interface {
AuthorizeCodeStorage
AccessTokenStorage
RefreshTokenStorage
}
type AuthorizeCodeStorage interface {
CreateAuthorizeCodeSession(ctx context.Context, code string, request fosite.Requester) (err error)
GetAuthorizeCodeSession(ctx context.Context, code string, session fosite.Session) (request fosite.Requester, err error)
DeleteAuthorizeCodeSession(ctx context.Context, code string) (err error)
}
type AccessTokenStorage interface {
CreateAccessTokenSession(ctx context.Context, signature string, request fosite.Requester) (err error)
GetAccessTokenSession(ctx context.Context, signature string, session fosite.Session) (request fosite.Requester, err error)
DeleteAccessTokenSession(ctx context.Context, signature string) (err error)
}
type RefreshTokenStorage interface {
CreateRefreshTokenSession(ctx context.Context, signature string, request fosite.Requester) (err error)
GetRefreshTokenSession(ctx context.Context, signature string, session fosite.Session) (request fosite.Requester, err error)
DeleteRefreshTokenSession(ctx context.Context, signature string) (err error)
}