Git Product home page Git Product logo

actix-web-httpauth's Introduction

actix-web-httpauth

Latest Version Latest Version dependency status Build Status Apache 2.0 OR MIT licensed

HTTP authentication schemes for actix-web framework.

NOTICE: This repository has been archived. Please visit https://github.com/actix/actix-extras instead.

Provides:

  • typed [Authorization] and [WWW-Authenticate] headers
  • [extractors] for an [Authorization] header
  • [middleware] for easier authorization checking

All supported schemas are actix Extractors, and can be used both in the middlewares and request handlers.

Supported schemes

actix-web-httpauth's People

Contributors

griff avatar jkilpatr avatar johntitor avatar qnighy avatar svartalf avatar tilpner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actix-web-httpauth's Issues

Own ServiceRequest in middleware

Hello!

I'm trying to use the middleware you've provided in a crate to implement OAuth2, and I've come to the realization I need access to the ServiceRequest in my validator_fn in order to set an extension. Since ServiceRequest is only borrowed, I can't move it into the future returned by the validator_fn.

You could enable this just by making validator_fn own the ServiceRequest and requiring that it return an IntoFuture<Item = ServiceRequest, ...>

Modifying request extensions inside process_fn

Hi,

I've seen, in issue #8, that the ServiceRequest ownership has been modified in a recent release to allow for modification of the request before re-sending as a future. In fact, the example provided by @asonix uses request.extensions_mut().insert(), which is what I'm trying to use.

However, in my case I get an error stating that there's no extensions_mut() method in ServiceRequest. For what I can see, only HttpRequest provides access to this method.

Could you shed some light as to whether it's possible to modify the request's extensions within the process function?

Thanks & regards,
Alfonso

1.0.0 actix-web support

The actix-web is getting close to 1.0.0 release and it had a major rework and made it way easier to use.

We'd like to adopt your crate for one of our services we are doing. Would you be willing to add support for it?

Migrating to actix-web 2.0

Hi @svartalf,

I was using this crate on a personal project that I'm trying to move to actix-web 2.0. Since I didn't want to reinvent the wheel (and probably don't have enough experience) I thought I'd try to migrate actix-web-httpauth to the new version.

After much trial and error I managed to get something that compiles (huge milestone for me), and it actually even works when used inside my (very basic) project!
(Note: The stress is in "trial and error"; you won't necessarily find best practices applied here.)

I didn't migrate the tests, and my project only uses Basic auth (not Bearer), so there might be issues lurking in there. In any case, I wanted to check if this initial "migration" would be of interest to you in order to kick-start the next "official" version of actix-web-httpauth, compatible with actix-web 2.0.

You can see my changes in this branch. If you think it's worth progressing, I could spend some more time on the tests and then create a PR.

Cheers,
Alfonso

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.