Giter VIP home page Giter VIP logo

Comments (7)

jimmycuadra avatar jimmycuadra commented on August 21, 2024

Lita 4 (which will be out later this week) allows you to add Rack middleware to the built-in HTTP server. You'll be able to use that to add authentication.

from lita.

tfwright avatar tfwright commented on August 21, 2024

Cool, thanks.

from lita.

tfwright avatar tfwright commented on August 21, 2024

@jimmycuadra just checked out the middleware support in Lita 4. It looks like it only allows the config to specify a middleware class to use--I'm not very familiar with Rack but its built in basic auth middleware appears to require passing in a block to check the credentials as well. Any suggestions?

from lita.

jimmycuadra avatar jimmycuadra commented on August 21, 2024

Good catch! This was an oversight on my part. I will add the ability to specify arguments for middleware.

from lita.

jimmycuadra avatar jimmycuadra commented on August 21, 2024

Fixed in 9441947 and released in Lita 4.0.2.

from lita.

jimmycuadra avatar jimmycuadra commented on August 21, 2024

@tfwright The docs are also updated for config.http.middleware: http://docs.lita.io/getting-started/configuration/

In your specific case it would look like this:

Lita.configure do |config|
  config.http.middleware.use(Rack::Auth::Basic, "Realm") do |username, password|
    password == "secret"
  end
end

from lita.

tfwright avatar tfwright commented on August 21, 2024

Awesome. Thanks!

from lita.

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.