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

arxiv-auth with python 3.10 #78

Merged
merged 47 commits into from
Sep 22, 2023
Merged

arxiv-auth with python 3.10 #78

merged 47 commits into from
Sep 22, 2023

Conversation

bdc34
Copy link
Contributor

@bdc34 bdc34 commented Aug 17, 2022

This includes fixes to use arxiv-auth and accounts with python 3.10.

The users directory is moved to arxiv-auth to reflect that that is the directory with the code that is uploaded to pypi as the arxiv-auth package.

The dependency management is changed from pipenv to poetry. The main motivation here is that poetry has poetry upload to build the package and upload to pypi. This removes the need for the redundant setup.py files.

Instead of having a dependency description file at ./ there is now one at both ./arxiv-auth and ./accounts to more directly reflect the fact that these are two different packages. The dependencies in both of these are updated to use newer packages and python 3.10. I developed this with 3.10.6.

Tests were updated to work. There were problems with mocks that needed the Flask request context. There were tests that also needed the request context. Some tests were converted to pytest from UnitTest.

Some of the docs were updated. Please let me know where these are not clear. "NG" was removed in several places since we are moving on.

users.init_app and legacy.init_app were pointing to the same function.

users.create_all and legacy.create_all were pointing to the same
function.
This was just redirection to packages in `arxiv.users`
More clean up of indirection
It was just importing things from `arxiv.users`
Fixes pillow dep issue
Tests under ./arxiv-auth pass

The intent is to better show the relation between the directory and
the package.

Fixes tests in arxiv-auth/arxiv_auth/auth/tests/test_extension.py
And other fixes
Changes to lint.sh and style.sh

Doc style fixes.
Fixes yaml error
Change to deps to try to get github actions to work
This fixes a bug where the query to get a session from the
db was not limiting to the session id from the cookie.
Setting either `Flask.config['ARXIV_AUTH_DEBUG']` or env var
ARXIV_AUTH_DEBUG will turn on logging debugging messages for several
auth packages.
It is no longer needed and and causes unnecessary configuration complexity and
problems.

The AUTH_UPDATED_SESSION_REF was only in place to ease the transition from
placing the auth object on `request.session` to `request.auth`. Placing in at
`request.session` was a mistake during the NG because it interfered with flask
sessions.

Also bumps version from 1.0 to 1.1.
Used by vault but we don't use vault anymore.
accounts/main.py Dismissed Show dismissed Hide dismissed
)
salt = b'fdoo'
password = b'thepassword'
hashed = hashlib.sha1(salt + b'-' + password).digest()

Check failure

Code scanning / CodeQL

Use of a broken or weak cryptographic hashing algorithm on sensitive data High test

Sensitive data (password)
is used in a hashing algorithm (SHA1) that is insecure for password hashing, since it is not a computationally expensive hash function.
)
salt = b'fdoo'
password = b'thepassword'
hashed = hashlib.sha1(salt + b'-' + password).digest()

Check failure

Code scanning / CodeQL

Use of a broken or weak cryptographic hashing algorithm on sensitive data High test

Sensitive data (password)
is used in a hashing algorithm (SHA1) that is insecure for password hashing, since it is not a computationally expensive hash function.
@bdc34 bdc34 merged commit 0ef8c46 into develop Sep 22, 2023
1 of 2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant