Skip to content

Commit

Permalink
chore: update tfproviderlint and terraform-plugin-sdk libraries (#…
Browse files Browse the repository at this point in the history
…220)

* chore: bump `tfproviderlint` library to latest

* chore: upgrade travis configs to bionic (ubuntu 14.x -> 18.x), and go 1.15.x

* chore: upgrade `terraform-plugin-sdk` to v2

* chore: fix linting errors

* Updated dependencies, fixed unit tests

* Merged with master

* Fixed imports

* Major refactoring, documentation fixes, logs adding

* Fixed lint

* Added logs

* Fixed tests resources naming format

* Changed log output

* fix: run `go mod tidy`

* Added inline hooks sweeper

Co-authored-by: Bogdan Prodan <bogdan.prodan@okta.com>
  • Loading branch information
bryantbiggs and bogdanprodan-okta authored Dec 8, 2020
1 parent 03a43be commit 84b1f77
Show file tree
Hide file tree
Showing 189 changed files with 4,357 additions and 5,162 deletions.
30 changes: 15 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
dist: trusty
dist: bionic
sudo: required
services:
- docker
- docker
language: go

env:
- GOFLAGS=-mod=vendor

install:
- make build
- make tools
- make build
- make tools

branches:
only:
- master
- master

matrix:
fast_finish: true
allow_failures:
- go: tip
- go: tip
include:
- go: "1.13.x"
name: "Code Lint"
script: make lint
- go: "1.13.x"
name: "Code Vet"
script: make vet
- go: "1.13.x"
name: "Code UnitTest"
script: make test
- go: '1.15.x'
name: 'Code Lint'
script: make lint
- go: '1.15.x'
name: 'Code Vet'
script: make vet
- go: '1.15.x'
name: 'Code UnitTest'
script: make test
4 changes: 2 additions & 2 deletions examples/okta_app_basic_auth/basic_updated.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ resource "okta_user" "user" {
admin_roles = ["APP_ADMIN", "USER_ADMIN"]
first_name = "TestAcc"
last_name = "blah"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
}

