feat: extend equipment and workout models with service tracking

This commit is contained in:
Blake Ridgway
2026-02-12 10:09:50 -06:00
parent eb9ac1b67a
commit 178ffb3425
37 changed files with 4005 additions and 40 deletions

46
internal/config/oauth.go Normal file
View File

@@ -0,0 +1,46 @@
package config
import (
"log"
"os"
)
type OAuthProviderConfig struct {
ClientID string
ClientSecret string
RedirectURI string
AuthURL string
TokenURL string
}
type OAuthConfig struct {
EncryptionKey string
AppURL string
Garmin OAuthProviderConfig
Wahoo OAuthProviderConfig
}
var OAuth *OAuthConfig
func InitOAuth() {
OAuth = &OAuthConfig{
EncryptionKey: os.Getenv("OAUTH_ENCRYPTION_KEY"),
AppURL: os.Getenv("APP_URL"),
Garmin: OAuthProviderConfig{
ClientID: os.Getenv("GARMIN_CLIENT_ID"),
ClientSecret: os.Getenv("GARMIN_CLIENT_SECRET"),
RedirectURI: os.Getenv("GARMIN_REDIRECT_URI"),
AuthURL: "https://apis.garmin.com/tools/oauth2/authorizeUser",
TokenURL: "https://diauth.garmin.com/di-oauth2-service/oauth/token",
},
Wahoo: OAuthProviderConfig{
ClientID: os.Getenv("WAHOO_CLIENT_ID"),
ClientSecret: os.Getenv("WAHOO_CLIENT_SECRET"),
RedirectURI: os.Getenv("WAHOO_REDIRECT_URI"),
AuthURL: "https://api.wahooligan.com/oauth/authorize",
TokenURL: "https://api.wahooligan.com/oauth/token",
},
}
log.Println("OAuth config initialized")
}