Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for authentication? #1

Open
tharrington opened this issue Apr 9, 2016 · 5 comments
Open

support for authentication? #1

tharrington opened this issue Apr 9, 2016 · 5 comments

Comments

@tharrington
Copy link

Do you have authentication middleware support? Is it on your roadmap?

@colekettler
Copy link
Owner

@tharrington I hadn't considered it yet. Different applications can have pretty diverse authentication / authorization requirements, so it could be a bit out of scope for a scaffolding tool.

Did you have anything in particular in mind? I'm a little out of the loop on Python auth frameworks.

@tharrington
Copy link
Author

@colekettler some sort of decorator using HTTPAuth could be good

@tharrington
Copy link
Author

In either case, the build doesn't work for me... does this support pythong 3.5?

$ ./manage.py runserver
/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/flask_sqlalchemy/__init__.py:800: UserWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True to suppress this warning.
  warnings.warn('SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True to suppress this warning.')
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/flask_sqlalchemy/__init__.py:800: UserWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True to suppress this warning.
  warnings.warn('SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True to suppress this warning.')
 * Debugger is active!
Traceback (most recent call last):
  File "./manage.py", line 20, in <module>
    manager.run()
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/flask_script/__init__.py", line 412, in run
    result = self.handle(sys.argv[0], sys.argv[1:])
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/flask_script/__init__.py", line 383, in handle
    res = handle(*args, **config)
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/flask_script/commands.py", line 425, in __call__
    **self.server_options)
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/flask/app.py", line 772, in run
    run_simple(host, port, self, **options)
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/werkzeug/serving.py", line 633, in run_simple
    application = DebuggedApplication(application, use_evalex)
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/werkzeug/debug/__init__.py", line 249, in __init__
    if self.pin is None:
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/werkzeug/debug/__init__.py", line 259, in _get_pin
    self._pin, self._pin_cookie = get_pin_and_cookie_name(self.app)
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/werkzeug/debug/__init__.py", line 159, in get_pin_and_cookie_name
    get_machine_id(),
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/werkzeug/debug/__init__.py", line 94, in get_machine_id
    _machine_id = rv = _generate()
  File "/Users/tyler/Desktop/Projects/playground/flask-api/venv/lib/python3.5/site-packages/werkzeug/debug/__init__.py", line 70, in _generate
    match = re.match(r'"serial-number" = <([^>]+)', dump)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/re.py", line 163, in match
    return _compile(pattern, flags).match(string)
TypeError: <flask_script.commands.Server object at 0x10403f0b8>: cannot use a string pattern on a bytes-like object

@colekettler
Copy link
Owner

@tharrington Regarding the decorator: I'll evaluate that in the coming week. A generic decorator to restrict a given endpoint could be useful, as long as it's agnostic of the authorization scheme.

Regarding the error: huh, that's funny, it should run fine against 3.5. I'll test a sample API against a few versions of Python to see what's up. Hopefully there's nothing wrong with the underlying dependencies.

@colekettler
Copy link
Owner

@tharrington I haven't forgotten about your issue. I've been in the process of moving, but my schedule is stabilizing. I'll be investigating this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants