Skip to content

Commit

Permalink
Merge pull request #418 from ghostunnel/cs/issue-417
Browse files Browse the repository at this point in the history
Pass disableAuth as an argument instead of using flag
  • Loading branch information
csstaub committed Feb 11, 2024
2 parents da1a58b + 36d4932 commit 04b717c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.go
Expand Up @@ -448,7 +448,7 @@ func run(args []string) error {

// Duplicating this call to getTLSConfigSource() in all switch cases
// because we need to complete the validation of the command flags first.
tlsConfigSource, err := getTLSConfigSource()
tlsConfigSource, err := getTLSConfigSource(*serverDisableAuth)
if err != nil {
return err
}
Expand Down Expand Up @@ -485,7 +485,7 @@ func run(args []string) error {

// Duplicating this call to getTLSConfigSource() in all switch cases
// because we need to complete the validation of the command flags first.
tlsConfigSource, err := getTLSConfigSource()
tlsConfigSource, err := getTLSConfigSource(*clientDisableAuth)
if err != nil {
return err
}
Expand Down Expand Up @@ -831,10 +831,10 @@ func proxyLoggerFlags(flags []string) int {
return out
}

func getTLSConfigSource() (certloader.TLSConfigSource, error) {
func getTLSConfigSource(disableAuth bool) (certloader.TLSConfigSource, error) {
if *useWorkloadAPI {
logger.Printf("using SPIFFE Workload API as certificate source")
source, err := certloader.TLSConfigSourceFromWorkloadAPI(*useWorkloadAPIAddr, *clientDisableAuth, logger)
source, err := certloader.TLSConfigSourceFromWorkloadAPI(*useWorkloadAPIAddr, disableAuth, logger)
if err != nil {
logger.Printf("error: unable to create workload API TLS source: %s\n", err)
return nil, err
Expand Down

0 comments on commit 04b717c

Please sign in to comment.