Skip to content

Commit

Permalink
Merge pull request #309 from jwineinger/main
Browse files Browse the repository at this point in the history
Add hostname-override flag to root command to support overriding SNI hostname
  • Loading branch information
vroldanbet authored Mar 18, 2024
2 parents 8f7c8f0 + 72667df commit 529c4aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,10 @@ func DialOptsFromFlags(cmd *cobra.Command, token storage.Token) ([]grpc.DialOpti
opts = append(opts, certOpt)
}

hostnameOverride := cobrautil.MustGetString(cmd, "hostname-override")
if hostnameOverride != "" {
opts = append(opts, grpc.WithAuthority(hostnameOverride))
}

return opts, nil
}
1 change: 1 addition & 0 deletions internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func Run() {

rootCmd.PersistentFlags().String("endpoint", "", "spicedb gRPC API endpoint")
rootCmd.PersistentFlags().String("permissions-system", "", "permissions system to query")
rootCmd.PersistentFlags().String("hostname-override", "", "override the hostname used in the connection to the endpoint")
rootCmd.PersistentFlags().String("token", "", "token used to authenticate to SpiceDB")
rootCmd.PersistentFlags().String("certificate-path", "", "path to certificate authority used to verify secure connections")
rootCmd.PersistentFlags().Bool("insecure", false, "connect over a plaintext connection")
Expand Down

0 comments on commit 529c4aa

Please sign in to comment.