-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.go
More file actions
33 lines (27 loc) · 799 Bytes
/
models.go
File metadata and controls
33 lines (27 loc) · 799 Bytes
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
package main
import (
"github.com/dgrijalva/jwt-go"
)
type GitHubUser struct {
ID int `json:"id"`
Login string `json:"login"`
}
type GitHubApp struct {
ClientID string `yaml:"client_id"`
ClientSecret string `yaml:"client_secret"`
WebsiteURL string `yaml:"website_url"`
AuthorizationCallbackURL string `yaml:"authorization_callback_url"`
}
type GitHubConfig struct {
GitHubApplications map[string]GitHubApp `yaml:"github_applications"`
}
type TokenResponse struct {
AccessToken string `json:"access_token"`
Scope string `json:"scope"`
TokenType string `json:"token_type"`
}
type ValidationResponse struct {
Valid bool `json:"valid"`
User *jwt.Token `json:"user,omitempty"`
Error string `json:"error,omitempty"`
}