Skip to content

feat(gateway): select GitHub destinations through configured DNS - #180

Closed
freeqaz-openai wants to merge 11 commits into
feat/github-gateway-runtimefrom
feat/credential-configured-dns-20260915
Closed

freeqaz-openai wants to merge 11 commits into
feat/github-gateway-runtimefrom
feat/credential-configured-dns-20260915

Conversation

@freeqaz-openai

@freeqaz-openai freeqaz-openai commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Select a numeric port-443 destination for github.com or api.github.com through explicitly configured DNS servers. A fresh native resolver evaluates complete A and AAAA answer sets; unsafe or malformed answers reject the entire selection. Only ENODATA is treated as an empty family.

The selection owner retains configuration and bounds, checks abort/deadline state, and releases its resolver, timer and subscription on every terminal path. It returns a frozen destination only after cleanup and final bounds checks. There is no OS lookup fallback, global DNS mutation, application cache or alternate-address retry.

Earlier supplier refresh and validation

The previous head e983c1a871756a8e574a28280e715144b3f5dcfd received #177 at a6e8c6206ed541c59b070d523d2f33c8dc333dca, including main's Agent stop and Go CLI changes. HTTP/JSON/DNS source and compiler fixtures are unchanged; the complete migration tree matches the accepted supplier. Required TypeScript checks retain coverage of every destination-transport source module alongside the Go CLI checks.

  • HTTP, JSON, destination and native loopback DNS suites: 197 passed, 0 failed, 0 skipped.
  • All four TypeScript projects passed: the root build, OCC gateway fixtures, complete gateway source and controller token-provider fixtures.
  • Generated OpenAPI/reference checks, workspace boundaries, CI test selection, full formatting, documentation length and diff whitespace checks passed. The authored documentation build validated 120 pages and 1,438 links.

These compiler and generated-API checks resolve the local dependency gaps recorded at 34ffb57688ad06957cbeb21a198950fe2d799c00; its 197 component cases also passed again for this refresh. PostgreSQL migrations were not executed locally. These are retained results for that earlier revision; the focused correction is recorded below.

Dependency and scope

Based on #177. The DNS tests use real loopback UDP without dialing returned destinations. Socket address pinning, original Host/SNI, public TLS trust, current authority and the actual gateway service remain separate integration work. A numeric destination grants no request authority. These checks do not qualify live upstream dialing or a deployed gateway.

Current correction

At 1b7a78400a25ae91c21e27c708816a1ef9d693a1, the native DNS cases now contain distinct permitted A/AAAA answers, proving first-A selection and first-AAAA fallback. Destination and native DNS suites passed 186 tests, no failures or skips; changing selection to the last address failed both strengthened cases. Runtime selection is unchanged. This is focused component evidence; provider-rule/bootstrap composition, socket/TLS integration, ordinary Agent use and live-provider qualification remain pending. Hosted CI for this candidate remains a separate check.

const signal = nativeAny.call(NativeAbortSignal, [value as AbortSignal]);
// A private native dependent isolates addAbortListener's mutable method calls.
// Native dependency propagation also bypasses source abort-event suppression.
Object.defineProperties(signal, {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Is this the best way to do this? fine if so, but worth considering alternatives.

@@ -0,0 +1,310 @@
import assert from "node:assert/strict";

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

nit: can the tests be refactored to move closer to a standardized DSL where tests are short + call into a test harness. Easier to read, maintain, and add new test cases with less copy paste.

@@ -0,0 +1,604 @@
import assert from "node:assert/strict";

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

same nit here: can we deslop into code that moves towards a declarative DSL?

);
}

function selectDestination(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

let's clean up this function too. too many let statements, internal functions with closures that make mocks/testing hard, and too hard to follow.

@freeqaz-openai
freeqaz-openai marked this pull request as ready for review September 15, 2026 18:11
@freeqaz-openai
freeqaz-openai requested a review from a team as a code owner September 15, 2026 18:11
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