resource "okta_group" "group" {
Expand Down
4 changes: 2 additions & 2 deletions examples/okta_app_bookmark/basic_updated.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ resource "okta_user" "user" {
admin_roles = ["APP_ADMIN", "USER_ADMIN"]
first_name = "TestAcc"
last_name = "blah"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
}

resource "okta_group" "group" {
Expand Down
2 changes: 1 addition & 1 deletion examples/okta_app_oauth/basic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ resource "okta_app_oauth" "test" {
client_basic_secret = "something_from_somewhere"
client_id = "something_from_somewhere"
token_endpoint_auth_method = "client_secret_basic"
consent_method = null
consent_method = "TRUSTED"
}
2 changes: 1 addition & 1 deletion examples/okta_app_oauth/group_for_groups_claim.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// https://developer.okta.com/docs/guides/create-token-with-groups-claim/create-groups-claim/

resource "okta_group" "whitelist_group" {
name = "Whitelist Group"
name = "testAcc_replace_with_uuid"
}

resource "okta_app_oauth" "test" {
Expand Down
4 changes: 2 additions & 2 deletions examples/okta_app_oauth/groups_and_users.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ resource "okta_user" "user" {
admin_roles = ["APP_ADMIN", "USER_ADMIN"]
first_name = "TestAcc"
last_name = "blah"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
status = "ACTIVE"
}

Expand Down
1 change: 0 additions & 1 deletion examples/okta_app_oauth/updated.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ resource "okta_app_oauth" "test" {
hide_ios = true
hide_web = true
auto_submit_toolbar = false
consent_method = null
}
8 changes: 4 additions & 4 deletions examples/okta_app_saml/user_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ resource "okta_user" "user" {
admin_roles = ["APP_ADMIN", "USER_ADMIN"]
first_name = "TestAcc"
last_name = "blah"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
status = "ACTIVE"
}

resource "okta_user" "user1" {
first_name = "TestAcc1"
last_name = "blah"
login = "test-acc-1-replace_with_uuid@example.com"
email = "test-acc-1-replace_with_uuid@example.com"
login = "testAcc-1-replace_with_uuid@example.com"
email = "testAcc-1-replace_with_uuid@example.com"
status = "ACTIVE"
}

Expand Down
8 changes: 4 additions & 4 deletions examples/okta_app_saml/user_groups_updated.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ resource "okta_user" "user" {
admin_roles = ["APP_ADMIN", "USER_ADMIN"]
first_name = "TestAcc"
last_name = "blah"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
status = "ACTIVE"
}

resource "okta_user" "user1" {
first_name = "TestAcc1"
last_name = "blah"
login = "test-acc-1-replace_with_uuid@example.com"
email = "test-acc-1-replace_with_uuid@example.com"
login = "testAcc-1-replace_with_uuid@example.com"
email = "testAcc-1-replace_with_uuid@example.com"
status = "ACTIVE"
}

Expand Down
8 changes: 4 additions & 4 deletions examples/okta_group/datasource.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
resource okta_group test {
name = "testAcc_replace_with_uuid"
resource "okta_group" "test" {
name = "testAcc"
description = "testing, testing"
users = [okta_user.test.id]
}

resource okta_user test {
resource "okta_user" "test" {
first_name = "TestAcc"
last_name = "Jones"
login = "john_replace_with_uuid@ledzeppelin.com"
email = "john_replace_with_uuid@ledzeppelin.com"
}

data okta_group test {
data "okta_group" "test" {
include_users = true
name = okta_group.test.name
}
8 changes: 8 additions & 0 deletions examples/okta_group/okta_group.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
resource "okta_group" "test" {
name = "testAcc"
description = "testing, testing"
users = [okta_user.test.id]
}

resource "okta_user" "test" {
first_name = "TestAcc"
last_name = "Jones"
login = "john_replace_with_uuid@ledzeppelin.com"
email = "john_replace_with_uuid@ledzeppelin.com"
}
4 changes: 2 additions & 2 deletions examples/okta_group_roles/all_roles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource okta_group_roles test {
resource okta_user test {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
group_memberships = [okta_group.test.id]
}
4 changes: 2 additions & 2 deletions examples/okta_group_roles/basic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource okta_group_roles test {
resource okta_user test {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
group_memberships = [okta_group.test.id]
}
53 changes: 53 additions & 0 deletions examples/okta_policy_rule_idp_discovery/basic_domain.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,56 @@ resource okta_policy_rule_idp_discovery test {
value = "articulate.com"
}
}

resource okta_idp_saml test {
name = "testAcc_replace_with_uuid"
acs_binding = "HTTP-POST"
acs_type = "INSTANCE"
sso_url = "https://idp.example.com"
sso_destination = "https://idp.example.com"
sso_binding = "HTTP-POST"
username_template = "idpuser.email"
issuer = "https://idp.example.com"
request_signature_scope = "REQUEST"
response_signature_scope = "ANY"
kid = okta_idp_saml_key.test.id
}

resource okta_idp_saml_key test {
x5c = [okta_app_saml.test.certificate]
}

resource okta_app_saml test {
label = "testAcc_replace_with_uuid"
sso_url = "http://google.com"
recipient = "http://here.com"
destination = "http://its-about-the-journey.com"
audience = "http://audience.com"
subject_name_id_template = "$${user.userName}"
subject_name_id_format = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
response_signed = true
signature_algorithm = "RSA_SHA256"
digest_algorithm = "SHA256"
honor_force_authn = false
authn_context_class_ref = "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"

attribute_statements {
name = "firstName"
values = ["user.firstName"]
}

attribute_statements {
name = "lastName"
values = ["user.lastName"]
}

attribute_statements {
name = "email"
values = ["user.email"]
}

attribute_statements {
name = "company"
values = ["Articulate"]
}
}
2 changes: 1 addition & 1 deletion examples/okta_trusted_origin/okta_trusted_origin.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "okta_trusted_origin" "testAcc_replace_with_uuid" {
name = "test-acc-replace_with_uuid"
name = "testAcc-replace_with_uuid"
origin = "https://example-replace_with_uuid.com"
scopes = ["CORS"]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "okta_trusted_origin" "testAcc_replace_with_uuid" {
name = "test-acc-replace_with_uuid"
name = "testAcc-replace_with_uuid"
active = false
origin = "https://example2-replace_with_uuid.com"
scopes = ["CORS", "REDIRECT"]
Expand Down
4 changes: 2 additions & 2 deletions examples/okta_user/all_attributes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ resource "okta_user" "test" {
admin_roles = ["ORG_ADMIN"]
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
city = "New York"
cost_center = "10"
country_code = "US"
Expand Down
4 changes: 2 additions & 2 deletions examples/okta_user/basic.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "okta_user" "test" {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
}
4 changes: 2 additions & 2 deletions examples/okta_user/basic_with_credentials.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
resource "okta_user" "test" {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
password = "Abcd1234"
recovery_question = "What is the answer to life, the universe, and everything?"
recovery_answer = "Forty Two"
Expand Down
4 changes: 2 additions & 2 deletions examples/okta_user/basic_with_credentials_updated.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
resource "okta_user" "test" {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
password = "SuperSecret007"
recovery_question = "Which symbol has the ASCII code of Forty Two?"
recovery_answer = "Asterisk"
Expand Down
4 changes: 2 additions & 2 deletions examples/okta_user/custom_attributes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ resource "okta_user" "test" {
admin_roles = ["APP_ADMIN", "USER_ADMIN"]
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"

custom_profile_attributes = <<JSON
{
Expand Down
4 changes: 2 additions & 2 deletions examples/okta_user/custom_attributes_array.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ resource "okta_user" "test" {
admin_roles = ["APP_ADMIN", "USER_ADMIN"]
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"

custom_profile_attributes = <<JSON
{
Expand Down
4 changes: 2 additions & 2 deletions examples/okta_user/datasource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ resource okta_user_schema test_number {
resource okta_user test {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"

custom_profile_attributes = <<JSON
{
Expand Down
4 changes: 2 additions & 2 deletions examples/okta_user/datasource_create_user.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource okta_user test {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
}
4 changes: 2 additions & 2 deletions examples/okta_user/deprovisioned.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "okta_user" "test" {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
status = "DEPROVISIONED"
}
4 changes: 2 additions & 2 deletions examples/okta_user/group_assigned.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ resource "okta_group" "test" {
resource "okta_user" "test" {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"

group_memberships = [okta_group.test.id]
}
4 changes: 2 additions & 2 deletions examples/okta_user/group_unassigned.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ resource "okta_group" "test" {
resource "okta_user" "test" {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
}
4 changes: 2 additions & 2 deletions examples/okta_user/import.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource okta_user test {
first_name = "TestAcc"
last_name = "Smith"
login = "test-acc-replace_with_uuid@example.com"
email = "test-acc-replace_with_uuid@example.com"
login = "testAcc-replace_with_uuid@example.com"
email = "testAcc-replace_with_uuid@example.com"
}
Loading

0 comments on commit 84b1f77

Please sign in to comment.