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

One more SecretStr fix #6419

Merged
merged 1 commit into from
Jan 23, 2025
Merged

One more SecretStr fix #6419

merged 1 commit into from
Jan 23, 2025

Conversation

tofarr
Copy link
Collaborator

@tofarr tofarr commented Jan 22, 2025

JWT Secret Type Fix

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Improved security by properly handling JWT secrets using Pydantic SecretStr type.


Give a summary of what the PR does, explaining any non-trivial design decisions

This PR fixes the handling of JWT secrets by properly wrapping them in Pydantic's SecretStr type. The changes include:

  1. Added SecretStr import from pydantic
  2. Modified the jwt_secret assignment in finalize_config to wrap the secret in SecretStr

This change ensures that sensitive JWT secrets are properly handled and not accidentally exposed in logs or string representations.


Link of any specific issues this addresses

N/A - Security improvement


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:227e292-nikolaik   --name openhands-app-227e292   docker.all-hands.dev/all-hands-ai/openhands:227e292

@tofarr tofarr marked this pull request as ready for review January 22, 2025 23:30
Copy link
Contributor

@malhotra5 malhotra5 left a comment

Choose a reason for hiding this comment

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

LGTM

@tofarr tofarr merged commit aa22373 into main Jan 23, 2025
14 checks passed
@tofarr tofarr deleted the fix-jwt-secret-secret-str branch January 23, 2025 01:21
zchn pushed a commit to zchn/OpenHands that referenced this pull request Feb 4, 2025
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.

2 participants