Python werkzeug.security.gen_salt() Examples
The following are 23
code examples of werkzeug.security.gen_salt().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
werkzeug.security
, or try the search function
.
Example #1
Source File: resources.py From flask-restplus-server-example with MIT License | 6 votes |
def post(self, args): """ Create a new OAuth2 Client. Essentially, OAuth2 Client is a ``client_id`` and ``client_secret`` pair associated with a user. """ with api.commit_or_abort( db.session, default_error_message="Failed to create a new OAuth2 client." ): # TODO: reconsider using gen_salt new_oauth2_client = OAuth2Client( user_id=current_user.id, client_id=security.gen_salt(40), client_secret=security.gen_salt(50), **args ) db.session.add(new_oauth2_client) return new_oauth2_client
Example #2
Source File: __init__.py From Flask-P2P with MIT License | 6 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = dict self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20)
Example #3
Source File: __init__.py From appengine-try-python-flask with Apache License 2.0 | 6 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = dict self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20)
Example #4
Source File: __init__.py From arithmancer with Apache License 2.0 | 6 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = dict self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20)
Example #5
Source File: __init__.py From cloud-playground with Apache License 2.0 | 6 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = dict self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20)
Example #6
Source File: __init__.py From PhonePi_SampleServer with MIT License | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger PIN disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger PIN: %s' % self.pin) else: self.pin = None
Example #7
Source File: __init__.py From Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda with MIT License | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger PIN disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger PIN: %s' % self.pin) else: self.pin = None
Example #8
Source File: __init__.py From android_universal with MIT License | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger PIN disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger PIN: %s' % self.pin) else: self.pin = None
Example #9
Source File: __init__.py From data with GNU General Public License v3.0 | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger pin disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger pin code: %s' % self.pin) else: self.pin = None
Example #10
Source File: __init__.py From data with GNU General Public License v3.0 | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger pin disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger pin code: %s' % self.pin) else: self.pin = None
Example #11
Source File: __init__.py From data with GNU General Public License v3.0 | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger pin disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger pin code: %s' % self.pin) else: self.pin = None
Example #12
Source File: __init__.py From data with GNU General Public License v3.0 | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger pin disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger pin code: %s' % self.pin) else: self.pin = None
Example #13
Source File: __init__.py From data with GNU General Public License v3.0 | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger pin disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger pin code: %s' % self.pin) else: self.pin = None
Example #14
Source File: __init__.py From syntheticmass with Apache License 2.0 | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger pin disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger pin code: %s' % self.pin) else: self.pin = None
Example #15
Source File: __init__.py From jbox with MIT License | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger pin disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger pin code: %s' % self.pin) else: self.pin = None
Example #16
Source File: views.py From BhagavadGita with GNU General Public License v3.0 | 5 votes |
def create_app(): badge_list = [] form = CreateAppForm() if form.validate_on_submit(): app = App( application_id=gen_salt(10), application_name=form.application_name.data, application_description=form.application_description.data, application_website=form.application_website.data, user_id=current_user.id) db.session.add(app) db.session.flush() item = Client( client_id=gen_salt(40), client_secret=gen_salt(50), _default_scopes='verse chapter', user_id=current_user.id, app_id=app.application_id) db.session.add(item) db.session.commit() send_email( recipient=current_user.email, subject='Application Successfully Registered', template='account/email/confirm_app', user=current_user._get_current_object(), app_name=form.application_name.data) flash('You application has been created.', 'success') return redirect( url_for('account.update_app', application_id=app.application_id)) return render_template( 'account/create_app.html', user=current_user._get_current_object(), form=form, badge_list=badge_list)
Example #17
Source File: __init__.py From pyRevit with GNU General Public License v3.0 | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger PIN disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger PIN: %s' % self.pin) else: self.pin = None
Example #18
Source File: auth.py From huskar with MIT License | 5 votes |
def ensure(self): user = (User.get_by_name(self.name) or User.get_by_email(self.email)) if user is None: password = gen_salt(30) user = User.create_normal( self.name, password, self.email, is_active=True) deliver_email(EmailTemplate.SIGNUP, user.email, { 'username': user.username, 'password': password, }) return user
Example #19
Source File: user.py From huskar with MIT License | 5 votes |
def post(self): """Creates a new user with your site admin authority. We will send you an email of random password if don't specify password explicitly. :form username: The username of new user. :form password: The optional password of new user. :form email: The email of new user. :<header Authorization: Huskar Token (See :ref:`token`) :status 400: The username is used or the format is invalid. :status 200: The new user is created successfully. """ g.auth.require_admin('only admin can add users') username = request.form['username'].strip() password = request.form.get('password', gen_salt(30)) is_generated_password = 'password' not in request.form email = request.form['email'].strip() validate_fields(user_schema, {'username': username, 'email': email}) user = User.get_by_name(username) if user: abort(400, u'{0} is used username'.format(username)) try: user = User.create_normal(username, password, email, is_active=True) except NameOccupiedError: abort(400, u'User %s has been archived' % username) audit_log.emit(audit_log.types.CREATE_USER, user=user) if is_generated_password: deliver_email(EmailTemplate.SIGNUP, user.email, { 'username': user.username, 'password': password, }) return api_response()
Example #20
Source File: __init__.py From planespotter with MIT License | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger PIN disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger PIN: %s' % self.pin) else: self.pin = None
Example #21
Source File: __init__.py From Financial-Portfolio-Flask with MIT License | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger pin disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger pin code: %s' % self.pin) else: self.pin = None
Example #22
Source File: __init__.py From RSSNewsGAE with Apache License 2.0 | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger PIN disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger PIN: %s' % self.pin) else: self.pin = None
Example #23
Source File: __init__.py From lambda-packs with MIT License | 5 votes |
def __init__(self, app, evalex=False, request_key='werkzeug.request', console_path='/console', console_init_func=None, show_hidden_frames=False, lodgeit_url=None, pin_security=True, pin_logging=True): if lodgeit_url is not None: from warnings import warn warn(DeprecationWarning('Werkzeug now pastes into gists.')) if not console_init_func: console_init_func = None self.app = app self.evalex = evalex self.frames = {} self.tracebacks = {} self.request_key = request_key self.console_path = console_path self.console_init_func = console_init_func self.show_hidden_frames = show_hidden_frames self.secret = gen_salt(20) self._failed_pin_auth = 0 self.pin_logging = pin_logging if pin_security: # Print out the pin for the debugger on standard out. if os.environ.get('WERKZEUG_RUN_MAIN') == 'true' and \ pin_logging: _log('warning', ' * Debugger is active!') if self.pin is None: _log('warning', ' * Debugger PIN disabled. ' 'DEBUGGER UNSECURED!') else: _log('info', ' * Debugger PIN: %s' % self.pin) else: self.pin = None