Skip to content

Commit

Permalink
Merge pull request #399 from telefonicaid/task/add_authentication_opt…
Browse files Browse the repository at this point in the history
…ions

add authentication options
  • Loading branch information
fgalan committed Oct 16, 2019
2 parents 20046b8 + 91ceb68 commit 0f02d91
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Add authentication config env vars (#349)
- Add full support for pagination in APIs /rules and /vrules (#364)
- Add Fiware-Total-Count header to response when count
- Refactor updateAction doItWithToken to include version 1 and 2
Expand Down
13 changes: 11 additions & 2 deletions bin/perseo
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ function loadConfiguration() {
'PERSEO_SMPP_FROM',
'PERSEO_SMPP_ENABLED',
'PERSEO_NOTICES_PATH',
'PERSEO_RULES_PATH'

'PERSEO_RULES_PATH',
'PERSEO_AUTHENTICATION_HOST',
'PERSEO_AUTHENTICATION_PORT',
'PERSEO_AUTHENTICATION_USER',
'PERSEO_AUTHENTICATION_PASSWORD'
];

for (var i = 0; i < environmentValues.length; i++) {
Expand Down Expand Up @@ -154,6 +157,12 @@ function loadConfiguration() {
config.smpp.enabled = process.env.PERSEO_SMPP_ENABLED || config.smpp.enabled;
config.endpoint.noticesPath = process.env.PERSEO_NOTICES_PATH || config.endpoint.noticesPath;
config.endpoint.rulesPath = process.env.PERSEO_RULES_PATH || config.endpoint.rulesPath;

config.authentication = config.authentication || {};
config.authentication.host = process.env.PERSEO_AUTHENTICATION_HOST || config.authentication.host;
config.authentication.port = process.env.PERSEO_AUTHENTICATION_PORT || config.authentication.port;
config.authentication.user = process.env.PERSEO_AUTHENTICATION_USER || config.authentication.user;
config.authentication.password = process.env.PERSEO_AUTHENTICATION_PASSWORD || config.authentication.password;
}

loadConfiguration();
Expand Down
4 changes: 4 additions & 0 deletions documentation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ The following table shows the environment variables available for Perseo configu
| PERSEO_SMPP_ENABLED | SMPP is default method for SMS instead of use SMS gateway |
| PERSEO_NOTICES_PATH | Path for incoming notices, default value '/notices' |
| PERSEO_RULES_PATH | Path for incoming rules, default value '/rules' |
| PERSEO_AUTHENTICATION_HOST | Host of the authentication endpoint |
| PERSEO_AUTHENTICATION_PORT | Port of the authentication endpoint |
| PERSEO_AUTHENTICATION_USER | User to perform authentication |
| PERSEO_AUTHENTICATION_PASSWORD | Password for the user to perform authentication |

### Basic Configuration

Expand Down

0 comments on commit 0f02d91

Please sign in to comment.