Skip to content

Commit 342ce5b

Browse files
OKTA-615109 - update provider for PAM EA featureset (#105)
* starting beta features * bug fixes, gateways, debug builds * docs * debug option * use correct field names * lea features * docs * PR feedback * docs * Update oktapam/constants/descriptions/resources.go Co-authored-by: isaacdurham-okta <[email protected]> * Update oktapam/constants/descriptions/resources.go Co-authored-by: isaacdurham-okta <[email protected]> * Update oktapam/constants/descriptions/resources.go Co-authored-by: isaacdurham-okta <[email protected]> * Update oktapam/constants/descriptions/resources.go Co-authored-by: isaacdurham-okta <[email protected]> * Update oktapam/constants/descriptions/attributes.go Co-authored-by: isaacdurham-okta <[email protected]> * Update oktapam/constants/descriptions/attributes.go Co-authored-by: isaacdurham-okta <[email protected]> * Update oktapam/constants/descriptions/attributes.go Co-authored-by: isaacdurham-okta <[email protected]> * Update oktapam/constants/descriptions/attributes.go Co-authored-by: isaacdurham-okta <[email protected]> * Update oktapam/constants/descriptions/resources.go Co-authored-by: isaacdurham-okta <[email protected]> * Update oktapam/constants/descriptions/resources.go Co-authored-by: isaacdurham-okta <[email protected]> * Apply suggestions from code review Co-authored-by: isaacdurham-okta <[email protected]> * more docs * docs * remove tag checks since we do not run them * hook up pam tests * better error message * Apply suggestions from code review Co-authored-by: isaacdurham-okta <[email protected]> * doc gen * reorder * check if present * debug * pass env to container * add TF_ACC_PAM * gate more tests based on teams * fix test * Update oktapam/constants/descriptions/attributes.go Co-authored-by: isaacdurham-okta <[email protected]> * doc gen * query param copy updates --------- Co-authored-by: isaacdurham-okta <[email protected]>
1 parent 0876158 commit 342ce5b

File tree

354 files changed

+28387
-1364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

354 files changed

+28387
-1364
lines changed

.github/workflows/checks.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
./scripts/ci-tests.sh
2828
- run: echo "🍏 This job's status is ${{ job.status }}."
2929
check3:
30-
name: Acceptance Tests
30+
name: ASA Acceptance Tests
3131
# Ensure acceptance tests are only run on okta/terraform-provider-oktapam or if a special label is applied (`run-acceptance-tests`)
3232
if: github.repository == 'okta/terraform-provider-oktapam' || github.event.label.name == 'run-acceptance-tests'
3333
runs-on: ubuntu-latest
@@ -42,7 +42,7 @@ jobs:
4242
with:
4343
terraform_version: ${{ steps.vars.outputs.tf-version }}
4444
terraform_wrapper: false
45-
- name: Run unit tests
45+
- name: Run acceptance tests
4646
run: |
4747
./scripts/ci-acceptance-tests.sh
4848
env:
@@ -61,6 +61,44 @@ jobs:
6161
OKTAPAM_API_HOST: ${{ secrets.OKTA_499446_OKTAPAM_API_HOST }}
6262
- run: echo "🍏 This job's status is ${{ job.status }}."
6363
check4:
64+
name: OktaPA Acceptance Tests
65+
# Ensure acceptance tests are only run on okta/terraform-provider-oktapam or if a special label is applied (`run-acceptance-tests`)
66+
if: github.repository == 'okta/terraform-provider-oktapam' || github.event.label.name == 'run-acceptance-tests'
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Check out repository code
70+
uses: actions/checkout@v3
71+
- name: Get Terraform CLI Version
72+
id: vars
73+
run: echo ::set-output name=tf-version::$(cat .terraform-version)
74+
- name: Setup Terraform
75+
uses: hashicorp/setup-terraform@v2
76+
with:
77+
terraform_version: ${{ steps.vars.outputs.tf-version }}
78+
terraform_wrapper: false
79+
- name: Run acceptance tests
80+
run: |
81+
./scripts/ci-acceptance-tests.sh
82+
env:
83+
TF_ACC_PAM: 1
84+
OKTAPAM_SECRET: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_SECRET }}
85+
OKTAPAM_KEY: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_KEY }}
86+
OKTAPAM_TEAM: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_TEAM }}
87+
OKTAPAM_TRUSTED_DOMAIN_OVERRIDE: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_TRUSTED_DOMAIN_OVERRIDE }}
88+
OKTAPAM_API_HOST: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_API_HOST }}
89+
- name: If the acceptance tests fail, retry. Intended for failed locks and dependency download timeouts.
90+
if: failure()
91+
run: |
92+
./scripts/ci-acceptance-tests.sh
93+
env:
94+
TF_ACC_PAM: 1
95+
OKTAPAM_SECRET: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_SECRET }}
96+
OKTAPAM_KEY: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_KEY }}
97+
OKTAPAM_TEAM: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_TEAM }}
98+
OKTAPAM_TRUSTED_DOMAIN_OVERRIDE: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_TRUSTED_DOMAIN_OVERRIDE }}
99+
OKTAPAM_API_HOST: ${{ secrets.OKTA_623529_PAM_TEAM_OKTAPAM_API_HOST }}
100+
- run: echo "🍏 This job's status is ${{ job.status }}."
101+
check5:
64102
name: Doc Generation
65103
runs-on: ubuntu-latest
66104
steps:

