Comments (4)
After several tests the problem is that hashlib.sha1
need a str without unicode codes. When you pass a string without unicode characters the conversion can be made automagically using default ascii encoding, but if the string have extended characters then the code can't handle it.
The solution is encode both strings as str as I say before.
return hashlib.sha1(salt.encode('utf-8') + password.encode('utf-8')).hexdigest(), salt
from supysonic.
Hi @spl0k, I have some small questions / proposals that I wanted to know your opinion.
I fix this issue and made some changes in several files to make project more clean with circular dependencies, but before send you a PR tell me wat do you think about the following.
- I made the headers of touched files more simple. You can see the result here. I think that is more clean and the given information is the same (part of supysonic, copyright and license).
- In the files where I made several changes in code I add me in copyright line (Sample here and here). This is simply credit my changes.
- The files that I toched are re-tabbed. I think that is better use four spaces that one tab.
- In these files I made some visual changes as make imports one for module or add more blank lines and return carriages. This is for complying with the style PEP.
No more, you'll tell me what you think.
from supysonic.
About UserManager.__decode_password
, this is not old code and is used by pre-1.13.0 clients/servers. See the Subsonic API introduction about query parameters.
But you're right that it prevents having passwords starting with enc:
. Actually that method shouldn't be here or called from any other UserManager
method. That code should actually be executed when passwords are retrieved from query parameters (1, 2, 3).
For headers I actually followed the advice given by the license, but it's true it can be shortened. Your version, with added credit, suits me fine.
from supysonic.
Ok. In this case I think that we can use this method in __decode_password
def __decode_password(password):
if not password.startswith('enc:'):
return password
try:
return binascii.unhexlify(password[4:])
except:
return password
With this piece of code, a password that starts with enc:
have no problem.
Ok. I'll make the changes 😉
from supysonic.
Related Issues (20)
- FR: Reach API level 1.11.0 HOT 6
- supysonic-server command not available HOT 2
- Testsuite failure with Python 3.11 HOT 9
- supysonic-daemon as normal user HOT 2
- supysonic-daemon settings HOT 5
- PostgreSQL error HOT 8
- Ongoing work to extend subsonic API HOT 7
- Error during migration with 7.4 HOT 2
- Intermittent '500 Internal Server Error' (possibly due to postgres query syntax) HOT 3
- Server error when accessing starred albums
- [Enchancement] Gunicorn request size limit HOT 3
- peewee.OperationalError: Server has gone away HOT 3
- Multiple artist albums have only 1 track HOT 4
- ValueError: badly formed hexadecimal UUID string in getAlbum.view HOT 2
- Error message should be logged on login failure
- can't play songs with accented character when using supysonic wsgi HOT 3
- tests/frontend/test_user.py tries to import escape from flask
- More folder management options HOT 2
- flaky test tests.base.test_watcher.AudioWatcherTestCase.test_move_out causes timeouts HOT 3
- Postgresql migration to 0.7.7. fails due to syntax (reserved word)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supysonic.