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

feat: certificate fingerprints auto-refresh #247

Closed
wants to merge 13 commits into from

Conversation

nvtaveras
Copy link
Collaborator

@nvtaveras nvtaveras commented May 18, 2024

Description

This is an improvement over the way certificate fingerprints are managed for exchange adapters. Instead of having static values hardcoded in the application for each individual adapter, all certificate fingerprints are now placed under a single file certificates.json which is periodically fetched by the application by configuring an url CERTIFICATE_MANAGER_JSON_URL and a refresh interval CERTIFICATE_MANAGER_REFRESH_INTERVAL_MS. This will allow us to update certificate fingerprints for any adapter whenever they change/expire without having to release a new version of the client and re-deploying the oracles.

Instead of hosting the certificates file on a cloud bucket I decided to host it directly in the repo which achieves two things:

  1. During app initialization the certificates are loaded from the local json file, so the application works as before even if the configured url is unavailable/not set during initialization, making these changes backwards compatible.

  2. We can point the CERTIFICATE_MANAGER_JSON_URL directly to the raw url of the file in the repo, eliminating the need of managing the file somewhere else unless we explicitly want to. The default poll interval is set to 10 minutes which I don't think will cause any rate limiting by github but we'll see later after this is deployed.

Tested

Tested it by running a local server and modifying the certificates from the served json on the fly and checking that fingerprint errors are fixed after the new json is fetched.

@nvtaveras nvtaveras marked this pull request as ready for review May 21, 2024 00:51
@nvtaveras nvtaveras changed the title feat: dynamically loaded certificates feat: certificate fingerprints auto-refresh May 21, 2024
@nvtaveras
Copy link
Collaborator Author

closing for #264

@nvtaveras nvtaveras closed this Jul 24, 2024
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