.github/workflows/tag-checks.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@ NAMESPACE=pam
33
NAME=oktapam
44
BINARY=terraform-provider-${NAME}
55
# On verion changes, update tag-checks.yml
6-
VERSION=0.3.3
6+
VERSION=0.4.0
77
OS_ARCH=$(shell go env GOOS)_$(shell go env GOARCH)
88
PLUGIN_DIR=~/.terraform.d/plugins
99
DOCGEN_RESOURCES_DIR=docgen-resources
1010

1111
SET_VERSION=-ldflags "-X github.com/okta/terraform-provider-oktapam/oktapam/version.Version=${VERSION}"
1212

13+
ifneq ($(DEBUG), )
14+
GOFLAGS :=${GOFLAGS} -gcflags=all="-N -l"
15+
else
16+
GOFLAGS :=${GOFLAGS} -trimpath
17+
endif
18+
1319
.DEFAULT_GOAL := install
1420

1521
build:
16-
go build -ldflags "-X github.com/okta/terraform-provider-oktapam/oktapam/version.Version=${VERSION}dev" -o ${BINARY}
22+
go build ${GOFLAGS} -ldflags "-X github.com/okta/terraform-provider-oktapam/oktapam/version.Version=${VERSION}dev" -o ${BINARY}
1723

1824
release:
1925
GOOS=darwin GOARCH=amd64 go build ${SET_VERSION} -o ./bin/${BINARY}_${VERSION}_darwin_amd64
@@ -46,6 +52,11 @@ testacc:
4652
# TESTARGS here can be used to pass arbitrary flags to go test, e.g. '-run TestMyTest'
4753
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
4854

55+
testaccpam:
56+
# TESTARGS here can be used to pass arbitrary flags to go test, e.g. '-run TestMyTest'
57+
TF_ACC=1 TF_ACC_PAM=1 go test ./... -v $(TESTARGS) -timeout 120m
58+
59+
4960
generate:
5061
go generate ./...
5162

