File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/main/kotlin/org/exploit/keeper/filter Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,13 @@ import jakarta.ws.rs.container.ContainerRequestContext
7
7
import jakarta.ws.rs.container.ContainerRequestFilter
8
8
import jakarta.ws.rs.ext.Provider
9
9
import org.exploit.keeper.api.auth.KeeperAuthenticator
10
+ import org.exploit.keeper.config.KeeperConfig
10
11
import org.exploit.keeper.service.client.BitKeeperClients
11
12
12
13
@Provider
13
14
@Priority(Priorities .AUTHENTICATION )
14
15
class KeeperAuthFilter (
16
+ private val config : KeeperConfig ,
15
17
private val clients : BitKeeperClients
16
18
) : ContainerRequestFilter {
17
19
@@ -21,6 +23,9 @@ class KeeperAuthFilter(
21
23
if (path.startsWith(" /v1/keeper" ))
22
24
return
23
25
26
+ if (config.auth().allowAnonymous())
27
+ return
28
+
24
29
val instanceId = p0.getHeaderString(KeeperAuthenticator .HEADER_INSTANCE_ID )
25
30
?.toIntOrNull()
26
31
? : throw NotAuthorizedException (" Invalid instance id" )
You can’t perform that action at this time.
0 commit comments