mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 15:49:33 -05:00
With floci.protocols.strict-claiming off, the default, a request that no wire protocol claims is logged and served by whatever route it matches. The checks after routing read the claim, so they saw a request of no protocol: - IAM enforcement served it unsigned. The MissingAuthenticationToken refusal applies only to a JSON, CBOR or Query claim. An unsigned SQS ListQueues over JSON or Query, or a Kinesis ListStreams over CBOR, was served when it carried a Smithy-Protocol header Floci does not serve that path by: an unknown value, or rpc-v2-cbor outside the rpcv2 path. An X-Amz-Target call with no Content-Type reached the CBOR endpoint the same way. - IAM enforcement checked a signed REST request as the action its X-Amz-Target header named, not its route's. A user allowed only s3:GetObject deleted an object by sending the DELETE with X-Amz-Target: AmazonS3.GetObject and any Smithy-Protocol header. A signed JSON call it refused got the REST status, 403, rather than JSON's 400 AccessDeniedException. - A call to a disabled service was served when only its claim would have named the service, as for an unsigned JSON or rpcv2 call. - A REST JSON service request that fell through to S3's wildcard routes was not rejected, and a REST request signed for a service Floci lacks skipped the guard that refuses it before routing, so S3's routes answered it with a misleading error. The new AwsRouteClaimFilter runs after route matching and before every filter that reads the claim, AccountContextFilter's unknown-Region refusal and the signature check among them. It claims such a request by the route it reached, through ProtocolClaimer.routeClaim: - the JSON 1.0, JSON 1.1 and CBOR endpoints by X-Amz-Target; - the rpcv2 route by its path; - the Query endpoint's POST by the form; - every other route as REST. Those routes serve the request the same way whatever Smithy-Protocol header it carries, so the claim names the call that runs. A request claimed as REST also gets the unknown-service-scope check a claimed one gets before routing, which AwsProtocolClaimFilter now exposes for it. A claimed request is left as it was, and strict claiming still rejects an unclaimed one before routing. An X-Amz-Target post with a content type no protocol uses, the third kind of request the strict-claiming docs list, matches no route at all, and got a 500 rather than its 415, as any root POST in a content type no endpoint consumes did. Several resource methods share POST /, so RESTEasy Reactive routes it to a placeholder with no method of its own that picks one by content type, and answers 415 from there when none consumes it. The ResourceInfo producer then returns the placeholder's missing method, and CDI refuses the null with IllegalProductException. AwsRestJsonErrorHeaderFilter and S3CorsFilter read ResourceInfo on every response, so each failed on it. Both now read it through the new RoutedResource, which gives null when routing chose no method. docs/services/iam.md and the strict-claiming setting's docs say how such a request is handled. IamEnforcementFilter builds its rpcv2 route claim through the same ProtocolClaimer helper.