-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsecrets-sample.js
More file actions
42 lines (25 loc) · 1.24 KB
/
secrets-sample.js
File metadata and controls
42 lines (25 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//EXAMPLE "secrets.js" file below
module.exports = {
//randomly generated
sessionSecret: "xxxxxxxxxx" //used for cookie session management
, tokenSecret: "yyyyyyyyyy" //used for token session management
//api keys
, mandrill: "zzzzzzzzzz"
}
//END EXAMPLE
//USING THE secrets.js file
/*
Use:
This file is intended to allow you to safely use secret api keys in your application without exposing them in publicly.
Stock Yote currently uses three secret keys; two for user session security and one for our email API.
To use, create a new file in the same directly as "secrets-sample.js" named "secrets.js", and copy the above code into it.
Replace "sessionSecret" and "tokenSecret" with any randomly generated strings (we recommend "https://www.random.org/strings/").
Replace "mandrill" with your own Mandrill api key (source url).
You're ready to roll!
Advanced:
Additional keys can be added and used for other services. To use, first add the new key with a descriptive name to the above javascript object.
Then, in your controller, require the secrets object:
var secrets = require('[RELATIVE PATH TO CONFIG FILE]')[process.env.NODE_ENV].secrets;
secrets.APITOKEN will then be populated and can be used by that controller.
//
*/