From 783972182e87dcd33572e7c13563c1e7ff52f682 Mon Sep 17 00:00:00 2001 From: Aspen Smith Date: Sun, 24 Mar 2024 14:40:09 -0400 Subject: chore(web/panettone): Make it easier to override oauth settings For local dev, it's nice to be able to set the oauth variables by hand before starting the server - in that case, we don't want to override them with the defaults. Change-Id: I530518b4d58df1edf55ce062cf7ff3290784a3ed Reviewed-on: https://cl.tvl.fyi/c/depot/+/11259 Autosubmit: aspen Reviewed-by: sterni Tested-by: BuildkiteCI --- web/panettone/src/authentication.lisp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'web/panettone') diff --git a/web/panettone/src/authentication.lisp b/web/panettone/src/authentication.lisp index 3ce07aa8d78d..496a0e0bd7b4 100644 --- a/web/panettone/src/authentication.lisp +++ b/web/panettone/src/authentication.lisp @@ -42,23 +42,31 @@ the user, however email addresses are temporarily not available." (or (uiop:getenv "OAUTH2_REDIRECT_URI") "https://b.tvl.fyi/auth")) +(comment + (setq *oauth2-redirect-uri* "http://localhost:6161/auth") + ) + (defun initialise-oauth2 () "Initialise all settings needed for OAuth2" (setq *oauth2-auth-endpoint* - (or (uiop:getenv "OAUTH2_AUTH_ENDPOINT") + (or *oauth2-auth-endpoint* + (uiop:getenv "OAUTH2_AUTH_ENDPOINT") "https://auth.tvl.fyi/auth/realms/TVL/protocol/openid-connect/auth")) (setq *oauth2-token-endpoint* - (or (uiop:getenv "OAUTH2_TOKEN_ENDPOINT") + (or *oauth2-token-endpoint* + (uiop:getenv "OAUTH2_TOKEN_ENDPOINT") "https://auth.tvl.fyi/auth/realms/TVL/protocol/openid-connect/token")) (setq *oauth2-client-id* - (or (uiop:getenv "OAUTH2_CLIENT_ID") + (or *oauth2-client-id* + (uiop:getenv "OAUTH2_CLIENT_ID") "panettone")) (setq *oauth2-client-secret* - (or (uiop:getenv "OAUTH2_CLIENT_SECRET") + (or *oauth2-client-secret* + (uiop:getenv "OAUTH2_CLIENT_SECRET") (error "OAUTH2_CLIENT_SECRET must be set!")))) (defun auth-url () -- cgit 1.4.1