Skip to content

Commit

Permalink
fix: release 3.0.0 doc and script issue (#86)
Browse files Browse the repository at this point in the history
* fix: release 3.0.0 doc and script issue

* fix: move set of vault environment before validation
  • Loading branch information
mbystedt authored Jul 4, 2023
1 parent 2ae517b commit 5be5724
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $ ./scripts/mongo-setup.sh

```bash
# Start up local vault
$ podman run -p 8200:8200 --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' -d --name=broker-vault vault
$ podman run -p 8200:8200 --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' -d --name=broker-vault hashicorp/vault
```

Once started, you must run the vault setup script to bootstrap it.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nr-broker",
"version": "3.0.0",
"version": "3.0.1",
"description": "",
"author": "",
"private": true,
Expand Down
1 change: 1 addition & 0 deletions scripts/db/mongo-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ db.environment.insertOne({
aliases: [],
vertex: result.insertedId,
});
result = db.vertex.insertOne({ collection: 'environment', name: 'tools' });
db.environment.insertOne({
name: 'tools',
short: 'tools',
Expand Down
22 changes: 11 additions & 11 deletions src/intention/intention.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ export class IntentionService {
}

for (const action of intentionDto.actions) {
const envDto = envMap[action.service.environment];
if (
action.vaultEnvironment === undefined &&
envDto &&
(envDto.name === 'production' ||
envDto.name === 'test' ||
envDto.name === 'development' ||
envDto.name === 'tools')
) {
action.vaultEnvironment = envDto.name;
}
const validationResult = this.actionService.validate(
intentionDto,
action,
Expand All @@ -126,17 +137,6 @@ export class IntentionService {
trace_id: action.trace.hash,
outcome: validationResult === null ? 'success' : 'failure',
};
const envDto = envMap[action.service.environment];
if (
action.vaultEnvironment === undefined &&
envDto &&
(envDto.name === 'production' ||
envDto.name === 'test' ||
envDto.name === 'development' ||
envDto.name === 'tools')
) {
action.vaultEnvironment = envDto.name;
}
}
const isSuccessfulOpen = actionFailures.length === 0;
this.auditService.recordIntentionOpen(req, intentionDto, isSuccessfulOpen);
Expand Down

0 comments on commit 5be5724

Please sign in to comment.