Skip to content

Commit

Permalink
Merge pull request #970 from karvounis-form3/add-saml-settings-resource
Browse files Browse the repository at this point in the history
feat(tfe_saml_settings): add resource
  • Loading branch information
uturunku1 committed Jul 20, 2023
2 parents 3c0772b + 5d3608c commit 1d5c035
Show file tree
Hide file tree
Showing 9 changed files with 766 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Unreleased

FEATURES:
* **New Resource**: `r/tfe_saml_settings` manages SAML Settings, by @karvounis-form3 [970](https://github.com/hashicorp/terraform-provider-tfe/pull/970)
* `d/tfe_saml_settings`: Add PrivateKey (sensitive), SignatureSigningMethod, and SignatureDigestMethod attributes, by @karvounis-form3 [970](https://github.com/hashicorp/terraform-provider-tfe/pull/970)

NOTES:
* The provider is now using go-tfe [v1.30.0](https://github.com/hashicorp/go-tfe/releases/tag/v1.30.0), by @karvounis-form3 [970](https://github.com/hashicorp/terraform-provider-tfe/pull/970)

## v0.47.0 (July 18, 2023)

FEATURES:
Expand Down
16 changes: 16 additions & 0 deletions tfe/data_source_saml_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ type modelTFESAMLSettings struct {
ACSConsumerURL types.String `tfsdk:"acs_consumer_url"`
MetadataURL types.String `tfsdk:"metadata_url"`
Certificate types.String `tfsdk:"certificate"`
PrivateKey types.String `tfsdk:"private_key"`
SignatureSigningMethod types.String `tfsdk:"signature_signing_method"`
SignatureDigestMethod types.String `tfsdk:"signature_digest_method"`
}

// Metadata returns the data source type name.
Expand Down Expand Up @@ -114,6 +117,16 @@ func (d *dataSourceTFESAMLSettings) Schema(_ context.Context, _ datasource.Schem
"certificate": schema.StringAttribute{
Computed: true,
},
"private_key": schema.StringAttribute{
Computed: true,
Sensitive: true,
},
"signature_signing_method": schema.StringAttribute{
Computed: true,
},
"signature_digest_method": schema.StringAttribute{
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -164,6 +177,9 @@ func (d *dataSourceTFESAMLSettings) Read(ctx context.Context, _ datasource.ReadR
ACSConsumerURL: types.StringValue(s.ACSConsumerURL),
MetadataURL: types.StringValue(s.MetadataURL),
Certificate: types.StringValue(s.Certificate),
PrivateKey: types.StringValue(s.PrivateKey),
SignatureSigningMethod: types.StringValue(s.SignatureSigningMethod),
SignatureDigestMethod: types.StringValue(s.SignatureDigestMethod),
})
resp.Diagnostics.Append(diags...)
}
3 changes: 1 addition & 2 deletions tfe/data_source_saml_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package tfe

import (
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"testing"
)
Expand Down Expand Up @@ -39,5 +38,5 @@ func TestAccTFESAMLSettingsDataSource_basic(t *testing.T) {
}

func testAccTFESAMLSettingsDataSourceConfig_basic() string {
return fmt.Sprint(`data "tfe_saml_settings" "foobar" {}`)
return `data "tfe_saml_settings" "foobar" {}`
}
1 change: 1 addition & 0 deletions tfe/provider_next.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@ func (p *frameworkProvider) DataSources(ctx context.Context) []func() datasource
func (p *frameworkProvider) Resources(ctx context.Context) []func() resource.Resource {
return []func() resource.Resource{
NewResourceVariable,
NewSAMLSettingsResource,
}
}
Loading

0 comments on commit 1d5c035

Please sign in to comment.