wilfredwake 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/orchestrator/server.js +4 -10
package/package.json
CHANGED
|
@@ -71,17 +71,11 @@ app.use((req, res, next) => {
|
|
|
71
71
|
* Checks Authorization header if tokens are required
|
|
72
72
|
*/
|
|
73
73
|
const validateToken = (req, res, next) => {
|
|
74
|
+
// Authentication disabled by default.
|
|
75
|
+
// This middleware intentionally acts as a no-op so the orchestrator
|
|
76
|
+
// accepts unauthenticated requests. To enable authentication again,
|
|
77
|
+
// implement validation when `process.env.REQUIRE_AUTH` is set.
|
|
74
78
|
const token = req.headers.authorization?.replace('Bearer ', '');
|
|
75
|
-
|
|
76
|
-
// For now, we accept all requests
|
|
77
|
-
// In production, validate against registered tokens
|
|
78
|
-
if (process.env.REQUIRE_AUTH && !token) {
|
|
79
|
-
return res.status(401).json({
|
|
80
|
-
success: false,
|
|
81
|
-
error: 'Missing or invalid authentication token',
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
79
|
req.userId = token || 'anonymous';
|
|
86
80
|
next();
|
|
87
81
|
};
|