Coder Social home page Coder Social logo

flask-indieauth's Introduction

flask-indieauth's People

Contributors

ludovicchabant avatar martymcguire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flask-indieauth's Issues

Use abort() instead of Response() for access errors

The deny() function in flask_indieauth returns a Response() object with an error message. While this does ensure the user sees an error message if they are not authenticated, I could not easily customise the response object. I recommend replacing Response() with abort(ERROR_CODE), a function that would give me control over the error response on my end.

I have downloaded the library file to my project directory and replaced the deny() function with this:

def deny(reason):
    """Sends a 400 response because token is missing or bad"""
    return abort(400)

I'd like to see this as a feature of the library itself.

Allow session authentication with the @requires_indieauth decorator

The @requires_indieauth decorator does not currently support reading access tokens from session storage. I was wondering if this is something you had considered adding to the Flask-IndieAuth extension at some point.

I am not as aware of the security ramifications of such an implementation. But, I would love to start a discussion around whether Flask-IndieAuth could add a rule that lets one authenticate if session["access_token"] is present. This would let someone view any web resource (i.e. a HTML page or a JSON file) in their browser using the Flask-IndieAuth extension.

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.