fix(security): remove internal infra identifiers from published package - #22
Merged
andrei-hasna merged 1 commit intoJul 24, 2026
Merged
Conversation
andrei-hasna
force-pushed
the
fix/security-remove-internal-infra-identifiers
branch
from
July 24, 2026 15:12
5032395 to
3238f76
Compare
… url Replace the internal infra host `knowledge.hasna.xyz` with the public product domain `https://knowledge.md` as the default hosted knowledge API URL, so the published npm package (dist/ + bin/) no longer ships the internal identifier. - src/auth.ts DEFAULT_KNOWLEDGE_API_URL, src/workspace.ts defaultKnowledgeConfig hosted default, src/service.ts normalizeMode alias, doc comments in src/cli.ts and src/cloud-store.ts. - README, docs/examples, docs/migration, tests/cloud-store.test.ts. - Rebuilt dist/ and bin/ so shipped artifacts carry the scrubbed default. - Bump 0.2.87 -> 0.2.88 + CHANGELOG. - Residual out of scope: @hasna/contracts defaultCloudBaseUrl still templates `https://<app>.hasna.xyz` when no URL is configured; no base-url override exists, so it needs a separate @hasna/contracts fix. Documented in tests/cloud-store.test.ts.
andrei-hasna
force-pushed
the
fix/security-remove-internal-infra-identifiers
branch
from
July 24, 2026 15:13
3238f76 to
3ca3d82
Compare
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
DEFAULT_KNOWLEDGE_API_URLinsrc/auth.ts(used by thesetup/auth CLI flow and the storage-contract default) previously hardcoded the internal hosthttps://knowledge.hasna.xyz. Changed to the public product domainhttps://knowledge.md.src/workspace.ts(defaultKnowledgeConfig()),src/service.ts(normalizeModealias check),src/cloud-store.ts(doc comment),src/cli.ts(doc comment), README.md, docs/migration and docs/examples, and tests.dist/andbin/(tracked/shipped build artifacts) viabun run buildso the fix is present in what actually ships in the npm package, not just source.truststore.pki.rds.amazonaws.comCA-bundle URL surfaced by the grep is a generic public AWS resource (RDS' public CA bundle download link used by any RDS+SSL client) and is not an internal identifier — left unchanged.Important — residual leak NOT fixable from this repo
One default host template still resolves to
https://knowledge.hasna.xyzat runtime: the self-hosted "client-flip" path (resolveKnowledgeCloudStoreinsrc/cloud-store.ts) delegates toresolveStorageClient()from the@hasna/contractsnpm dependency, whosedefaultCloudBaseUrl(name)hardcodes`https://${name}.hasna.xyz`(confirmed innode_modules/@hasna/contracts/dist/client/transport.js).createClientTransport's override parameter only acceptsfetchImpl/headers/timeoutMs/retry/sleepImpl— there is no supported override for the base URL, so this repo cannot fully close that path on its own.tests/cloud-store.test.ts(renamed/annotated the relevant test) rather than silently changing its expectation to hide the gap.@hasna/contractsneeds its own follow-up fix (changedefaultCloudBaseUrlto a neutral public domain or require an explicit URL) before this class of leak is fully closed end-to-end. Flagging for a separate remediation PR in that repo.Scrubbed identifier classes
knowledge.hasna.xyz→knowledge.md(source, docs, README, tests, rebuilt dist/bin)Needs patched republish after merge
Yes —
dist/,bin/are part of the npm-publishedfilesand currently ship the old default. A patch version bump +npm publishis required after merge to actually remove the leaked default from installed copies. (Per task instructions, no publish was performed here.)Test plan
bun install && bun run buildsucceeds, regeneratesdist//bin/with noknowledge.hasna.xyzreferences in own sourcebun test— 165 pass / 6 fail, 2 skip — fail count and specific failing tests are identical to a pristinemaincheckout (pre-existing environment/legacy-workspace-state failures, unrelated to this change; verified by diffing failure lists between pristine and fixed clones)hasna.xyz,hasna-xyz-infra,hasna/xyz/,amazonawsacross tracked files post-fix