-
Notifications
You must be signed in to change notification settings - Fork 163
/
interfaces.go
40 lines (30 loc) · 976 Bytes
/
interfaces.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
package uaa
// You only need **one** of these per package!
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
//counterfeiter:generate . UAA
type UAA interface {
Prompts() ([]Prompt, error)
RefreshTokenGrant(string) (AccessToken, error)
ClientCredentialsGrant() (AccessToken, error)
OwnerPasswordCredentialsGrant([]PromptAnswer) (AccessToken, error)
}
//counterfeiter:generate . Token
// Token is a plain token with a value.
type Token interface {
Type() string
Value() string
IsValid() bool
}
//counterfeiter:generate . AccessToken
// AccessToken is purely an access token. It does not contain a refresh token and
// cannot be refreshed for another token.
type AccessToken interface {
Token
}
//counterfeiter:generate . RefreshableAccessToken
// RefreshableAccessToken is an access token with a refresh token that can be used
// to get another access token.
type RefreshableAccessToken interface {
AccessToken
RefreshValue() string
}