Files
cgm-remote-monitor/lib/constants.json
T
Ben West ce8abe5e05 require API_SECRET to be at least 12 characters
This changes causes the server to crash if the API_SECRET environment
variable has a value whose length is less than MIN_PASSPHRASE_LENGTH
characters.
The default MIN_PASSPHRASE_LENGTH is 12, so if the API_SECRET variable
is set but less than 12 characters long, the server will crash.

security/privacy review needed
==============================
The API_SECRET is used as a pass phrase in order to generate a unique
token.

The api routes always try to mount themselves.  Before mounting
sensitive routes that allow modifying the application, the secret
token is required to validate the request, or denied.

When the secret token is absent, the sensitive routes should return
404, and should not be mounted.

This change attempts to eliminate some dangerous middle ground between
having a secured api, having a weakly secured api, believing a secure
api is mounted and working when none is, and not having a secure api
mounted.

The only choices available should be:

* secure api mounted
* secure api not mounted

This change hopefully constrains the possibilities to those two
options.
2014-07-20 14:23:45 -07:00

9 lines
178 B
JSON

{
"MIN_PASSPHRASE_LENGTH": 12,
"HTTP_OK" : 200,
"HTTP_UNAUTHORIZED" : 401,
"HTTP_VALIDATION_ERROR" : 422,
"HTTP_INTERNAL_ERROR" : 500,
"ENTRIES_DEFAULT_COUNT" : 10
}