Skip to content

Commit

Permalink
client can use env
Browse files Browse the repository at this point in the history
  • Loading branch information
sukoneck committed Oct 8, 2024
1 parent b590893 commit c1bb0df
Showing 1 changed file with 34 additions and 25 deletions.
59 changes: 34 additions & 25 deletions cmd/proxy-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,56 @@ import (

var flags []cli.Flag = []cli.Flag{
&cli.StringFlag{
Name: "listen-addr",
Value: "127.0.0.1:8080",
Usage: "address to listen on",
Name: "listen-addr",
EnvVars: []string{"LISTEN_ADDR"},
Value: "127.0.0.1:8080",
Usage: "address to listen on",
},
&cli.StringFlag{
Name: "target-addr",
Value: "https://localhost:80",
Usage: "address to proxy requests to",
Name: "target-addr",
EnvVars: []string{"TARGET_ADDR"},
Value: "https://localhost:80",
Usage: "address to proxy requests to",
},
&cli.StringFlag{
Name: "server-attestation-type",
Value: string(proxy.AttestationAzureTDX),
Usage: "type of attestation to expect and verify (" + proxy.AvailableAttestationTypes + ")",
Name: "server-attestation-type",
EnvVars: []string{"SERVER_ATTESTATION_TYPE"},
Value: string(proxy.AttestationAzureTDX),
Usage: "type of attestation to present (" + proxy.AvailableAttestationTypes + ")",
},
&cli.StringFlag{
Name: "server-measurements",
Usage: "optional path to JSON measurements enforced on the server",
Name: "server-measurements",
EnvVars: []string{"SERVER_MEASUREMENTS"},
Usage: "optional path to JSON measurements enforced on the server",
},
&cli.BoolFlag{
Name: "verify-tls",
Value: false,
Usage: "verify server's TLS certificate instead of server's attestation. Only valid for server-attestation-type=none.",
Name: "verify-tls",
EnvVars: []string{"VERIFY_TLS"},
Value: false,
Usage: "verify server's TLS certificate instead of server's attestation. Only valid for server-attestation-type=none.",
},
&cli.StringFlag{
Name: "tls-ca-certificate",
Usage: "additional CA certificate to verify against (PEM) [default=no additional TLS certs]. Only valid with --verify-tls.",
Name: "tls-ca-certificate",
EnvVars: []string{"TLS_CA_CERTIFICATE"},
Usage: "additional CA certificate to verify against (PEM) [default=no additional TLS certs]. Only valid with --verify-tls.",
},
&cli.StringFlag{
Name: "client-attestation-type",
Value: string(proxy.AttestationNone),
Usage: "type of attestation to present (" + proxy.AvailableAttestationTypes + ")",
Name: "client-attestation-type",
EnvVars: []string{"CLIENT_ATTESTATION_TYPE"},
Value: string(proxy.AttestationNone),
Usage: "type of attestation to expect and verify (" + proxy.AvailableAttestationTypes + ")",
},
&cli.BoolFlag{
Name: "log-json",
Value: false,
Usage: "log in JSON format",
Name: "log-json",
EnvVars: []string{"LOG_JSON"},
Value: false,
Usage: "log in JSON format",
},
&cli.BoolFlag{
Name: "log-debug",
Value: false,
Usage: "log debug messages",
Name: "log-debug",
EnvVars: []string{"LOG_DEBUG"},
Value: false,
Usage: "log debug messages",
},
}

Expand Down

0 comments on commit c1bb0df

Please sign in to comment.