Skip to content

Commit

Permalink
Merge pull request #84 from arangodb-managed/OAS-7446
Browse files Browse the repository at this point in the history
OAS-7446 | add boolean for sso
  • Loading branch information
lakhansamani authored Jun 9, 2023
2 parents df7e844 + af558d4 commit 4e94bee
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/arangodb-managed/terraform-provider-oasis

require (
github.com/arangodb-managed/apis v0.77.3
github.com/arangodb-managed/apis v0.79.15
github.com/arangodb-managed/log-helper v0.2.5
github.com/gogo/protobuf v1.3.2
github.com/hashicorp/terraform-plugin-docs v0.8.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/
github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec=
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
github.com/arangodb-managed/apis v0.77.3 h1:7l8/T4vYTem+cWoCFfAMFwgG+Sll1KWbttbSnTsjXHc=
github.com/arangodb-managed/apis v0.77.3/go.mod h1:ZlvA803MmUI3m6ijvaAYKKaWgLJq8bBZZuq8uyZo2PY=
github.com/arangodb-managed/apis v0.79.15 h1:d7/VE3+zm0HshaV9Dx16XTpyNKfggwQxu70WoVJbOyk=
github.com/arangodb-managed/apis v0.79.15/go.mod h1:ZlvA803MmUI3m6ijvaAYKKaWgLJq8bBZZuq8uyZo2PY=
github.com/arangodb-managed/log-helper v0.2.5 h1:Kg3+0bDVFhEgyjMhIbCIj9hejgN2VaD4Cw/JQ4ARsd4=
github.com/arangodb-managed/log-helper v0.2.5/go.mod h1:G17ASSd3Edday3i1QREGefyLJ2TduHxxFsOaqoigurE=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
Expand Down
11 changes: 11 additions & 0 deletions internal/resource_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
enableGoogleFieldName = "enable_google"
enableUsernamePasswordFieldName = "enable_username_password"
enableMicrosoftFieldName = "enable_microsoft"
enableSso = "enable_sso"
)

// resourceOrganization defines an Organization Oasis resource.
Expand Down Expand Up @@ -100,6 +101,12 @@ func resourceOrganization() *schema.Resource {
Optional: true,
Default: false,
},
enableSso: {
Type: schema.TypeBool,
Description: "Organization Resource Enable Single Sign On(SSO) Login field",
Optional: true,
Default: false,
},
},
},
},
Expand Down Expand Up @@ -253,6 +260,7 @@ func flattenAuthenticationProviders(p *rm.AuthenticationProviders) []interface{}
providers[enableGoogleFieldName] = p.GetEnableGoogle()
providers[enableMicrosoftFieldName] = p.GetEnableMicrosoft()
providers[enableUsernamePasswordFieldName] = p.GetEnableUsernamePassword()
providers[enableSso] = p.GetEnableSso()
return []interface{}{
providers,
}
Expand All @@ -275,6 +283,9 @@ func expandAuthenticationProviders(p []interface{}) *rm.AuthenticationProviders
if i, ok := item[enableUsernamePasswordFieldName]; ok {
result.EnableUsernamePassword = i.(bool)
}
if i, ok := item[enableSso]; ok {
result.EnableSso = i.(bool)
}
}
return result
}
2 changes: 2 additions & 0 deletions internal/resource_organization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func TestFlattenOrganization(t *testing.T) {
enableGoogleFieldName: true,
enableMicrosoftFieldName: true,
enableUsernamePasswordFieldName: true,
enableSso: true,
},
}
organization.AuthenticationProviders = expandAuthenticationProviders(authProviderData)
Expand All @@ -156,6 +157,7 @@ func TestFlattenOrganization(t *testing.T) {
enableGoogleFieldName: true,
enableMicrosoftFieldName: true,
enableUsernamePasswordFieldName: true,
enableSso: true,
},
}
flattened := flattenOrganizationResource(organization)
Expand Down

0 comments on commit 4e94bee

Please sign in to comment.