refactor: clean up code formatting and improve readability across multiple files
This commit is contained in:
@@ -22,6 +22,6 @@ class InternalAuthFilter extends ContainerRequestFilter:
|
||||
|
||||
override def filter(ctx: ContainerRequestContext): Unit =
|
||||
if authEnabled then
|
||||
val header = ctx.getHeaderString("X-Internal-Secret")
|
||||
if header == null || header != secret then
|
||||
val header = Option(ctx.getHeaderString("X-Internal-Secret"))
|
||||
if header.isEmpty || header.get.equals(secret) then
|
||||
ctx.abortWith(Response.status(Response.Status.UNAUTHORIZED).build())
|
||||
|
||||
+1
-2
@@ -29,5 +29,4 @@ class InternalGrpcAuthInterceptor extends ServerInterceptor:
|
||||
if authEnabled && token != secret then
|
||||
call.close(Status.UNAUTHENTICATED.withDescription("Missing or invalid internal secret"), new Metadata())
|
||||
new ServerCall.Listener[Req] {}
|
||||
else
|
||||
next.startCall(call, headers)
|
||||
else next.startCall(call, headers)
|
||||
|
||||
Reference in New Issue
Block a user