@@ -89,7 +89,9 @@ func NewOpenTDFServer(config Config, d *db.Client) (*OpenTDFServer, error) {
8989
9090 // Add authN interceptor
9191 // TODO Remove this conditional once we move to the hardening phase (https://github.com/opentdf/platform/issues/381)
92- if config .Auth .DeprecatedEnabled {
92+ if config .Auth .DeprecatedDisabled {
93+ slog .Error ("disabling authentication. this is deprecated and will be removed. if you are using an IdP without DPoP you can use `allowNoDPoP`" )
94+ } else {
9395 slog .Info ("authentication enabled" )
9496 authN , err = auth .NewAuthenticator (
9597 context .Background (),
@@ -99,8 +101,6 @@ func NewOpenTDFServer(config Config, d *db.Client) (*OpenTDFServer, error) {
99101 if err != nil {
100102 return nil , fmt .Errorf ("failed to create authentication interceptor: %w" , err )
101103 }
102- } else {
103- slog .Error ("disabling authentication. this is deprecated and will be removed. if you are using an IdP without DPoP you can use `allowNoDPoP`" )
104104 }
105105
106106 // Try an register oidc issuer to wellknown service but don't return an error if it fails
@@ -162,10 +162,10 @@ func newHttpServer(c Config, h http.Handler, a *auth.Authentication, g *grpc.Ser
162162
163163 // Add authN interceptor
164164 // TODO check if this is needed or if it is handled by gRPC
165- if c .Auth .DeprecatedEnabled {
166- h = a .MuxHandler (h )
167- } else {
165+ if c .Auth .DeprecatedDisabled {
168166 slog .Error ("disabling authentication. this is deprecated and will be removed. if you are using an IdP without DPoP you can use `allowNoDPoP`" )
167+ } else {
168+ h = a .MuxHandler (h )
169169 }
170170
171171 // Add CORS // TODO We need to make cors configurable (https://github.com/opentdf/platform/issues/305)
@@ -222,7 +222,11 @@ func newGrpcServer(c Config, a *auth.Authentication) (*grpc.Server, error) {
222222 slog .Warn ("failed to create proto validator" , slog .String ("error" , err .Error ()))
223223 }
224224
225- i = append (i , a .UnaryServerInterceptor )
225+ if c .Auth .DeprecatedDisabled {
226+ slog .Error ("disabling authentication. this is deprecated and will be removed. if you are using an IdP without DPoP you can use `allowNoDpop`" )
227+ } else {
228+ i = append (i , a .UnaryServerInterceptor )
229+ }
226230
227231 // Add tls creds if tls is not nil
228232 if c .TLS .Enabled {
0 commit comments