L. C. Hsieh created SPARK-61424:
-----------------------------------

             Summary: Fail to connect on metadata that cannot be a gRPC header 
instead of dropping it
                 Key: SPARK-61424
                 URL: https://issues.apache.org/jira/browse/SPARK-61424
             Project: Spark
          Issue Type: Bug
          Components: Connect
    Affects Versions: connect-rust-4.3.0
            Reporter: L. C. Hsieh


SparkConnectClient attaches the user agent, the metadata parameters of the 
connection string and the Authorization: Bearer header of the token to every 
request. A key or value that tonic cannot parse as a header is skipped without 
any signal, in both _attach_metadata and execution_metadata.

For example, sc://host/;token=abc%0A yields a header value with a line feed. 
The requests then go out with no authorization header, and the caller only sees 
UNAUTHENTICATED from the server.

The reference client reports these on the client side: grpc-python raises 
ValueError("metadata was invalid: ...") for an invalid metadata key or value, 
TypeError for a str value of a -bin key, and fails the call with UNAVAILABLE 
"Illegal metadata" for a token that is not a header value.

SparkConnectClient::connect should validate the headers once and return the 
corresponding error, without the token or a metadata value in its message.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to