Skip to content

Commit 1cb21c7

Browse files
authored
fixes #117 update openapi-security.yml to add jwtCacheFullSize (#118)
1 parent f089d3d commit 1cb21c7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

rpc-router/src/main/resources/config/hybrid-security.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,20 @@ logJwtToken: ${hybrid-security.logJwtToken:true}
4242
logClientUserScope: ${hybrid-security.logClientUserScope:false}
4343

4444
# Enable JWT token cache to speed up verification. This will only verify expired time
45-
# and skip the signature verification as it takes more CPU power and long time.
45+
# and skip the signature verification as it takes more CPU power and a long time. If
46+
# each request has a different jwt token, like authorization code flow, this indicator
47+
# should be turned off. Otherwise, the cached jwt will only be removed after 15 minutes
48+
# and the cache can grow bigger if the number of requests is very high. This will cause
49+
# memory kill in a Kubernetes pod if the memory setting is limited.
4650
enableJwtCache: ${hybrid-security.enableJwtCache:true}
4751

52+
# If enableJwtCache is true, then an error message will be shown up in the log if the
53+
# cache size is bigger than the jwtCacheFullSize. This helps the developers to detect
54+
# cache problem if many distinct tokens flood the cache in a short period of time. If
55+
# you see JWT cache exceeds the size limit in logs, you need to turn off the enableJwtCache
56+
# or increase the cache full size to a bigger number from the default 100.
57+
jwtCacheFullSize: ${hybrid-security.jwtCacheFullSize:100}
58+
4859
# If you are using light-oauth2, then you don't need to have oauth subfolder for public
4960
# key certificate to verify JWT token, the key will be retrieved from key endpoint once
5061
# the first token is arrived. Default to false for dev environment without oauth2 server

0 commit comments

Comments
 (0)