mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 16:59:22 +02:00
authenticate: remove databroker dependency (#3820)
This commit is contained in:
parent
c3b9adff20
commit
539fd51579
4 changed files with 14 additions and 202 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue