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

feat(tfe_saml_settings): add resource #970

Merged
merged 19 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7b128ac
feat: add tfe_saml_settings resource schema and metadata
karvounis-form3 Jul 7, 2023
6457922
feat: add tfe_saml_settings resource read and create
karvounis-form3 Jul 7, 2023
c17aa02
feat: add tfe_saml_settings resource update functionality
karvounis-form3 Jul 7, 2023
e8775bf
refactor: use updateSAMLSettings in 2 places instead of duplicating code
karvounis-form3 Jul 7, 2023
0066806
feat: add tfe_saml_settings resource delete functionality
karvounis-form3 Jul 7, 2023
4acc5dc
feat: add tfe_saml_settings resource import functionality
karvounis-form3 Jul 7, 2023
15bfe60
feat(saml_settings): add PrivateKey, SignatureSigningMethod, Signatur…
karvounis-form3 Jul 17, 2023
fe8c46c
feat(saml_settings): add Certificate, PrivateKey, TeamManagementEnabl…
karvounis-form3 Jul 17, 2023
cae7140
feat(r saml_settings): add basic test for resource
karvounis-form3 Jul 18, 2023
b5f6560
feat(r saml_settings): add full and update test for resource
karvounis-form3 Jul 18, 2023
6accf42
feat(r saml_settings): add import test for resource
karvounis-form3 Jul 18, 2023
6db221a
feat(r saml_settings): add markdown documentatione
karvounis-form3 Jul 18, 2023
b06d472
feat(r saml_settings): remove int64 from helpers
karvounis-form3 Jul 18, 2023
90848e6
fix(d saml_settings): make private key sensitive
karvounis-form3 Jul 19, 2023
54bb123
feat(r saml_settings): add delete test check
karvounis-form3 Jul 19, 2023
10b282d
docs(changelog): add features to changelog
karvounis-form3 Jul 19, 2023
e31404e
fix(r saml_settings): wrap error returns
karvounis-form3 Jul 19, 2023
e8a6a33
fix(r saml_settings): remove RevokeIdpCert call when deleting
karvounis-form3 Jul 19, 2023
5d3608c
fix(r saml_settings): extended import test
karvounis-form3 Jul 20, 2023
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
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