Repository navigation
fix(db): use http:// for private couchdb internal endpoint URL - #146
Merged
Merged
Conversation
setupDatabase() built an https:// connection URL for CouchDB's internal (publicAccess: false) endpoint by reusing DatabaseTypeToProtocol['couchdb'], which is 'https' and correct only for the public ingress URL (port 443, TLS-terminated at ingress). The internal container port 5984 speaks plain HTTP with no in-cluster TLS termination, so consumers got a TLS-handshake- on-plaintext-port failure. Introduce a separate DatabaseTypeToInternalProtocol lookup so the internal CouchDB path emits http:// while the public path keeps the unchanged DatabaseTypeToProtocol['couchdb'] = 'https' value. Other database types are unaffected since their internal paths already use non-HTTP schemes. Fixes #145 Co-Authored-By: Claude <noreply@anthropic.com>
Member
Author
Research ReviewVerified
Adjacent Stubs DetectedNone. Swept Orphaned Files DetectedNot applicable — Impact Analysis
Risks Not Tested
Research Suggestions
Reviewed by PR Research Validator. This review checks whether code is based on verified sources rather than assumptions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setupDatabase()in@osaas/client-dbbuilt anhttps://connection URL for CouchDB's internal (publicAccess: false) endpoint by reusingDatabaseTypeToProtocol['couchdb'], which is'https'and correct only for the public ingress URL (port 443, TLS terminated at the ingress). The internal container port5984speaks plaintext HTTP — there is no in-cluster TLS termination on that port — so any consumer given this URL fails with a TLS-handshake-on-plaintext-port error.Fix
DatabaseTypeToInternalProtocollookup (currently only overridingcouchdb->http) so the internal-endpoint branch for CouchDB emitshttp://instead of reusing the ingress-onlyDatabaseTypeToProtocolconstant.DatabaseTypeToProtocol['couchdb']is unchanged ('https') since it is still correct for the public path.packages/db/src/index.test.tsasserting: private CouchDB URL starts withhttp://, public CouchDB URL starts withhttps://.Versioning
I did not manually bump
packages/db/package.json. I checked the history of prior bug-fix commits touching this file (e.g.bb115de "fix: clickhouse js client expect http url") and none of them touchedpackage.json— this repo bumps versions separately vialerna version --conventional-commitsin dedicatedchore(release): publishcommits, driven by thefix:/feat:commit prefix. This commit uses afix:prefix so it will be picked up as a patch bump by that process.Fixes #145
Lessons
The repo's
packages/*/libbuild output is gitignored but was stale in this checkout (missinggetInternalEndpointin@osaas/client-core's compiledlib/, even though it exists insrc/), which made the new Jest test fail to type-check untilpackages/corewas rebuilt withtsc. Also, despite the task brief suggesting a version bump, this repo's actual convention (verified viagit logon prior fix commits) is to never bumppackage.jsonin feature/fix PRs — versioning is automated bylerna version --conventional-commitsin separate release commits.🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com