pallets-eco / flask-jwt

JWT (JSON Web Tokens) for Flask applications
MIT License
564 stars 177 forks source link

New release #38

Closed mr337 closed 9 years ago

mr337 commented 9 years ago

Hi,

Wondering what is the plan on a new release on pypi? There have been some code changes that would be useful to get.

Thx!

patrickjahns commented 9 years ago

You can always install from git - what`s the issue with that?

mr337 commented 9 years ago

Yeah I know, but it would be nice to pull from pypi. The fact that the release and HEAD are a little outdated and missing useful things like generate_token can be frustrating.

astyfx commented 9 years ago

+1

sureshjoshi commented 9 years ago

+1

Also, for anyone googling, here is whats in my requirements.txt: -e git+https://github.com/mattupstate/flask-jwt.git#egg=flask-jwt

fernandojsg commented 9 years ago

+1

f0t0n commented 9 years ago

Could you please release the latest stable version on PyPI? I want to auto-renew and issue new fresh token for client on request. I would use generate_token function imported from flask_jwt but it's not on PyPI yet.

So that for now in my Flask-Restful appliction I have to use dirty workaround like listed below:

from flask import current_app
from flask_jwt import current_user
from flask_restful import Resource

def generate_token(user):
    """ Currently this is workaround
    since the latest version that already has this function
    is not published on PyPI yet and we don't want
    to install the package directly from GitHub.
    See: https://github.com/mattupstate/flask-jwt/blob/9f4f3bc8dce9da5dd8a567dfada0854e0cf656ae/flask_jwt/__init__.py#L145
    """
    jwt = current_app.extensions['jwt']
    payload = jwt.payload_callback(user)
    token = jwt.encode_callback(payload)
    return token

class BaseResource(Resource):
    def dispatch_request(self, *args, **kwargs):
        response = super(BaseResource, self).dispatch_request(*args, **kwargs)
        if current_user:
            response[2]['Fresh-Token'] = generate_token(current_user)
        return response
mr337 commented 9 years ago

+1 still :(

mattupstate commented 9 years ago

I've made a few improvements, but have yet to receive much feedback from users. See pull #51

arcivanov commented 9 years ago

The #51 seems to be essential with migration to JWT and default handlers. Is it possible to release this ASAP at least as beta or a dev version?

In general it's unclear why such a long non-agile release cycle would be at all desired.

svenstaro commented 9 years ago

Looks like this could be closed?

f0t0n commented 9 years ago

But #51 is not live yet. :/