Skip to content

Commit

Permalink
Merge pull request #11 from apten-fors/slack_integartion
Browse files Browse the repository at this point in the history
Add userToken for slack integration
  • Loading branch information
haarchri committed Mar 16, 2023
2 parents 7f0748c + 3dc1fb3 commit 3940d03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/providerconfig/secret.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ type: Opaque
stringData:
credentials: |
{
"token": "y0ur-t0k3n"
"token": "y0ur-t0k3n",
"user_token": "y0ur-t0k3n"
}
5 changes: 5 additions & 0 deletions internal/clients/pagerduty.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
errExtractCredentials = "cannot extract credentials"
errUnmarshalCredentials = "cannot unmarshal pagerduty credentials as JSON"
keyToken = "token"
userToken = "user_token"
)

// TerraformSetupBuilder builds Terraform a terraform.SetupFn function which
Expand Down Expand Up @@ -70,6 +71,10 @@ func TerraformSetupBuilder(version, providerSource, providerVersion string) terr
ps.Configuration[keyToken] = v
}

if v, ok := creds[userToken]; ok {
ps.Configuration[userToken] = v
}

return ps, nil
}
}

0 comments on commit 3940d03

Please sign in to comment.