- api/config/environment.cfm: Central config for dev vs prod settings - Verbose errors, debug logging, magic OTP bypass - Rate limiting toggle, email catch-all, token expiry settings - api/dev/: Development-only endpoints - seedData.cfm: Create/reset test users - timeTravel.cfm: Manipulate timestamps for testing - index.cfm: Dev tools index Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
45 lines
1.3 KiB
Text
45 lines
1.3 KiB
Text
<cfsetting showdebugoutput="false">
|
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
|
|
|
<cfscript>
|
|
/**
|
|
* Dev Tools Index - DEV ONLY
|
|
* Lists available development endpoints
|
|
*/
|
|
|
|
// SAFETY: Only allow on dev environment
|
|
if (!structKeyExists(application, "isDevEnvironment") || !application.isDevEnvironment) {
|
|
writeOutput(serializeJSON({
|
|
"OK": false,
|
|
"ERROR": "forbidden",
|
|
"MESSAGE": "Dev tools are disabled on this server"
|
|
}));
|
|
abort;
|
|
}
|
|
|
|
writeOutput(serializeJSON({
|
|
"OK": true,
|
|
"environment": "development",
|
|
"endpoints": {
|
|
"seedData": {
|
|
"url": "/api/dev/seedData.cfm",
|
|
"methods": ["GET", "POST"],
|
|
"description": "Create and manage test users",
|
|
"actions": ["seed", "reset"]
|
|
},
|
|
"timeTravel": {
|
|
"url": "/api/dev/timeTravel.cfm",
|
|
"methods": ["POST"],
|
|
"description": "Manipulate timestamps for testing",
|
|
"actions": ["expireTokens", "setUserCreated", "clearOTPs", "resetUser"]
|
|
}
|
|
},
|
|
"config": {
|
|
"magicOTP": application.MAGIC_OTP_CODE,
|
|
"magicPhones": application.MAGIC_PHONE_NUMBERS,
|
|
"debugLogging": application.debugLogging,
|
|
"showDetailedErrors": application.showDetailedErrors,
|
|
"tokenExpiryHours": application.tokenExpiryHours
|
|
}
|
|
}));
|
|
</cfscript>
|