mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-20 12:37:16 +02:00
all: fix misspelling of override (#50)
This commit is contained in:
parent
dbafc691c3
commit
6f93909194
7 changed files with 16 additions and 16 deletions
|
@ -55,7 +55,7 @@ services:
|
||||||
- AUTHENTICATE_INTERNAL_URL=pomerium-authenticate:443
|
- AUTHENTICATE_INTERNAL_URL=pomerium-authenticate:443
|
||||||
# When communicating internally, rPC is going to get a name conflict expecting an external
|
# When communicating internally, rPC is going to get a name conflict expecting an external
|
||||||
# facing certificate name (i.e. authenticate-service.local vs *.corp.example.com).
|
# facing certificate name (i.e. authenticate-service.local vs *.corp.example.com).
|
||||||
- OVERIDE_CERTIFICATE_NAME=*.corp.beyondperimeter.com
|
- OVERRIDE_CERTIFICATE_NAME=*.corp.beyondperimeter.com
|
||||||
- ROUTES=https://gitlab.corp.beyondperimeter.com=https://gitlab
|
- ROUTES=https://gitlab.corp.beyondperimeter.com=https://gitlab
|
||||||
# Generate 256 bit random keys e.g. `head -c32 /dev/urandom | base64`
|
# Generate 256 bit random keys e.g. `head -c32 /dev/urandom | base64`
|
||||||
- SHARED_SECRET=aDducXQzK2tPY3R4TmdqTGhaYS80eGYxcTUvWWJDb2M=
|
- SHARED_SECRET=aDducXQzK2tPY3R4TmdqTGhaYS80eGYxcTUvWWJDb2M=
|
||||||
|
|
|
@ -56,7 +56,7 @@ services:
|
||||||
- AUTHENTICATE_INTERNAL_URL=pomerium-authenticate:443
|
- AUTHENTICATE_INTERNAL_URL=pomerium-authenticate:443
|
||||||
# When communicating internally, rPC is going to get a name conflict expecting an external
|
# When communicating internally, rPC is going to get a name conflict expecting an external
|
||||||
# facing certificate name (i.e. authenticate-service.local vs *.corp.example.com).
|
# facing certificate name (i.e. authenticate-service.local vs *.corp.example.com).
|
||||||
- OVERIDE_CERTIFICATE_NAME=*.corp.beyondperimeter.com
|
- OVERRIDE_CERTIFICATE_NAME=*.corp.beyondperimeter.com
|
||||||
- ROUTES=https://httpbin.corp.beyondperimeter.com=http://httpbin,https://hello.corp.beyondperimeter.com=http://hello:8080/
|
- ROUTES=https://httpbin.corp.beyondperimeter.com=http://httpbin,https://hello.corp.beyondperimeter.com=http://hello:8080/
|
||||||
# Generate 256 bit random keys e.g. `head -c32 /dev/urandom | base64`
|
# Generate 256 bit random keys e.g. `head -c32 /dev/urandom | base64`
|
||||||
- SHARED_SECRET=aDducXQzK2tPY3R4TmdqTGhaYS80eGYxcTUvWWJDb2M=
|
- SHARED_SECRET=aDducXQzK2tPY3R4TmdqTGhaYS80eGYxcTUvWWJDb2M=
|
||||||
|
|
|
@ -31,7 +31,7 @@ spec:
|
||||||
value: https://auth.corp.beyondperimeter.com
|
value: https://auth.corp.beyondperimeter.com
|
||||||
- name: AUTHENTICATE_INTERNAL_URL
|
- name: AUTHENTICATE_INTERNAL_URL
|
||||||
value: "pomerium-authenticate-service.pomerium.svc.cluster.local"
|
value: "pomerium-authenticate-service.pomerium.svc.cluster.local"
|
||||||
- name: OVERIDE_CERTIFICATE_NAME
|
- name: OVERRIDE_CERTIFICATE_NAME
|
||||||
value: "*.corp.beyondperimeter.com"
|
value: "*.corp.beyondperimeter.com"
|
||||||
- name: SHARED_SECRET
|
- name: SHARED_SECRET
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|
|
@ -25,10 +25,10 @@ type Options struct {
|
||||||
// InternalAddr is the internal (behind the ingress) address to use when making an
|
// InternalAddr is the internal (behind the ingress) address to use when making an
|
||||||
// authentication connection. If empty, Addr is used.
|
// authentication connection. If empty, Addr is used.
|
||||||
InternalAddr string
|
InternalAddr string
|
||||||
// OverideCertificateName overrides the server name used to verify the hostname on the
|
// OverrideCertificateName overrides the server name used to verify the hostname on the
|
||||||
// returned certificates from the server. gRPC internals also use it to override the virtual
|
// returned certificates from the server. gRPC internals also use it to override the virtual
|
||||||
// hosting name if it is set.
|
// hosting name if it is set.
|
||||||
OverideCertificateName string
|
OverrideCertificateName string
|
||||||
// Shared secret is used to authenticate a authenticate-client with a authenticate-server.
|
// Shared secret is used to authenticate a authenticate-client with a authenticate-server.
|
||||||
SharedSecret string
|
SharedSecret string
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,13 +45,13 @@ func NewGRPC(opts *Options) (p Authenticator, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("OverideCertificateName", opts.OverideCertificateName).
|
Str("OverrideCertificateName", opts.OverrideCertificateName).
|
||||||
Str("addr", connAddr).Msgf("proxy/authenticator: grpc connection")
|
Str("addr", connAddr).Msgf("proxy/authenticator: grpc connection")
|
||||||
cert := credentials.NewTLS(&tls.Config{RootCAs: cp})
|
cert := credentials.NewTLS(&tls.Config{RootCAs: cp})
|
||||||
|
|
||||||
// overide allowed certificate name string, typically used when doing behind ingress connection
|
// override allowed certificate name string, typically used when doing behind ingress connection
|
||||||
if opts.OverideCertificateName != "" {
|
if opts.OverrideCertificateName != "" {
|
||||||
err = cert.OverrideServerName(opts.OverideCertificateName)
|
err = cert.OverrideServerName(opts.OverrideCertificateName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,7 +193,7 @@ func TestNewGRPC(t *testing.T) {
|
||||||
{"empty connection", &Options{Addr: "", SharedSecret: "shh"}, true, "proxy/authenticator: connection address required"},
|
{"empty connection", &Options{Addr: "", SharedSecret: "shh"}, true, "proxy/authenticator: connection address required"},
|
||||||
{"empty connections", &Options{Addr: "", InternalAddr: "", SharedSecret: "shh"}, true, "proxy/authenticator: connection address required"},
|
{"empty connections", &Options{Addr: "", InternalAddr: "", SharedSecret: "shh"}, true, "proxy/authenticator: connection address required"},
|
||||||
{"internal addr", &Options{Addr: "", InternalAddr: "intranet.local", SharedSecret: "shh"}, false, ""},
|
{"internal addr", &Options{Addr: "", InternalAddr: "intranet.local", SharedSecret: "shh"}, false, ""},
|
||||||
{"cert overide", &Options{Addr: "", InternalAddr: "intranet.local", OverideCertificateName: "*.local", SharedSecret: "shh"}, false, ""},
|
{"cert override", &Options{Addr: "", InternalAddr: "intranet.local", OverrideCertificateName: "*.local", SharedSecret: "shh"}, false, ""},
|
||||||
|
|
||||||
// {"addr and internal ", &Options{Addr: "localhost", InternalAddr: "local.localhost", SharedSecret: "shh"}, nil, true, ""},
|
// {"addr and internal ", &Options{Addr: "localhost", InternalAddr: "local.localhost", SharedSecret: "shh"}, nil, true, ""},
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ type Options struct {
|
||||||
// Authenticate service settings
|
// Authenticate service settings
|
||||||
AuthenticateURL *url.URL `envconfig:"AUTHENTICATE_SERVICE_URL"`
|
AuthenticateURL *url.URL `envconfig:"AUTHENTICATE_SERVICE_URL"`
|
||||||
AuthenticateInternalAddr string `envconfig:"AUTHENTICATE_INTERNAL_URL"`
|
AuthenticateInternalAddr string `envconfig:"AUTHENTICATE_INTERNAL_URL"`
|
||||||
OverideCertificateName string `envconfig:"OVERIDE_CERTIFICATE_NAME"`
|
OverrideCertificateName string `envconfig:"OVERRIDE_CERTIFICATE_NAME"`
|
||||||
AuthenticatePort int `envconfig:"AUTHENTICATE_SERVICE_PORT"`
|
AuthenticatePort int `envconfig:"AUTHENTICATE_SERVICE_PORT"`
|
||||||
|
|
||||||
// SigningKey is a base64 encoded private key used to add a JWT-signature to proxied requests.
|
// SigningKey is a base64 encoded private key used to add a JWT-signature to proxied requests.
|
||||||
|
@ -202,11 +202,11 @@ func New(opts *Options) (*Proxy, error) {
|
||||||
p.AuthenticateClient, err = authenticator.New(
|
p.AuthenticateClient, err = authenticator.New(
|
||||||
"grpc",
|
"grpc",
|
||||||
&authenticator.Options{
|
&authenticator.Options{
|
||||||
Addr: opts.AuthenticateURL.Host,
|
Addr: opts.AuthenticateURL.Host,
|
||||||
InternalAddr: opts.AuthenticateInternalAddr,
|
InternalAddr: opts.AuthenticateInternalAddr,
|
||||||
OverideCertificateName: opts.OverideCertificateName,
|
OverrideCertificateName: opts.OverrideCertificateName,
|
||||||
SharedSecret: opts.SharedKey,
|
SharedSecret: opts.SharedKey,
|
||||||
Port: opts.AuthenticatePort,
|
Port: opts.AuthenticatePort,
|
||||||
})
|
})
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue