Skip to content

Commit

Permalink
feat:[CDS-57089]: added Jira Pat auth type (#591)
Browse files Browse the repository at this point in the history
* feat:[CDS-57089]: added Jira Pat auth type

* feat:[CDS-57089]: minor

* feat:[CDS-57089]: minor

* feat:[CDS-57089]: minor

* feat:[CDS-57089]: minor
  • Loading branch information
naman-goenka committed Jun 26, 2023
1 parent 94b0b2e commit 8d8aa68
Show file tree
Hide file tree
Showing 10 changed files with 371 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .changelog/591.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/harness_platform_connector_jira: Enhanced jira connector resource to support newer PersonalAccessToken authentication beans.
```
9 changes: 9 additions & 0 deletions docs/data-sources/platform_connector_jira.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ data "harness_platform_connector_jira" "example" {
Read-Only:

- `auth_type` (String)
- `personal_access_token` (List of Object) (see [below for nested schema](#nestedobjatt--auth--personal_access_token))
- `username_password` (List of Object) (see [below for nested schema](#nestedobjatt--auth--username_password))

<a id="nestedobjatt--auth--personal_access_token"></a>
### Nested Schema for `auth.personal_access_token`

Read-Only:

- `pat_ref` (String)


<a id="nestedobjatt--auth--username_password"></a>
### Nested Schema for `auth.username_password`

Expand Down
27 changes: 27 additions & 0 deletions docs/resources/platform_connector_jira.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Resource for creating a Jira connector.
## Example Usage

```terraform
# Auth type UsernamePassword
resource "harness_platform_connector_jira" "test" {
identifier = "identifier"
name = "name"
Expand All @@ -29,6 +30,23 @@ resource "harness_platform_connector_jira" "test" {
}
}
}
# Auth Type PersonalAccessToken
resource "harness_platform_connector_jira" "test" {
identifier = "identifier"
name = "name"
description = "test"
tags = ["foo:bar"]
url = "https://jira.com"
delegate_selectors = ["harness-delegate"]
auth {
auth_type = "PersonalAccessToken"
personal_access_token {
pat_ref = "account.secret_id"
}
}
}
```

<!-- schema generated by tfplugindocs -->
Expand Down Expand Up @@ -65,8 +83,17 @@ Required:

Optional:

- `personal_access_token` (Block List, Max: 1) Authenticate using personal access token. (see [below for nested schema](#nestedblock--auth--personal_access_token))
- `username_password` (Block List, Max: 1) Authenticate using username password. (see [below for nested schema](#nestedblock--auth--username_password))

<a id="nestedblock--auth--personal_access_token"></a>
### Nested Schema for `auth.personal_access_token`

Required:

- `pat_ref` (String) Reference to a secret containing the personal access token to use for authentication. To reference a secret at the organization scope, prefix 'org' to the expression: org.{identifier}. To reference a secret at the account scope, prefix 'account` to the expression: account.{identifier}.


<a id="nestedblock--auth--username_password"></a>
### Nested Schema for `auth.username_password`

Expand Down
18 changes: 18 additions & 0 deletions examples/resources/harness_platform_connector_jira/resource.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Auth type UsernamePassword
resource "harness_platform_connector_jira" "test" {
identifier = "identifier"
name = "name"
Expand All @@ -14,3 +15,20 @@ resource "harness_platform_connector_jira" "test" {
}
}
}

# Auth Type PersonalAccessToken
resource "harness_platform_connector_jira" "test" {
identifier = "identifier"
name = "name"
description = "test"
tags = ["foo:bar"]

url = "https://jira.com"
delegate_selectors = ["harness-delegate"]
auth {
auth_type = "PersonalAccessToken"
personal_access_token {
pat_ref = "account.secret_id"
}
}
}
39 changes: 20 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/antihax/optional v1.0.0
github.com/docker/docker v20.10.22+incompatible
github.com/harness/harness-go-sdk v0.3.30
github.com/harness/harness-go-sdk v0.3.32
github.com/harness/harness-openapi-go-client v0.0.17
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
github.com/pkg/errors v0.9.1
Expand All @@ -14,14 +14,14 @@ require (

require (
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-retryablehttp v0.7.2
github.com/sirupsen/logrus v1.9.2
github.com/hashicorp/go-retryablehttp v0.7.4
github.com/sirupsen/logrus v1.9.3
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.6.0 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230619160724-3fbb1f12458c // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
Expand All @@ -38,18 +38,18 @@ require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.9 // indirect
github.com/hashicorp/go-plugin v1.4.10 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.5.2 // indirect
github.com/hashicorp/hcl/v2 v2.16.2 // indirect
github.com/hashicorp/hcl/v2 v2.17.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.18.1 // indirect
github.com/hashicorp/terraform-json v0.16.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.15.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.8.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.0 // indirect
github.com/hashicorp/terraform-svchost v0.1.0 // indirect
github.com/hashicorp/terraform-json v0.17.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.16.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.1 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/jhump/protoreflect v1.6.1 // indirect
github.com/jinzhu/copier v0.3.5 // indirect
Expand All @@ -70,16 +70,17 @@ require (
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.13.2 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.11.0 // indirect
golang.org/x/oauth2 v0.9.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230524185152-1884fd1fac28 // indirect
google.golang.org/grpc v1.55.0 // indirect
google.golang.org/genproto v0.0.0-20230525234025-438c736192d0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/grpc v1.56.1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.3.0 // indirect
Expand Down
Loading

0 comments on commit 8d8aa68

Please sign in to comment.