fix tests

This commit is contained in:
jay brown
2025-04-17 16:38:15 -07:00
parent f5c5e23d12
commit 882112a3f6
+9 -9
View File
@@ -13,11 +13,11 @@ import (
func TestInitializeAuthConfig(t *testing.T) {
// Setup test environment variables
testEnv := map[string]string{
"AWS_REGION": "us-west-2",
"COGNITO_USER_POOL_ID": "us-west-2_testpool",
"AWS_REGION": "us-east-2",
"COGNITO_USER_POOL_ID": "us-east-2_testpool",
"COGNITO_CLIENT_ID": "test-client-id",
"COGNITO_CLIENT_SECRET": "test-client-secret",
"COGNITO_DOMAIN": "test-domain.auth.us-west-2.amazoncognito.com",
"COGNITO_DOMAIN": "test-domain.auth.us-east-2.amazoncognito.com",
"COGNITO_LOGIN_PATH": "/custom-login",
"COGNITO_CALLBACK_PATH": "/custom-callback",
"COGNITO_HOME_PATH": "/custom-home",
@@ -60,19 +60,19 @@ func TestInitializeAuthConfig(t *testing.T) {
got string
expected string
}{
{"AuthRegion", cfg.AuthRegion, "us-west-2"},
{"AuthUserPoolID", cfg.AuthUserPoolID, "us-west-2_testpool"},
{"AuthRegion", cfg.AuthRegion, "us-east-2"},
{"AuthUserPoolID", cfg.AuthUserPoolID, "us-east-2_testpool"},
{"AuthClientID", cfg.AuthClientID, "test-client-id"},
{"AuthClientSecret", cfg.AuthClientSecret, "test-client-secret"},
{"AuthDomain", cfg.AuthDomain, "test-domain.auth.us-west-2.amazoncognito.com"},
{"AuthDomain", cfg.AuthDomain, "test-domain.auth.us-east-2.amazoncognito.com"},
{"AuthLoginPath", cfg.AuthLoginPath, "/custom-login"},
{"AuthCallbackPath", cfg.AuthCallbackPath, "/custom-callback"},
{"AuthHomePath", cfg.AuthHomePath, "/custom-home"},
{"AuthLogoutPath", cfg.AuthLogoutPath, "/custom-logout"},
{"AuthRedirectURI", cfg.AuthRedirectURI, "https://example.com/custom-callback"},
{"AuthTokenURL", cfg.AuthTokenURL, "https://test-domain.auth.us-west-2.amazoncognito.com/oauth2/token"},
{"AuthURL", cfg.AuthURL, "https://test-domain.auth.us-west-2.amazoncognito.com/oauth2/authorize"},
{"AuthJwksURL", cfg.AuthJwksURL, "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_testpool/.well-known/jwks.json"},
{"AuthTokenURL", cfg.AuthTokenURL, "test-domain.auth.us-east-2.amazoncognito.com/oauth2/token"},
{"AuthURL", cfg.AuthURL, "test-domain.auth.us-east-2.amazoncognito.com/oauth2/authorize"},
{"AuthJwksURL", cfg.AuthJwksURL, "https://cognito-idp.us-east-2.amazonaws.com/us-east-2_testpool/.well-known/jwks.json"},
}
for _, tt := range tests {