-
Notifications
You must be signed in to change notification settings - Fork 0
/
structure.go
42 lines (37 loc) · 1.18 KB
/
structure.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
41
42
package main
import (
"encoding/xml"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/golang-jwt/jwt/v5"
"golang.org/x/oauth2"
)
type JWTClaims struct {
Username string `json:"nickname"`
PFP string `json:"picture"`
Email string
jwt.RegisteredClaims
}
type OIDCConfig struct {
XMLName xml.Name `xml:"oidc"`
ClientID string `xml:"clientID"`
ClientSecret string `xml:"clientSecret"`
RedirectURL string `xml:"redirectURL"`
Scopes []string `xml:"scopes"`
Provider string `xml:"provider"`
}
type Config struct {
Username string `xml:"username"`
Password string `xml:"password"`
WiiMailUsername string `xml:"wiiMailUsername"`
WiiMailPassword string `xml:"wiiMailPassword"`
DatabaseAddress string `xml:"databaseAddress"`
DatabaseName string `xml:"databaseName"`
WiiMailDatabaseAddress string `xml:"wiiMailDatabaseAddress"`
WiiMailDatabaseName string `xml:"wiiMailDatabaseName"`
Address string `xml:"address"`
OIDCConfig OIDCConfig `xml:"oidc"`
}
type AppAuthConfig struct {
OAuth2Config *oauth2.Config
Provider *oidc.Provider
}