Repository navigation
fix: handle uaa rate limit response when status is disabled #1414 - #1415
Lokowandtg wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Thanks for the fix @Lokowandtg, the @Nullable change looks right nd good to me and matches what UAA sends when rate limiting is disabled.
The red integration test isn't caused by this PR. It's the FeatureFlagsV3Test cleanup blocking a Netty thread for 5 minutes, which then breaks the app push in AdminTest. That's fixed in 5.x.x, and I opened #1416 to bring it to main. Once that's merged, could you rebase on main so CI runs again?
Two things outside and optimization potential:
-
A unit test for the parsing. There's no ReactorRatelimitTest yet. Something along the lines of the other AbstractUaaApiTest tests with two fixtures would be enough, one for the DISABLED response from #1414 (
{"current":{"status":"DISABLED","asOf":"..."}}) and one for ACTIVE with all fields set. -
UaaRatelimitTest can't fail at the moment. onErrorResume turns every error into false, and materialize() + expectNextCount(1) also passes on an error signal. That's why it didn't catch #1414 in the first place. Can you drop both and assert on the actual status? While you're there, getCurrentData() can be null, so it would be good to check that before calling getStatus().
| * The number of configured limiter mappings | ||
| */ | ||
| @JsonProperty("limiterMappings") | ||
| @Nullable |
There was a problem hiding this comment.
Could you mention in the Javadoc that this can be null now? Same for credentialIdExtractor and loggingLevel. UAA also leaves out limiterMappings when it's ACTIVE with 0 mappings, so someone doing int n = current.getLimiterMappings() will get an NPE.
| */ | ||
| @JsonProperty("loggingLevel") | ||
| @Nullable | ||
| abstract String getLoggingLevel(); |
There was a problem hiding this comment.
Not needed for this PR, but maybe worth a follow-up: UAA also sends an "error" field in current when loading the rate limit config failed. We don't map it right now, so callers can't see why rate limiting is off. Happy to open an issue for that if you don't want to add it here.
The optional fields are now marked as "nullable".