Skip to content

Commit

Permalink
Fix error messages truth -> trust
Browse files Browse the repository at this point in the history
Signed-off-by: Peyton Walters <[email protected]>
  • Loading branch information
Peyton Walters committed Jan 3, 2020
1 parent daa224c commit 5ef02b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cmd/plugin/vault-auth-spire.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ func BackendFactory(ctx context.Context, backendConfig *logical.BackendConfig) (
spirePlugin.verifier.AddTrustSource(&trustSource)
}
if settings.SourceOfTrust.Spire != nil {
trustSource, err := common.NewSpireTrustSource(settings.SourceOfTrust.Spire.URLs, settings.SourceOfTrust.Spire.CertLocation)
trustSource, err := common.NewSpireTrustSource(settings.SourceOfTrust.Spire.SpireEndpoints, settings.SourceOfTrust.Spire.CertStorePath)
if err != nil {
return nil, errors.New("vault-auth-spire: Failed to initialize file TrustSource - " + err.Error())
return nil, errors.New("vault-auth-spire: Failed to initialize spire TrustSource - " + err.Error())
}
spirePlugin.verifier.AddTrustSource(trustSource)
}
if settings.SourceOfTrust.File == nil && settings.SourceOfTrust.Spire == nil {
return nil, errors.New("vault-auth-spire: No sources of truth in settings")
return nil, errors.New("vault-auth-spire: No sources of trust in settings")
}

// Calls standard Vault plugin setup - magic happens here I bet :shrugs: but if it fails then we're gonna
Expand Down
10 changes: 5 additions & 5 deletions internal/common/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ type FileTrustSourceSettings struct {
}

type SpireTrustSourceSettings struct {
URLs map[string]string
CertLocation string
SpireEndpoints map[string]string
CertStorePath string
}

type LogSettings struct {
Expand Down Expand Up @@ -144,12 +144,12 @@ func readSpireSourceOfTrustSettings() (*SpireTrustSourceSettings, error) {
}

spireSettings := new(SpireTrustSourceSettings)
spireSettings.URLs = viper.GetStringMapString("trustsource.spire.domains")
spireSettings.SpireEndpoints = viper.GetStringMapString("trustsource.spire.domains")
viper.SetDefault("trustsource.spire.certLocation", "/tmp/vault-spire-certs.json")
viper.SetDefault("trustsource.spire.storeEnabled", true)
spireSettings.CertLocation = viper.GetString("trustsource.spire.certLocation")
spireSettings.CertStorePath = viper.GetString("trustsource.spire.certLocation")
if !viper.GetBool("trustsource.spire.storeEnabled") {
spireSettings.CertLocation = ""
spireSettings.CertStorePath = ""
}

return spireSettings, nil
Expand Down

0 comments on commit 5ef02b3

Please sign in to comment.