authenticate: remove databroker dependency (#3820)

This commit is contained in:
Caleb Doxsey 2022-12-17 09:03:46 -07:00 committed by GitHub
parent c3b9adff20
commit 539fd51579
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 202 deletions

View file

@ -1,7 +1,6 @@
package authenticate
import (
"context"
"crypto/cipher"
"encoding/base64"
"fmt"
@ -16,13 +15,9 @@ import (
"github.com/pomerium/pomerium/internal/sessions/cookie"
"github.com/pomerium/pomerium/internal/urlutil"
"github.com/pomerium/pomerium/pkg/cryptutil"
"github.com/pomerium/pomerium/pkg/grpc"
"github.com/pomerium/pomerium/pkg/grpc/databroker"
"github.com/pomerium/pomerium/pkg/hpke"
)
var outboundGRPCConnection = new(grpc.CachedOutboundGRPClientConn)
type authenticateState struct {
redirectURL *url.URL
// sharedEncoder is the encoder to use to serialize data to be consumed
@ -44,8 +39,6 @@ type authenticateState struct {
hpkePrivateKey *hpke.PrivateKey
jwk *jose.JSONWebKeySet
dataBrokerClient databroker.DataBrokerServiceClient
}
func newAuthenticateState() *authenticateState {
@ -141,17 +134,5 @@ func newAuthenticateStateFromConfig(cfg *config.Config) (*authenticateState, err
state.hpkePrivateKey = hpke.DerivePrivateKey(sharedKey)
dataBrokerConn, err := outboundGRPCConnection.Get(context.Background(), &grpc.OutboundOptions{
OutboundPort: cfg.OutboundPort,
InstallationID: cfg.Options.InstallationID,
ServiceName: cfg.Options.Services,
SignedJWTKey: sharedKey,
})
if err != nil {
return nil, err
}
state.dataBrokerClient = databroker.NewDataBrokerServiceClient(dataBrokerConn)
return state, nil
}