summaryrefslogtreecommitdiffstats
path: root/deluge/ui/web/auth.py
Commit message (Collapse)AuthorAge
* Upgrade codebase with pyupgrade (>=py3.6)DjLegolas2021-12-29
| | | | | | | | Added pyupgrade utility with manual stage to pre-commit and run on all files. Ref: https://github.com/asottile/pyupgrade Closes: deluge-torrent/deluge#326
* Remove all Python 2 supportdeluge-2.1.0.dev0DjLegolas2021-12-28
| | | | | | | | | * Removed all __future__ imports from code * Removed all six dependencies * Removed all future_builtins imports * Removed all Python 2 related code Closes: deluge-torrent/deluge#325
* [Lint] Fix spelling mistakesCalum Lind2021-09-21
| | | | | | | A quick fix of some of the mistakes caught by codespell. Updated readme with new IRC server Useful to add it as part of linting checks.
* [Web] Fix unable to change passwordCalum Lind2019-06-11
| | | | | | | | | The hashlib update method requires bytes and raised a TypeError for salt passed as text. Added a test for auth change_password Fixes: #3262
* [WebUI] Fixes for login auth on Python 3Calum Lind2018-10-10
| | | | Remove obsolete password check code.
* [Lint] Use Black to auto-format codeCalum Lind2018-10-03
| | | | | | | | | | | | | | | | | The move to using auto-formatter makes it easier to read, submit and speeds up development time. https://github.com/ambv/black/ Although I would prefer 79 chars, the default line length of 88 chars used by black suffices. The flake8 line length remains at 120 chars since black does not touch comments or docstrings and this will require another round of fixes. The only black setting that is not standard is the use of double-quotes for strings so disabled any formatting of these. Note however that flake8 will still flag usage of double-quotes. I may change my mind on double vs single quotes but for now leave them. A new pyproject.toml file has been created for black configuration.
* [Py2to3] Fix opening torrent files in byte modeCalum Lind2018-09-14
|
* [Py2to3] Replace deprecated base64.(de|en)codestringCalum Lind2018-06-26
| | | | | | * In Py3 base64.encodestring is deprecated so rather than use the Py3 only encodebytes instead use b64encode. The other advantage is that with issue a consistent TypeError is raised that we can catch.
* Fix files to pass new Flake8 checkersCalum Lind2018-06-01
| | | | | | | | | | | Some new flake8 checkers were added so fix these new warnings and any issues uncovered. Use add-trailing-comma to fix missing trailing commas. It does not format it as well as I would like however it was fast to change and helps with git changes in future. Removed pylint from tox due to large number of warnings.
* [WebUI] Refactor out AuthError for NotAuthorizedErrorCalum Lind2017-06-23
|
* [UI] Refactor duplicated code out of connection managersCalum Lind2017-06-07
|
* Replace/remove usage of dict.keys()Calum Lind2017-03-16
|
* [Py2to3] Large set of changes for Python 3 compatCalum Lind2017-03-16
| | | | | | | | | | | | - Preparation work for using six or future module for Py2/3 compat. The code will be written in Python 3 with Python 2 fallbacks. - Added some Py3 imports with Py2 fallbacks to make it easier to remove Py2 code in future. - Replace xrange with range (sort out import as top of files in future). - Workaround Py2to3 basestring issue with inline if in instances. This means every usage of basestring is more considered. - Replace iteritems and itervalues for items and values. There might be a performance penalty on Py2 so might need to revisit this change.
* [Py2to3] Refactor out usage of unicode and basestringCalum Lind2017-02-23
| | | | | | | | | | - Python 3 renames `unicode` type to `str` and introduces `bytes` type. - Python 2.7 has `bytes` but is only an alias for `str` so restricted to comparisons but helps keep compatibility. - To test for unicode string on Py2 and Py3 uses the "''.__class__" type. - Remove usage of utf8encode and just encode, problems with bytes being passed in code will be picked up faster. - Where possible refactor out isinstance for try..except duck-typing.
* [WebUI] Markup byte strings for twisted requestCalum Lind2017-02-22
|
* [Py2to3] Force unicode_literals and fix related issuesCalum Lind2017-02-22
| | | | | | | | | | | | | | | | | | * Added `from __future__ import unicode_literals` to every file so now all strings in code are forced to be unicode strings unless marked as byte string `b'str'` or encoded to byte string `'str'.encode('utf-8')`. This is a large change but we have been working towards the goal of unicode strings passed in the code so decoding external input and encoding output as byte strings (where applicable). Note that in Python 2 the `str` type still refers to byte strings. * Replaced the use of `str` for `basestring` in isinstance comparison as this was the original intention but breaks code when encoutering unicode strings. * Marked byte strings in gtkui as the conversion to utf8 is not always handled, mostly related to gobject signal names.
* [WebUI] Log successful logins with associated ipCalum Lind2017-02-20
|
* [Docs] Fix example and param notation in reST docstringsCalum Lind2016-11-17
| | | | * For future parsing into other docstring styles.
* [Lint] Convert all python double quotes to single quotesCalum Lind2016-11-03
| | | | | | | | | | | | | | | | | | * A rather disruptive change but for a few reasons such as easier to read, easier type, keep consistent and javascript code uses single quotes. * There are a few exceptions for the automated process: * Any double quotes in comments * Triple double quotes for docstrings * Strings containing single quotes are left e.g. "they're" * To deal with merge conflicts from feature branches it is best to follow these steps for each commit: * Create a patch: `git format-patch -1 <sha1>` * Edit the patch and replace double quotes with single except those in comments or strings containing an unescaped apostrophe. * Check the patch `git apply --check <patchfile>` and fix any remaining issues if it outputs an error. * Apply the patch `git am < <patchfile>`
* [Lint] Update pylint rcfileCalum Lind2016-11-03
| | | | | | | | | | | * Merge in pylint 1.6.4 rcfile changes. * Add future_builtins to redefined-builtins-modules ignore list. (should be pylint default!) - Removed pylint disable comments from files. * Rearrange disable section, comments must be at start of line but can be interspersed to highlight categories. * Conventions enabled: wrong-import-position wrong-import-order
* Revert "[Py2to3] Clean-up the use of keys() on dictionary objects."Calum Lind2016-10-26
| | | | This reverts commit 8b50f3cdbdec4f2fa622aca9d0e4b45e5e4bf3aa.
* [Py2to3] Clean-up the use of keys() on dictionary objects.Andrew Resch2016-10-26
| | | | | | | | To make the code more Python 3 compatible, I've made a few changes to how we handle keys() or iterkeys() calls on dictionaries. All functionality should remain the same. * Remove the use of .keys() or .iterkeys() when iterating through a dictionary. * Remove the use of .keys() when checking if key exists in dictionary. * Replace dict.keys() with list(dict) to obtain a list of dictionary keys. In Python 3 dict.keys() returns a dict_keys object, not a list.
* [Tests] [Web] Make JSON independent of Web componentbendikro2016-04-10
| | | | | * Implement JSONTestCase in test_json_api.py * Implement WebAPITestCase test case in test_web_api.py
* [Tests] Catch and print errors in setup/teardownbendikro2016-04-08
|
* [Core] [WebUI] Increase RSA key size and improve hashingAnton Oussik2015-12-04
| | | | | | * Replace weak hashing functions, key sizes, and random number generation techniques with less weak versions to prevent crashes when running with the fips module loaded.
* [Lint] Autopep8 aggressive runCalum Lind2015-11-04
| | | | | * Uses isinstance() instead of type() * Uses sorted() where possible
* [Lint] Cleanup code to pass PyLint Warning categoryCalum Lind2015-10-30
| | | | | | | | | | | | | | | | Selected Warning messages disabled in pylintrc: * unused-argument: Quite a large and disruptive change if enabled. * broad-except: Most required in-depth investigation to determine type. * fixme: Not important * protected-access: Complicated to fix * import-error: Too many false-positives * unidiomatic-typecheck: Should be fixed in the next round of checks. * unused-variable: Again large and disruptive changes. * global-statement: Most usage is required. * attribute-defined-outside-init: Should be fixed in next round of checks. * arguments-differ: Possible false-positives, needs revisited. * no-init, non-parent-init-called, super-init-not-called: False-positives? * signature-differs: False-positives?
* Fix config for isort 4.2Calum Lind2015-10-21
|
* Fix pep8 across codebaseCalum Lind2015-10-21
| | | | | | | | | * Further whitespace fixes by autopep8 * Using pep8 v1.6.2 (not currently used by pyflakes) * Update config for pep8 and flake8 in tox.ini * A separate pep8 entry for running autopep8. The ignores prevent blank lines being added after docstrings. * .tox and E133 are ignored in flake8 by default.
* Flake8 add global __request__ to configCalum Lind2014-09-22
|
* Flake8 pass of entire codebaseCalum Lind2014-09-19
| | | | * Use the inline '# NOQA' to supress N802 lower-case warnings
* [WebUI] Add reduce import for Py3 compatCalum Lind2014-09-19
|
* Change imports to use absolute pathsCalum Lind2014-09-19
|
* [WebUI] Fix isort error in authCalum Lind2014-09-04
|
* Flake8 core and common filesCalum Lind2014-09-03
| | | | | | * Added N802 to flake8 ignore as certain inherited funcs cannot be changed to lowercase and this unresolved warning hides other errors/warnings. * Include new header
* Sort/prettify imports with isortCalum Lind2014-09-03
|
* [Python-Modernize] lib2to3.fixes.fix_exceptCalum Lind2014-09-03
| | | | | * Use 'ex' instead of 'e' to conform with pylint * Minimal Flake8 on some files
* [WebUI] Flake8 filesCalum Lind2014-08-19
| | | | * Does not pass cleanly due to camelcase function names and __request__ global.
* [WebUI] Fix errors from rearranging code in 2294670Calum Lind2014-02-18
|
* [#2310] [WebUI] Fix unicode password supportCalum Lind2014-02-18
| | | | | hashlib requires UTF-8 encoded string Passes flake8 but with warning for global __request__
* WebUI: Add failed login log message with IP address for fail2banCalum Lind2013-02-04
|
* fix the path given by the set-cookie headerDamien Churchill2011-05-03
|
* Apply patch from #1194Motiejus Jakštys2011-02-04
|
* Apply cookie date fix from adiosDamien Churchill2009-12-09
|
* fix bug when upgrading old passwords on new loginsDamien Churchill2009-09-23
|
* change UTC to GMT and add a method for generating the expires int and stringDamien Churchill2009-09-08
|
* re-set the _session_id cookie updating the expires timeDamien Churchill2009-09-01
|
* only return deferreds for those methods that require itDamien Churchill2009-08-20
|
* have the change_password method accept an old_password parameter for extra ↵Damien Churchill2009-08-20
| | | | | | | checking move the password checking logic into a seperate check_password method
* increase the expires time each time a session is checked for authenticationDamien Churchill2009-08-19
|