1
+ # ========================================
2
+ # APPLICATION PORT
3
+ # ========================================
4
+ PORT = 3000
5
+
6
+ # ========================================
7
+ # POSTGRESQL DATABASES
8
+ # ========================================
9
+
10
+ # --- Connection Details ---
11
+ # Used by the application and migration script
12
+ DB_USERNAME = topcoderuser
13
+ DB_PASSWORD = randompassword
14
+ DB_HOST = 127.0.0.1
15
+ DB_PORT = 5432
16
+
17
+ # --- Database Names ---
18
+ # Used by the application, migration script, and docker init script
19
+ COMMON_OLTP_DB_NAME = common_oltp_db
20
+ AUTHORIZATION_DB_NAME = authorization_db
21
+
22
+ # --- Full Connection URLs (Primarily for Prisma Migrations/Studio) ---
23
+ # Note: These are NOT directly used by the migration script anymore,
24
+ # but are kept for standard Prisma tooling (e.g., migrate, studio).
25
+ # The migration script now constructs the URL from the components above.
26
+ COMMON_OLTP_DB_URL = " postgresql://${ DB_USERNAME } :${ DB_PASSWORD } @${ DB_HOST } :${ DB_PORT } /${ COMMON_OLTP_DB_NAME } ?sslmode=disable&schema=common_oltp"
27
+ AUTHORIZATION_DB_URL = " postgresql://${ DB_USERNAME } :${ DB_PASSWORD } @${ DB_HOST } :${ DB_PORT } /${ AUTHORIZATION_DB_NAME } ?sslmode=disable"
28
+
29
+ # ========================================
30
+ # MYSQL LEGACY AUTH DB (Source for Migration)
31
+ # ========================================
32
+ # Used by the migration script
33
+ MYSQL_HOST = 127.0.0.1
34
+ MYSQL_PORT = 3306 # Port exposed on the host by docker-compose
35
+ MYSQL_USER = mysql-user # User created in the MySQL container
36
+ MYSQL_PASSWORD = mysql-password # Password for MYSQL_USER
37
+ MYSQL_DATABASE = authorization_db # DB name inside the MySQL container
38
+ MYSQL_ROOT_PASSWORD = mysql-user-root-password # Root password for MySQL container (used for import)
39
+
40
+ # ========================================
41
+ # REDIS CACHE
42
+ # ========================================
43
+ REDIS_HOST = 127.0.0.1
44
+ REDIS_PORT = 6379
45
+ # REDIS_PASSWORD= # Uncomment and set if password protection is enabled
46
+ # REDIS_DB=0 # Optional: default Redis DB index
47
+
48
+ # ========================================
49
+ # JWT VALIDATION (Incoming User Requests)
50
+ # ========================================
51
+
52
+ # Validation Mode:
53
+ # HS256: Use for local development with tokens generated using AUTH_SECRET.
54
+ # RS256: Use for production/staging with tokens from an external IdP (e.g., Auth0) using JWKS.
55
+ JWT_VALIDATION_MODE = HS256
56
+
57
+ # --- HS256 Settings (if JWT_VALIDATION_MODE=HS256) ---
58
+ # Used by jwt.strategy.ts and local token generation script
59
+ # IMPORTANT: Replace with a strong, unique secret key in your actual .env file if using HS256
60
+ AUTH_SECRET = " your-local-dev-secret-key-placeholder"
61
+ # Optional: Set to match the issuer/audience in your HS256 tokens for stricter validation
62
+ JWT_ISSUER_URL = " https://api.topcoder-dev.com"
63
+ JWT_AUDIENCE = " www.example.com"
64
+
65
+ # --- RS256 Settings (if JWT_VALIDATION_MODE=RS256) ---
66
+ # Used by jwt.strategy.ts if mode is RS256
67
+ # Ensure this matches the 'iss' claim in the JWTs from your IdP (e.g., Auth0)
68
+ # JWT_ISSUER_URL="https://topcoder-dev.auth0.com/"
69
+ # Ensure this matches the 'aud' claim (audience) the JWTs are intended for (your API identifier in IdP)
70
+ # JWT_AUDIENCE="https://api.topcoder-dev.com/v5"
71
+ # JWKS URI from your IdP (often found at ${JWT_ISSUER_URL}.well-known/jwks.json)
72
+ # JWT_JWKS_URI="https://topcoder-dev.auth0.com/.well-known/jwks.json"
73
+
74
+ # ========================================
75
+ # M2M AUTHENTICATION (Service-to-Service)
76
+ # ========================================
77
+ # Used for authenticating outgoing requests (e.g., to Event Bus)
78
+
79
+ # --- Auth0 Client Credentials Example ---
80
+ # Replace with your actual Auth0 Machine-to-Machine application details
81
+ AUTH0_URL = "https://topcoder-dev.auth0.com/oauth/token" # Your Auth0 domain
82
+ AUTH0_AUDIENCE = "https://m2m.topcoder-dev.com/" # API Audience for M2M
83
+ AUTH0_CLIENT_ID = "jGIf2pd3f44B1jqvOai30BIKTZanYBfU" # Client ID of M2M App
84
+ AUTH0_CLIENT_SECRET = "change-me" # Client Secret of M2M App
85
+ # Optional: URL of proxy server if needed for token fetching
86
+ # AUTH0_PROXY_SERVER_URL=
87
+ # Optional: Token cache expiry time in minutes (used by M2M client)
88
+ TOKEN_CACHE_TIME = 1440 # Example: 24 hours
89
+
90
+ # ========================================
91
+ # EVENT BUS SERVICE
92
+ # ========================================
93
+ BUSAPI_URL = "https://api.topcoder-dev.com/v5" # Example URL - REPLACE IF NEEDED
94
+ KAFKA_ERROR_TOPIC = " common.error.reporting"
95
+ # ========================================
96
+ # MEMBER SERVICE
97
+ # ========================================
98
+ MEMBER_API_URL = https://api.topcoder-dev.com/v5/members
99
+ # ========================================
100
+ # ROLE CONFIGURATION
101
+ # ========================================
102
+ ADMIN_ROLE_NAME = "administrator" # The name of the admin role in the 'authorization_db' Role table
103
+
104
+ # ========================================
105
+ # EXTERNAL APIS / MISC
106
+ # ========================================
107
+ TOPCODER_API_BASE_URL = " https://api.topcoder-dev.com/v5"
108
+
109
+ # ========================================
110
+ # DICE/SLACK
111
+ # ========================================
112
+
113
+ DICEAUTH_DICE_API_URL = " https://console-api-uat.diceid.com/v1"
114
+ DICEAUTH_DICE_API_KEY = " api-key"
115
+ DICEAUTH_ORG_ID = " 4f541723-f581-44de-b61c-5f83e8b8ef1e"
116
+ DICEAUTH_USER_ID = " a5e7e72a-fa5e-4acf-9eca-741d1443279b"
117
+ DICEAUTH_TC_API_KEY = " api-key"
118
+ DICEAUTH_SCHEMA_NAME = " Topcoder"
119
+ DICEAUTH_SCHEMA_VERSION = " 1.4"
120
+ DICEAUTH_OTP_DURATION = " 10"
121
+ SLACK_BOT_KEY = " key"
122
+ SLACK_CHANNEL_ID = " C04ENKCU4TZ"
123
+
124
+ # ========================================
125
+ # AUTHENTICATION
126
+ # ========================================
127
+ JWT_SECRET = " my-secret"
128
+
129
+
130
+ # Legacy Blowfish Encryption Key (Base64 Encoded - !!! REPLACE WITH ACTUAL KEY FROM OLD SYSTEM !!!)
131
+ # Used for compatibility with the old password encoding scheme.
132
+ LEGACY_BLOWFISH_KEY = !!!_REPLACE_WITH_BASE64_ENCODED_KEY_!!!
133
+
134
+ # # SENDGRID
135
+ SENDGRID_RESEND_ACTIVATION_EMAIL_TEMPLATE_ID = " d-73c29be82bfa4d68beea2208b6a3c4b2"
136
+ SENDGRID_WELCOME_EMAIL_TEMPLATE_ID = " d-26c8962fb48c42a3997053ebe5954516"
137
+
138
+ SSO_TOKEN_SALT = change-me
0 commit comments