Git Product home page Git Product logo

Comments (11)

pciccarese avatar pciccarese commented on May 17, 2024 1

I am not 100% sure but I believe this is the problem with 2.2.0:
elastic/elasticsearch#14577

It might have been fixed in 2.3.0:
elastic/elasticsearch#16758

Although I am not completely sure yet.

from elasticsearch-readonlyrest-plugin.

pciccarese avatar pciccarese commented on May 17, 2024 1

I've tested the same codebase with 2.3.0 and the problem is gone. Which confirms that was the problem.

from elasticsearch-readonlyrest-plugin.

sscarduzio avatar sscarduzio commented on May 17, 2024

Interesting, no idea. I will try to put some printf and hopefully see what and why this happens. BTW, thanks Paolo for the features and insights you are contributing to this project!

from elasticsearch-readonlyrest-plugin.

sscarduzio avatar sscarduzio commented on May 17, 2024

Can't reproduce, mind sharing the conf file?

from elasticsearch-readonlyrest-plugin.

pciccarese avatar pciccarese commented on May 17, 2024

Sure (it includes aliases):

readonlyrest:
    enable: true
    response_if_req_forbidden: Sorry, your request is forbidden.
    access_control_aliases:

    - in: paolo
      out: [helloworld]

    access_control_rules:

    - name: Accept all requests from localhost
      type: allow
      hosts: [127.0.0.1]
      #indices: [paolo]

    - name: Accept only GETs from other host
      type: allow
      methods: [GET]
      indices: [translational]

from elasticsearch-readonlyrest-plugin.

sscarduzio avatar sscarduzio commented on May 17, 2024

Copied your conf exactly, sent a few requests to match both the blocks, my printf in the "IndicesRule.match" function prints just once.

The only thing I manage to print twice is if I add a printf in the upper part of the IndicesRule constructor, as it's called for every block.

from elasticsearch-readonlyrest-plugin.

pciccarese avatar pciccarese commented on May 17, 2024

It might be a regression on my side.

If (in IndexLevelActionFilter) I change this:

if (exitResult.isMatch() && exitResult.getBlock().getPolicy() == Block.Policy.ALLOW) {
      return true;
}

To:

if (exitResult.isMatch() && exitResult.getBlock().getPolicy() == Block.Policy.ALLOW) {
      logger.info("[readonlyrest] Request passed");
      return true;
}

The logger prints always twice.

UPDATE
I just checked out the latest from the repository, performed the change above, compile, deployed and I get the double print. I was hoping to pipeline different kind of elements but if this is the case I have some restrictions.

from elasticsearch-readonlyrest-plugin.

sscarduzio avatar sscarduzio commented on May 17, 2024

That would explain why I could not reproduce :)

from elasticsearch-readonlyrest-plugin.

pciccarese avatar pciccarese commented on May 17, 2024

If that is the case, what I was trying to implement will not be working the same for 2.2.0. Which is a little disappointing. @sscarduzio I will try to outline my game plan in the next few days to see if these are features you are interested in adding to the plugin. And we will go from there.

from elasticsearch-readonlyrest-plugin.

sscarduzio avatar sscarduzio commented on May 17, 2024

this 2.2.0 sounds like a really crappy release for readonly rest plugin. Not only your filter won't work, but all the filters will be inefficient and produce double logging. We could probably skip that build and have a warning in the docs about our reasons. Thoughts?

PS: Looking forward to seeing what you're up to, @pciccarese :)

from elasticsearch-readonlyrest-plugin.

sscarduzio avatar sscarduzio commented on May 17, 2024

Closing this as it's an ES bug. Thanks for investigating on this @pciccarese

from elasticsearch-readonlyrest-plugin.

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.