Skip to content

Commit

Permalink
feat: relabel actions in return value (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbystedt authored Oct 6, 2022
1 parent 3081cbc commit 9fd5fda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/provision-fluentbit-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ INTENTION_TOKEN=$(echo $RESPONSE | jq -r '.token')
echo "===> Jenkins provision"

# Get token for provisioning Jenkins vault token
JENKINS_INTENTION_TOKEN=$(echo $RESPONSE | jq -r '.intention.login.token')
JENKINS_INTENTION_TOKEN=$(echo $RESPONSE | jq -r '.actions.login.token')
echo "JENKINS_INTENTION_TOKEN: $JENKINS_INTENTION_TOKEN"

# Provision token for application to login as itself to Vault
Expand All @@ -38,7 +38,7 @@ echo $JENKINS_VAULT_TOKEN | jq '.'
echo "===> Fluent Bit provision"

# Get token for provisioning a Fluentbit deployment
FLUENTBIT_INTENTION_TOKEN=$(echo $RESPONSE | jq -r '.intention.provision.token')
FLUENTBIT_INTENTION_TOKEN=$(echo $RESPONSE | jq -r '.actions.provision.token')
echo "FLUENTBIT_INTENTION_TOKEN: $FLUENTBIT_INTENTION_TOKEN"

# Get secret id for fluentbit provisioning
Expand Down
6 changes: 3 additions & 3 deletions src/intention/intention.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class IntentionService {
ttl: number = INTENTION_DEFAULT_TTL_SECONDS,
) {
const startDate = new Date();
const intention = {};
const actions = {};
if (ttl < INTENTION_MIN_TTL_SECONDS || ttl > INTENTION_MAX_TTL_SECONDS) {
throw new BadRequestException();
}
Expand All @@ -40,7 +40,7 @@ export class IntentionService {
for (const action of intentionDto.actions) {
action.transaction = intentionDto.transaction;
action.trace = this.createTransaction();
intention[action.id] = {
actions[action.id] = {
token: action.trace.token,
trace_id: action.trace.hash,
outcome: 'success',
Expand All @@ -49,7 +49,7 @@ export class IntentionService {
this.auditService.recordIntentionOpen(req, intentionDto);
await this.persistenceService.addIntention(intentionDto, ttl);
return {
intention,
actions,
token: intentionDto.transaction.token,
transaction_id: intentionDto.transaction.hash,
ttl,
Expand Down

0 comments on commit 9fd5fda

Please sign in to comment.