mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
docs(lambda): say blank LogGroup is deliberately read as not supplied (#3271)
* docs(lambda): say blank LogGroup is deliberately read as not supplied LogGroup carries a 1-512 length constraint, so an empty string is a length violation on paper, yet validateLogGroup exempts blank and applyLoggingConfig then falls back to the /aws/lambda/ default. That looked like the guard missing the minimum. It is a choice, not an oversight. botocore enforces the 1-character minimum client side, so an empty LogGroup never reaches the wire from an SDK caller and nobody has observed what the service answers to one. A 400 here would be inferred rather than measured, and rejecting a request we have never seen AWS reject is the expensive side of the trade; accepting it costs a caller nothing. Say that in the javadoc, and pin the leniency with a test so a later reader who wants the minimum enforced has to change the decision rather than just the guard. * test(lambda): pin the whitespace-only LogGroup case, not just the empty one The javadoc says blank means "empty or whitespace-only" and the guard is isBlank(), but the only test passed "". Narrowing isBlank() to isEmpty() left the suite green, so half the documented contract was unpinned. Adds the whitespace-only case. Verified load-bearing: with isEmpty() in place of isBlank() this test alone fails, and nothing else does.
This commit is contained in:
1 parent
b6080ea4ff
commit
27d2de0479
2 files changed
+49
No files matched your search
@@ -2266,6 +2266,16 @@ public class LambdaService implements ResourceProvider {
|
||||
/**
|
||||
* LogGroup is the one LoggingConfig member with a documented length and character
|
||||
* constraint rather than an enum: 1-512 characters, {@code [.\-_/#A-Za-z0-9]+}.
|
||||
*
|
||||
* <p>A blank LogGroup (empty or whitespace-only) is deliberately read as "not supplied"
|
||||
* rather than as a violation of that 1-character minimum, so {@link #applyLoggingConfig}
|
||||
* falls back to the {@code /aws/lambda/} default exactly as it does for an absent member.
|
||||
* The minimum is real in the service model, but botocore enforces it client side, so an
|
||||
* empty LogGroup never reaches the wire from an SDK caller and nobody has observed what
|
||||
* the service itself answers to one. Rejecting it here would be a 400 we inferred rather
|
||||
* than measured; accepting it costs a caller nothing. That leniency is pinned by
|
||||
* {@code LambdaVpcSnapStartLoggingIntegrationTest}, so a later reader who wants the
|
||||
* minimum enforced has to change the decision, not just the guard.
|
||||
*/
|
||||
private static void validateLogGroup(Object value) {
|
||||
if (!(value instanceof String group) || group.isBlank()) {
|
||||
|
||||
Reference in new issue
Block a user