Giter Club home page Giter Club logo

Comments (5)

esergion avatar esergion commented on June 26, 2024 1

Hey @jcoyne, thanks for the answer!
In this case to achieve some more security I would go with just a hostname, port and path, it should be quite enough to get info about any network issue.
Unfortunately there's no built in method to clear the uri for printing, so what about just pretty straightforward "patch" with concatenating these uri parts?
Something like this:

def clean_uri(uri)
  "#{uri.scheme}://#{uri.user && uri.password ? "REDACTED:REDACTED@" : ''}#{uri.hostname}#{uri.port ? ":#{uri.port}" : ''}#{uri.path}#{uri.query ? "?#{uri.query}" : ''}"
end

uri = URI.parse("http://username:[email protected]:8983/solr/admin/update?wt=json&q=test")
clean_uri(uri) # => "http://REDACTED:[email protected]:8983/solr/admin/update?wt=json&q=test"

uri = URI.parse("http://hostname.local:8983/solr/admin/update")
clean_uri(uri) # => "http://hostname.local:8983/solr/admin/update"

A bit ugly I know, but currently it's seriously compromises Solr credentials for a bunch of people when throws exception into Rollbar for example

from rsolr.

cgalarza avatar cgalarza commented on June 26, 2024 1

Great, I'll work on putting together a PR.

from rsolr.

jcoyne avatar jcoyne commented on June 26, 2024

@esergion how would you propose something like this is fixed?

It looks like the problem is here:

p = "\nURI: #{request[:uri].to_s}"

from rsolr.

cgalarza avatar cgalarza commented on June 26, 2024

Hello! I am running into this problem. Is there any issue with the approach described by @esergion or is it just a matter of submitting an PR? Thanks!

from rsolr.

jcoyne avatar jcoyne commented on June 26, 2024

I think we just need someone who wants to do that work.

from rsolr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.