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

use JWT_PUBLIC_KEY from environment rather than file #2865

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/e2e_test_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
uses: ./.github/actions/run-full-stack
env:
JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }}
JWT_PUBLIC_KEY: ${{ secrets.JWT_PUBLIC_KEY }}

# Install Cypress globally
- name: Install Cypress globally
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit_test_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
runs-on: ubuntu-latest
env:
JWT_PRIVATE_KEY: ${{ secrets.JWT_PRIVATE_KEY }}
JWT_PUBLIC_KEY: ${{ secrets.JWT_PUBLIC_KEY }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ./.github/actions/setup-python
Expand Down
5 changes: 0 additions & 5 deletions backend/ops_api/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ def create_app() -> Flask:
app.config.from_envvar("OPS_CONFIG")
app.config.from_prefixed_env() # type: ignore [attr-defined]

# manually setting the public key path here, until we know where it will live longterm
app.config.setdefault(
"JWT_PUBLIC_KEY",
app.open_resource(app.config.get("JWT_PUBLIC_KEY_PATH")).read(),
)
# fall back for pytest to use
app.config.setdefault(
"SQLALCHEMY_DATABASE_URI",
Expand Down
2 changes: 1 addition & 1 deletion backend/ops_api/ops/environment/default_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
FLASK_PORT = 8080

JWT_PRIVATE_KEY = os.getenv("JWT_PRIVATE_KEY")
JWT_PUBLIC_KEY_PATH = "./static/public.pem"
JWT_PUBLIC_KEY = os.getenv("JWT_PUBLIC_KEY")
JWT_ALGORITHM = "RS256"
JWT_DECODE_ALGORITHMS = "RS256"
JWT_TOKEN_LOCATION = "headers" # noqa: S105 "Not a secret"
Expand Down
9 changes: 0 additions & 9 deletions backend/ops_api/ops/static/public.pem

This file was deleted.

9 changes: 0 additions & 9 deletions public.pub

This file was deleted.