Skip to content

Commit

Permalink
Merge pull request #116 from Venafi/config-fix
Browse files Browse the repository at this point in the history
feat(token): Removes error thrown during provider config
  • Loading branch information
rvelaVenafi authored Oct 2, 2023
2 parents bfb4bd1 + 33b60ea commit ac460a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.17.1 (October 2nd, 2023)
Removes an error thrown during provider configuration. Instead the error is thrown at resource creation.
This work is necessary to allow the venafi-token provider to successfully manage the tokens of this provider.

## 0.17.0 (September 25, 2023)
Added support for client certificate as authentication method. Two attributes were added for this purpose: p12_cert_filename (filename of the pkcs12 bundle) and p12_cert_password (password of the pkcs12 bundle)
Added support for client_id attribute to allow users to customize which application is requesting tokens
Expand Down
5 changes: 0 additions & 5 deletions venafi/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}

if !accessTokenMethod && !clientCertMethod && !userPassMethod && !apiKeyMethod && !devMode {
tflog.Error(ctx, messageVenafiNoAuthProvided)
diags = append(diags, diag.Diagnostic{
Severity: diag.Error,
Summary: messageVenafiClientInitFailed,
Detail: fmt.Sprintf("%s: %s", messageVenafiConfigFailed, messageVenafiNoAuthProvided),
})
return nil, diags
}

Expand Down
4 changes: 4 additions & 0 deletions venafi/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ func getIssuerHint(is string) util.IssuerHint {

func getConnection(ctx context.Context, meta interface{}) (endpoint.Connector, error) {
tflog.Info(ctx, "Building Venafi Connector")
if meta == nil {
return nil, fmt.Errorf("%s: %s", messageVenafiClientInitFailed, messageVenafiNoAuthProvided)
}

cfg := meta.(*vcert.Config)
cl, err := vcert.NewClient(cfg)
if err != nil {
Expand Down

0 comments on commit ac460a5

Please sign in to comment.