T3MP3ST public launch build

This commit is contained in:
t3mp3st contributors committed 2026-07-03 10:57:20 -04:00
1 parent 972247b881
commit 184c7d4e59
1589 files changed
+57150 -506

No files matched your search

@@ -0,0 +1,33 @@
package model
import (
"golang.org/x/oauth2"
)
type Oauth2Config struct {
ClientID string `koanf:"client_id" json:"client_id,omitempty"`
ClientSecret string `koanf:"client_secret" json:"client_secret,omitempty"`
Endpoint Oauth2Endpoint `koanf:"endpoint" json:"endpoint,omitempty"`
Scopes []string `koanf:"scopes" json:"scopes,omitempty"`
UserInfoURL string `koanf:"user_info_url" json:"user_info_url,omitempty"`
UserIDPath string `koanf:"user_id_path" json:"user_id_path,omitempty"`
}
type Oauth2Endpoint struct {
AuthURL string `koanf:"auth_url" json:"auth_url,omitempty"`
TokenURL string `koanf:"token_url" json:"token_url,omitempty"`
}
func (c *Oauth2Config) Setup(redirectURL string) *oauth2.Config {
return &oauth2.Config{
ClientID: c.ClientID,
ClientSecret: c.ClientSecret,
Endpoint: oauth2.Endpoint{
AuthURL: c.Endpoint.AuthURL,
TokenURL: c.Endpoint.TokenURL,
},
RedirectURL: redirectURL,
Scopes: c.Scopes,
}
}