-
Notifications
You must be signed in to change notification settings - Fork 3
/
oauth_client.go
40 lines (36 loc) · 1.44 KB
/
oauth_client.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 patreon
import (
"golang.org/x/oauth2"
)
// OauthClientFields is all fields in the OauthClient Attributes struct
var OauthClientFields = []string{
"AuthorName", "ClientSecret", "DefaultScopes",
"Description", "Domain", "IconURL", "Name",
"PrivacyPolicyURL", "RedirectURIs", "TosURL", "Version",
}
// OauthClient is a client created by a developer, used for getting OAuth2 access tokens.
type OauthClient struct {
Type string `json:"type"`
ID string `json:"id"`
Attributes OauthClientAttributes `json:"attributes"`
Relationships struct {
// Apps *AppsRelationship `json:"apps"`
Campaign *CampaignRelationship `json:"campaign,omitempty"`
CreatorToken *oauth2.Token `json:"creator_token,omitempty"`
User *UserRelationship `json:"user,omitempty"`
} `json:"relationships"`
}
// OauthClientAttributes is the attributes struct for OauthClient
type OauthClientAttributes struct {
AuthorName string `json:"author_name"`
ClientSecret string `json:"client_secret"`
DefaultScopes string `json:"default_scopes"`
Description string `json:"description"`
Domain string `json:"domain"`
IconURL string `json:"icon_url"`
Name string `json:"name"`
PrivacyPolicyURL string `json:"privacy_policy_url"`
RedirectURIs string `json:"redirect_uris"`
TosURL string `json:"tos_url"`
Version string `json:"version"`
}