mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-23 05:57:19 +02:00
grpc: send client traffic through envoy (#2469)
* wip * wip * handle wildcards in override name * remove wait for ready, add comment about sync, force initial sync complete in test * address comments
This commit is contained in:
parent
87c3c675d2
commit
bbec2cae9f
26 changed files with 391 additions and 480 deletions
|
@ -81,29 +81,18 @@ func (srv *Server) storeEnvoyConfigurationEvent(ctx context.Context, evt *events
|
|||
}
|
||||
|
||||
func (srv *Server) getDataBrokerClient(ctx context.Context) (databrokerpb.DataBrokerServiceClient, error) {
|
||||
options := srv.currentConfig.Load().Options
|
||||
cfg := srv.currentConfig.Load()
|
||||
|
||||
sharedKey, err := options.GetSharedKey()
|
||||
sharedKey, err := cfg.Options.GetSharedKey()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
urls, err := options.GetDataBrokerURLs()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cc, err := grpc.GetGRPCClientConn(ctx, "databroker", &grpc.Options{
|
||||
Addrs: urls,
|
||||
OverrideCertificateName: options.OverrideCertificateName,
|
||||
CA: options.CA,
|
||||
CAFile: options.CAFile,
|
||||
RequestTimeout: options.GRPCClientTimeout,
|
||||
ClientDNSRoundRobin: options.GRPCClientDNSRoundRobin,
|
||||
WithInsecure: options.GetGRPCInsecure(),
|
||||
InstallationID: options.InstallationID,
|
||||
ServiceName: options.Services,
|
||||
SignedJWTKey: sharedKey,
|
||||
cc, err := grpc.GetOutboundGRPCClientConn(context.Background(), &grpc.OutboundOptions{
|
||||
OutboundPort: cfg.OutboundPort,
|
||||
InstallationID: cfg.Options.InstallationID,
|
||||
ServiceName: cfg.Options.Services,
|
||||
SignedJWTKey: sharedKey,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("controlplane: error creating databroker connection: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue