mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-19 14:12:52 +00:00
01fe34a526
# Which Problems Are Solved Opaque tokens now use authenticated encryption. # How the Problems Are Solved - Upgrade zitadel/oidc to v3.47 - Copy crypto implementation for refresh and session tokens (internal to zitadel) - Added config that allows validating old tokens for gradual roll-out # Additional Changes - Set NX cache for `integration-test-build` to `false`, working on a seperate fix. # Additional Context - closes #11315 --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: muhlemmer <[email protected]>
71 lines
1.7 KiB
Go
71 lines
1.7 KiB
Go
package oidc
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"connectrpc.com/connect"
|
|
"google.golang.org/protobuf/reflect/protoreflect"
|
|
|
|
"github.com/zitadel/zitadel/internal/api/authz"
|
|
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
|
"github.com/zitadel/zitadel/internal/api/oidc"
|
|
"github.com/zitadel/zitadel/internal/command"
|
|
"github.com/zitadel/zitadel/internal/crypto"
|
|
"github.com/zitadel/zitadel/internal/query"
|
|
oidc_pb "github.com/zitadel/zitadel/pkg/grpc/oidc/v2"
|
|
"github.com/zitadel/zitadel/pkg/grpc/oidc/v2/oidcconnect"
|
|
)
|
|
|
|
var _ oidcconnect.OIDCServiceHandler = (*Server)(nil)
|
|
|
|
type Server struct {
|
|
command *command.Commands
|
|
query *query.Queries
|
|
|
|
op *oidc.Server
|
|
externalSecure bool
|
|
authAlg crypto.AuthAlgorithm
|
|
}
|
|
|
|
type Config struct{}
|
|
|
|
func CreateServer(
|
|
command *command.Commands,
|
|
query *query.Queries,
|
|
op *oidc.Server,
|
|
externalSecure bool,
|
|
authAlg crypto.AuthAlgorithm,
|
|
) *Server {
|
|
return &Server{
|
|
command: command,
|
|
query: query,
|
|
op: op,
|
|
externalSecure: externalSecure,
|
|
authAlg: authAlg,
|
|
}
|
|
}
|
|
|
|
func (s *Server) RegisterConnectServer(interceptors ...connect.Interceptor) (string, http.Handler) {
|
|
return oidcconnect.NewOIDCServiceHandler(s, connect.WithInterceptors(interceptors...))
|
|
}
|
|
|
|
func (s *Server) FileDescriptor() protoreflect.FileDescriptor {
|
|
return oidc_pb.File_zitadel_oidc_v2_oidc_service_proto
|
|
}
|
|
|
|
func (s *Server) AppName() string {
|
|
return oidc_pb.OIDCService_ServiceDesc.ServiceName
|
|
}
|
|
|
|
func (s *Server) MethodPrefix() string {
|
|
return oidc_pb.OIDCService_ServiceDesc.ServiceName
|
|
}
|
|
|
|
func (s *Server) AuthMethods() authz.MethodMapping {
|
|
return oidc_pb.OIDCService_AuthMethods
|
|
}
|
|
|
|
func (s *Server) RegisterGateway() server.RegisterGatewayFunc {
|
|
return oidc_pb.RegisterOIDCServiceHandler
|
|
}
|