[ 
https://issues.apache.org/jira/browse/THRIFT-6109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmytro Shteflyuk updated THRIFT-6109:
-------------------------------------
    Description: 
h3. Problem

{{Thrift::HTTPClientTransport#to_s}} returns the literal string 
{{@\{self.url\}}} rather than a useful description of the configured endpoint. 
The interpolation is malformed, so diagnostic output does not identify the 
destination.

h3. Client impact

Applications commonly include transports in logs, exceptions, and debugging 
output. The current label makes it difficult to determine which endpoint a Ruby 
client is using. A useful replacement must identify whether the transport uses 
HTTP or HTTPS, without exposing URL userinfo or query parameters in those 
diagnostic paths.

h3. Reproduction

{code:ruby}
transport = Thrift::HTTPClientTransport.new(
  "https://user:[email protected]/path/to/service?token=secret";
)

puts transport
# current:  "@{self.url}"
# desired:  "https(my.domain.com:443/path/to/service)"
{code}

h3. Expected behavior

{{to_s}} should return a readable endpoint label containing the URL scheme, 
host, port, and path. It must omit userinfo and query parameters.

  was:
h3. Problem

{{Thrift::HTTPClientTransport#to_s}} returns the literal string {{@{self.url}}} 
rather than a useful description of the configured endpoint. The interpolation 
is malformed, so diagnostic output does not identify the destination.

h3. Client impact

Applications commonly include transports in logs, exceptions, and debugging 
output. The current label makes it difficult to determine which endpoint a Ruby 
client is using. A useful replacement must identify whether the transport uses 
HTTP or HTTPS, without exposing URL userinfo or query parameters in those 
diagnostic paths.

h3. Reproduction

{code:ruby}
transport = Thrift::HTTPClientTransport.new(
  "https://user:[email protected]/path/to/service?token=secret";
)

puts transport
# current:  "@{self.url}"
# desired:  "https(my.domain.com:443/path/to/service)"
{code}

h3. Expected behavior

{{to_s}} should return a readable endpoint label containing the URL scheme, 
host, port, and path. It must omit userinfo and query parameters.


> Ruby HTTP client transport should provide a safe endpoint label
> ---------------------------------------------------------------
>
>                 Key: THRIFT-6109
>                 URL: https://issues.apache.org/jira/browse/THRIFT-6109
>             Project: Thrift
>          Issue Type: Bug
>          Components: Ruby - Library
>            Reporter: Dmytro Shteflyuk
>            Assignee: Dmytro Shteflyuk
>            Priority: Major
>
> h3. Problem
> {{Thrift::HTTPClientTransport#to_s}} returns the literal string 
> {{@\{self.url\}}} rather than a useful description of the configured 
> endpoint. The interpolation is malformed, so diagnostic output does not 
> identify the destination.
> h3. Client impact
> Applications commonly include transports in logs, exceptions, and debugging 
> output. The current label makes it difficult to determine which endpoint a 
> Ruby client is using. A useful replacement must identify whether the 
> transport uses HTTP or HTTPS, without exposing URL userinfo or query 
> parameters in those diagnostic paths.
> h3. Reproduction
> {code:ruby}
> transport = Thrift::HTTPClientTransport.new(
>   "https://user:[email protected]/path/to/service?token=secret";
> )
> puts transport
> # current:  "@{self.url}"
> # desired:  "https(my.domain.com:443/path/to/service)"
> {code}
> h3. Expected behavior
> {{to_s}} should return a readable endpoint label containing the URL scheme, 
> host, port, and path. It must omit userinfo and query parameters.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to