back interdiff of round #1 and #0

appview/oauth: add client name and uri to metadata responses #720

merged
opened by oppi.li targeting master from push-mklsmqlkzqwo
files
appview
ERROR
appview/oauth/handler.go

Failed to calculate interdiff for this file.

NEW
appview/config/config.go
···
CookieSecret string `env:"COOKIE_SECRET, default=00000000000000000000000000000000"`
DbPath string `env:"DB_PATH, default=appview.db"`
ListenAddr string `env:"LISTEN_ADDR, default=0.0.0.0:3000"`
-
AppviewHost string `env:"APPVIEW_HOST, default=https://tangled.sh"`
+
AppviewHost string `env:"APPVIEW_HOST, default=https://tangled.org"`
+
AppviewName string `env:"APPVIEW_Name, default=Tangled"`
Dev bool `env:"DEV, default=false"`
DisallowedNicknamesFile string `env:"DISALLOWED_NICKNAMES_FILE"`
NEW
appview/oauth/oauth.go
···
SessStore *sessions.CookieStore
Config *config.Config
JwksUri string
+
ClientName string
+
ClientUri string
Posthog posthog.Client
Db *db.DB
Enforcer *rbac.Enforcer
···
}
func New(config *config.Config, ph posthog.Client, db *db.DB, enforcer *rbac.Enforcer, res *idresolver.Resolver, logger *slog.Logger) (*OAuth, error) {
-
var oauthConfig oauth.ClientConfig
var clientUri string
-
if config.Core.Dev {
clientUri = "http://127.0.0.1:3000"
callbackUri := clientUri + "/oauth/callback"
···
clientApp := oauth.NewClientApp(&oauthConfig, authStore)
clientApp.Dir = res.Directory()
+
clientName := config.Core.AppviewName
+
return &OAuth{
ClientApp: clientApp,
Config: config,
SessStore: sessStore,
JwksUri: jwksUri,
+
ClientName: clientName,
+
ClientUri: clientUri,
Posthog: ph,
Db: db,
Enforcer: enforcer,