Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add default to refresh token #1738

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions examples/resources/okta_app_oauth/refresh.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
resource "okta_app_oauth" "test" {
label = "testAcc_replace_with_uuid"
status = "ACTIVE"
type = "browser"
grant_types = ["authorization_code", "refresh_token"]
redirect_uris = ["http://d.com/aaa"]
response_types = ["code"]
hide_ios = true
hide_web = true
auto_submit_toolbar = false
refresh_token_rotation = "STATIC"
label = "testAcc_replace_with_uuid"
status = "ACTIVE"
type = "browser"
grant_types = ["authorization_code", "refresh_token"]
redirect_uris = ["http://d.com/aaa"]
response_types = ["code"]
hide_ios = true
hide_web = true
auto_submit_toolbar = false
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/hashicorp/terraform-plugin-mux v0.12.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/okta/okta-sdk-golang/v3 v3.0.14
github.com/okta/okta-sdk-golang/v3 v3.0.15
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/stretchr/testify v1.8.4
gopkg.in/dnaeon/go-vcr.v3 v3.1.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/okta/okta-sdk-golang/v3 v3.0.14 h1:CpAysS6BizLD5YSENqfpFj1qrsAjTVuU7xZxdwGNMdU=
github.com/okta/okta-sdk-golang/v3 v3.0.14/go.mod h1:G9c5Rn6odsHI6XSC6PBa91Z5CicB8dv8zOfceeTRaWA=
github.com/okta/okta-sdk-golang/v3 v3.0.15 h1:ow2UNcLNNqMZYfWky/O//wFTZGWwin33RUXYq3XOY0U=
github.com/okta/okta-sdk-golang/v3 v3.0.15/go.mod h1:G9c5Rn6odsHI6XSC6PBa91Z5CicB8dv8zOfceeTRaWA=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
Expand Down
8 changes: 4 additions & 4 deletions okta/resource_okta_app_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,14 @@ func resourceAppOAuth() *schema.Resource {
"refresh_token_rotation": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "*Early Access Property* Refresh token rotation behavior",
Default: "STATIC",
Description: "*Early Access Property* Refresh token rotation behavior, required with grant types refresh_token",
},
"refresh_token_leeway": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "*Early Access Property* Grace period for token rotation",
Default: 0,
Description: "*Early Access Property* Grace period for token rotation, required with grant types refresh_token",
},
"auto_submit_toolbar": {
Type: schema.TypeBool,
Expand Down
10 changes: 5 additions & 5 deletions okta/resource_okta_app_oauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ func TestAccResourceOktaAppOauth_refreshToken(t *testing.T) {
resourceName := fmt.Sprintf("%s.test", appOAuth)

oktaResourceTest(t, resource.TestCase{
PreCheck: testAccPreCheck(t),
ErrorCheck: testAccErrorChecks(t),
ProviderFactories: testAccProvidersFactories,
CheckDestroy: checkResourceDestroy(appOAuth, createDoesAppExist(sdk.NewOpenIdConnectApplication())),
PreCheck: testAccPreCheck(t),
ErrorCheck: testAccErrorChecks(t),
ProtoV5ProviderFactories: testAccMergeProvidersFactories,
CheckDestroy: checkResourceDestroy(appOAuth, createDoesAppExist(sdk.NewOpenIdConnectApplication())),
Steps: []resource.TestStep{
{
Config: config,
Expand All @@ -108,7 +108,7 @@ func TestAccResourceOktaAppOauth_refreshToken(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "type", "browser"),
resource.TestCheckResourceAttr(resourceName, "grant_types.#", "2"),
resource.TestCheckResourceAttr(resourceName, "refresh_token_rotation", "STATIC"),
resource.TestCheckNoResourceAttr(resourceName, "refresh_token_leeway"),
resource.TestCheckResourceAttr(resourceName, "refresh_token_leeway", "0"),
),
},
{
Expand Down
Loading