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

dev -> master #97

Merged
merged 10 commits into from
Feb 20, 2025
Merged

dev -> master #97

merged 10 commits into from
Feb 20, 2025

Conversation

bmaltzan
Copy link
Contributor

This can be tested on dev, notes here:
https://arxiv-org.atlassian.net/wiki/spaces/AD/pages/1185742849/arXivCheck+Become+User

Depends on:
https://github.com/arXiv/arxiv-httpd/pull/78

And a fastly route, to cit for:
/become_user

@bmaltzan bmaltzan requested a review from a team February 19, 2025 14:24
# accounts/accounts/controllers/authentication.py:190
def unset_masquerade_cookie(response: Response) -> None:
cookie_name = current_app.config[f'MASQUERADE_COOKIE_NAME']
response.set_cookie(key=cookie_name, value='', max_age=0, httponly=True)

Check warning

Code scanning / CodeQL

Failure to use secure cookies Medium

Cookie is added without the Secure attribute properly set.
set_cookies(response, data)
unset_submission_cookie(response)
unset_permanent_cookie(response)
response.set_cookie(key=tracking_cookie_name, value='', max_age=0, httponly=True)

Check warning

Code scanning / CodeQL

Failure to use secure cookies Medium

Cookie is added without the Secure attribute properly set.
@@ -14,7 +14,12 @@ python-dateutil = "*"
pyjwt = "*"
redis = "==2.10.6"
redis-py-cluster = "==1.3.6"
pydantic = "*"
pydantic = "^1.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we switch to pydantic 2 in new code, if somehow possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!
This is an update to the currently running code, which we don't want to spend time updating.
We expect it to be replaced by keycloak

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd skip upgrading to pydantic v2 to avoid extra work. This code is end of life.

@bdc34 bdc34 self-requested a review February 19, 2025 14:49
if DEBUG:
print("BU-DEBUG: become_jwt", become_jwt)

next_page = "https://check.dev.arxiv.org/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next_page is not pulled from a query parameter. This may or may not be the intent.

In other places next_page works by being a query parameter. It needs to be check that the hostname is an arxiv domain.

Copy link
Contributor

@bdc34 bdc34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks safe. I would not change to pydantic v2 since this code is end of life.

@bmaltzan
Copy link
Contributor Author

@bdc34 @ntai-arxiv , the "production" branch is running at cit, so I replayed these commits onto a fork of that branch. I don't expect this PR to be needed, as my guess is something different will be implemented along with the keycloak upgrade. I'll merge this for reference/consistency between the master and production branches, but this code isn't the running code at arxiv.org/become_user

The deployed PR:
#98

@bmaltzan bmaltzan changed the title dev -> main dev -> master Feb 20, 2025
@bmaltzan bmaltzan merged commit 9778117 into master Feb 20, 2025
4 of 5 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.

3 participants