model.go (1284B)
1 package oauth2 2 3 import ( 4 "time" 5 ) 6 7 type ( 8 // ClientInfo the client information model interface 9 ClientInfo interface { 10 GetID() string 11 GetSecret() string 12 GetDomain() string 13 GetUserID() string 14 } 15 16 // ClientPasswordVerifier the password handler interface 17 ClientPasswordVerifier interface { 18 VerifyPassword(string) bool 19 } 20 21 // TokenInfo the token information model interface 22 TokenInfo interface { 23 New() TokenInfo 24 25 GetClientID() string 26 SetClientID(string) 27 GetUserID() string 28 SetUserID(string) 29 GetRedirectURI() string 30 SetRedirectURI(string) 31 GetScope() string 32 SetScope(string) 33 34 GetCode() string 35 SetCode(string) 36 GetCodeCreateAt() time.Time 37 SetCodeCreateAt(time.Time) 38 GetCodeExpiresIn() time.Duration 39 SetCodeExpiresIn(time.Duration) 40 GetCodeChallenge() string 41 SetCodeChallenge(string) 42 GetCodeChallengeMethod() CodeChallengeMethod 43 SetCodeChallengeMethod(CodeChallengeMethod) 44 45 GetAccess() string 46 SetAccess(string) 47 GetAccessCreateAt() time.Time 48 SetAccessCreateAt(time.Time) 49 GetAccessExpiresIn() time.Duration 50 SetAccessExpiresIn(time.Duration) 51 52 GetRefresh() string 53 SetRefresh(string) 54 GetRefreshCreateAt() time.Time 55 SetRefreshCreateAt(time.Time) 56 GetRefreshExpiresIn() time.Duration 57 SetRefreshExpiresIn(time.Duration) 58 } 59 )