Skip to content

Commit

Permalink
Modification of README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashvin Appigadoo committed Sep 14, 2024
1 parent 62dfdd5 commit 41f87e6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions EcoSonar-API/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Then, the API can allow you to retrieve pre-formatted audit results using json f
- [CORS Setup](#cors)
- [Enable W3C validator Analysis](#w3c-validator)
- [Setup User flow](#user-flow)
- [Password encryption](#encryption)
- [Swagger Authentication](#authentication)
- [API: option 1 - Node.js](#nodejs)
- [Prerequisites](#prerequisites-node)
- [Installation](#installation-node)
Expand Down Expand Up @@ -222,7 +224,26 @@ If your projects require to set up a user flow to access some of your web pages,
```
ECOSONAR_ENV_USER_JOURNEY_ENABLED = `true`or `false`
```
<a name="encryption"></a>

### Setup User flow

The back end now requires additional settings for the ecryption of the passwords for the user-flow. However, if you do not add any settings for the password, it will still encrypt the password but with a default encryption key. Please note that the encryption Key must be 256 bits (32 characters) e.g xfn9P8L9rIpKtWKj68IZ3G865WfdYXNX

```
ENCRYPTION_KEY = `xfn9P8L9rIpKtWKj68IZ3G865WfdYXNX`
```

<a name="authentication"></a>

### Swagger Authentication

To set up the authentication settings for the swagger of ecosonar the following settings need to be added in the .env file.

```
ECOSONAR_USER_USERNAME = 'XXXXX'
ECOSONAR_USER_PASSWORD = 'XXXXX'
```

<a name="nodejs"></a>

Expand Down
4 changes: 3 additions & 1 deletion EcoSonar-API/routes/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ app.use(helmet())

const PORT = process.env.SWAGGER_PORT || 3002
app.listen(PORT, () => loggerService.info(`Swagger in progress on port ${PORT}`))
const passWord = process.env.ECOSONAR_USER_PASS || 'password'
const userName = process.env.ECOSONAR_USER_USERNAME || 'admin'
app.use("/swagger",basicAuth({
users: {'admin': 'password'},
users: {userName: passWord},
challenge: true,
}), swaggerUi.serve, swaggerUi.setup(swaggerSpec))

Expand Down

0 comments on commit 41f87e6

Please sign in to comment.