Makefile.ci

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ ci-acceptance-test: ci-container
3434
-e OKTAPAM_SECRET \
3535
-e OKTAPAM_TEAM \
3636
-e OKTAPAM_API_HOST \
37+
-e OKTAPAM_TRUSTED_DOMAIN_OVERRIDE \
38+
-e TF_ACC_PAM \
3739
-e TF_ACC_TERRAFORM_PATH=/usr/local/bin/terraform \
3840
-e TF_ACC_TERRAFORM_VERSION \
3941
-v ${TF_ACC_TERRAFORM_PATH}:/usr/local/bin/terraform \

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,32 @@ In order to test the provider, you can simply run `make test`.
118118
$ make test
119119
```
120120

121-
In order to run the full suite of Acceptance tests, run `make testacc`.
121+
We have two sets of acceptance tests, one for an Advanced Server Access team, and one for an Okta Privileged Access team. There are some tests that are shared between the two suites.
122122

123123
*Note:* Acceptance tests create real resources, and often cost money to run. If you wish to test against a dev/test server, ensure that you have the `OKTAPAM_API_HOST` variable set.
124124

125+
To run the full test suite of Acceptance tests for ASA, run `make testacc`.:
126+
125127
```sh
126128
$ make testacc
127129
```
128130

131+
To run the full test suite of Acceptance tests for Okta PA, run `make testaccpam`.:
132+
133+
```sh
134+
$ make testaccpam
135+
```
136+
137+
129138
If you want to run specific acceptance tests then set TESTARGS variable. TestCaseFunctionName(t *testing.T) can be a regular
130139
expression too.
131140

132141
```sh
133142
$ TESTARGS='-run TestcaseFunctionName' make testacc
134143
```
135144

145+
Note that you'll need to sub `testacc` for `testaccpam` if the tests is an Okta PA test.
146+
136147
# Releasing the Provider
137148

138149
1. Bump version in `Makefile`.

docs/data-sources/ad_connections.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "oktapam_ad_connections Data Source - terraform-provider-oktapam"
44
subcategory: ""
55
description: |-
6-
A list of ASA AD Connections associated with an ASA Team.
6+
A list of AD Connections associated with your Team.
77
---
88

99
# oktapam_ad_connections (Data Source)
1010

11-
A list of ASA AD Connections associated with an ASA Team.
11+
A list of AD Connections associated with your Team.
1212

1313

1414

@@ -17,13 +17,13 @@ A list of ASA AD Connections associated with an ASA Team.
1717

1818
### Optional
1919

20-
- `certificate_id` (String) If `true`, only connections with a matching certificate ID are returned.
21-
- `gateway_id` (String) If `true`, only connections with a matching gateway ID are returned.
20+
- `certificate_id` (String) If `true`, results only include AD Connections associated with the specified certificate ID.
21+
- `gateway_id` (String) If `true`, results only include AD Connections associated with the specified Gateway ID.
2222
- `include_cert_details` (Boolean) If `true`, results also include certificate details
2323

2424
### Read-Only
2525

26-
- `ad_connections` (List of Object) A list of ASA AD Connections associated with an ASA Team. (see [below for nested schema](#nestedatt--ad_connections))
26+
- `ad_connections` (List of Object) A list of AD Connections associated with your Team. (see [below for nested schema](#nestedatt--ad_connections))
2727
- `id` (String) The ID of this resource.
2828

2929
<a id="nestedatt--ad_connections"></a>

docs/data-sources/ad_user_sync_task_settings.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "oktapam_ad_user_sync_task_settings Data Source - terraform-provider-oktapam"
44
subcategory: ""
55
description: |-
6-
Returns a previously created ASA AD User Sync Task Settings. For more information check out the documentation https://help.okta.com/asa/en-us/Content/Topics/Adv_Server_Access/docs/ad-user-sync.htm on AD user discovery.
6+
Returns an existing AD user sync job. For more information check out the documentation https://help.okta.com/asa/en-us/Content/Topics/Adv_Server_Access/docs/ad-user-sync.htm on AD user discovery.
77
---
88

99
# oktapam_ad_user_sync_task_settings (Data Source)
1010

11-
Returns a previously created ASA AD User Sync Task Settings. For more information check out the [documentation](https://help.okta.com/asa/en-us/Content/Topics/Adv_Server_Access/docs/ad-user-sync.htm) on AD user discovery.
11+
Returns an existing AD user sync job. For more information check out the [documentation](https://help.okta.com/asa/en-us/Content/Topics/Adv_Server_Access/docs/ad-user-sync.htm) on AD user discovery.
1212

1313

1414

@@ -17,19 +17,19 @@ Returns a previously created ASA AD User Sync Task Settings. For more informatio
1717

1818
### Required
1919

20-
- `connection_id` (String) UUID of the AD Connection with which this AD Task Settings is associated.
20+
- `connection_id` (String) The UUID of an associated AD connection.
2121

2222
### Read-Only
2323

24-
- `base_dn` (String) Specifies where the rule searches for users.
25-
- `frequency` (Number) Frequency of the AD User Sync Task
24+
- `base_dn` (String) Specifies the domain to search for user accounts.
25+
- `frequency` (Number) Indicates how often the user sync job runs. Possible values: `1`, `6`, `12`, `24`.
2626
- `id` (String) The ID of this resource.
27-
- `is_active` (Boolean) If `true`, enables AD user sync task
28-
- `ldap_query_filter` (String) Specifies the criteria used to filter users.
27+
- `is_active` (Boolean) If `true`, enables the user sync job.
28+
- `ldap_query_filter` (String) The criteria used to filter user accounts.
2929
- `name` (String) The human-readable name of the resource. Values are case-sensitive.
30-
- `run_test` (Boolean) If `true`, test is performed based on specified AD User Sync Task Settings
31-
- `sid_field` (String) AD attribute mapped to user security identifier
32-
- `start_hour_utc` (Number) If AD user sync task is scheduled to run daily, then specify start hour in UTC
33-
- `upn_field` (String) AD attribute mapped to user principal name
30+
- `run_test` (Boolean) If `true`, performs a test run for the user sync job.
31+
- `sid_field` (String) The AD attribute that defines the security identifier (SID) for accounts. Most AD tenants use `objectSID`.
32+
- `start_hour_utc` (Number) A UTC timestamp that indicates the hour range when the user sync job runs. Only used if `frequency`is set to 24.
33+
- `upn_field` (String) The AD attribute that defines the User Principal Name (UPN) for accounts. Most AD tenants use `userPrincipalName`.
3434

3535

docs/data-sources/ad_user_sync_task_settings_id_list.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "oktapam_ad_user_sync_task_settings_id_list Data Source - terraform-provider-oktapam"
44
subcategory: ""
55
description: |-
6-
Returns a list of previously created ASA AD User Sync Task Settings IDs for an AD connection. For more information check out the documentation https://help.okta.com/asa/en-us/Content/Topics/Adv_Server_Access/docs/ad-user-sync.htm on AD user discovery.
6+
Returns a list of all AD user sync jobs a specified AD Connection. For more information check out the documentation https://help.okta.com/asa/en-us/Content/Topics/Adv_Server_Access/docs/ad-user-sync.htm on AD user discovery.
77
---
88

99
# oktapam_ad_user_sync_task_settings_id_list (Data Source)
1010

11-
Returns a list of previously created ASA AD User Sync Task Settings IDs for an AD connection. For more information check out the [documentation](https://help.okta.com/asa/en-us/Content/Topics/Adv_Server_Access/docs/ad-user-sync.htm) on AD user discovery.
11+
Returns a list of all AD user sync jobs a specified AD Connection. For more information check out the [documentation](https://help.okta.com/asa/en-us/Content/Topics/Adv_Server_Access/docs/ad-user-sync.htm) on AD user discovery.
1212

1313

1414

@@ -17,11 +17,11 @@ Returns a list of previously created ASA AD User Sync Task Settings IDs for an A
1717

1818
### Required
1919

20-
- `connection_id` (String) The id of an ASA AD Connection. Results are returned for only this Connection.
20+
- `connection_id` (String) If defined, results only include resources associated with the specified AD Connection.
2121

2222
### Optional
2323

24-
- `status` (String) If a value is provided, includes ASA user sync task settings with specified status. Valid statuses are `ACTIVE` and `INACTIVE`.
24+
- `status` (String) If defined, results only include user sync jobs with the specified status. Possible values: `ACTIVE` and `INACTIVE`.
2525

2626
### Read-Only
2727

docs/data-sources/gateway_setup_token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Returns a previously created ASA Gateway Setup Token associated with the ASA Tea
2020
- `created_at` (String) The UTC time when the resource was created. Format is '2022-01-01 00:00:00 +0000 UTC'.
2121
- `description` (String) The human-readable description of the resource.
2222
- `id` (String) The ID of this resource.
23-
- `labels` (Map of String) A map of key-value pairings that define access to the ASA Gateway.
23+
- `labels` (Map of String) A map of key-value pairings that define access to a Gateway.
2424
- `token` (String) The secret used for resource enrollment.
2525

2626

docs/data-sources/gateway_setup_tokens.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Returns a list of ASA Gateway Setup Token IDs associated with the ASA Team speci
1717

1818
### Optional
1919

20-
- `description_contains` (String) If a value is provided, the results are filtered to only contain resources whose name contains that value.
20+
- `description_contains` (String) If defined, results only contain resources that include the specified value in the `name` field.
2121

2222
### Read-Only
2323

0 commit comments

Comments
 (0)