feat(endpoint): add wss_url output to endpoint resource - #81
Merged
Conversation
The url attribute only exposed the RPC endpoint, leaving no way to reach the WebSocket endpoint that QuickNode returns alongside it. Surface the API's wss_url as its own computed attribute, normalized the same way as url so both omit the authentication token path. wss_url is null for chains and networks that do not offer WebSocket support.
Dependency ReviewThe following issues were found:
License Issuesgo.mod
Allowed Licenses: BSD-1-Clause, BSD-2-Clause, BSD-3-Clause, MIT, MIT-0, Apache-1.1, Apache-2.0, Artistic-1.0, Artistic-2.0, PHP-3.0, PHP-3.01, PSF-2.0, Zlib, zlib-acknowledgement, BSL-1.0, OpenSSL, WTFPL, CC0-1.0, CC-PDDC, CC-BY-1.0, CC-BY-2.0, CC-BY-2.5, CC-BY-3.0, CC-BY-4.0, Unlicense, ISC, BlueOak-1.0.0, BSD-2-Clause-Patent, ADSL, Apache-2.0, APAFML, BSD-1-Clause, BSD-2-Clause, BSD-2-Clause-FreeBSD, BSD-2-Clause-NetBSD, BSD-2-Clause-Views, BSL-1.0, DSDP, ECL-1.0, ECL-2.0, ImageMagick, ISC, Linux-OpenIB, MIT, MIT-Modern-Variant, MS-PL, MulanPSL-1.0, Mup, PostgreSQL, Spencer-99, UPL-1.0, Xerox, 0BSD, AFL-1.1, AFL-1.2, AFL-2.0, AFL-2.1, AFL-3.0, AMDPLPA, AML, AMPAS, ANTLR-PD, ANTLR-PD-fallback, Apache-1.0, Apache-1.1, Artistic-2.0, Bahyph, Barr, BSD-3-Clause, BSD-3-Clause-Attribution, BSD-3-Clause-Clear, BSD-3-Clause-LBNL, BSD-3-Clause-Modification, BSD-3-Clause-No-Nuclear-License-2014, BSD-3-Clause-No-Nuclear-Warranty, BSD-3-Clause-Open-MPI, BSD-4-Clause, BSD-4-Clause-Shortened, BSD-4-Clause-UC, BSD-Source-Code, bzip2-1.0.5, bzip2-1.0.6, CC0-1.0, CNRI-Jython, CNRI-Python, CNRI-Python-GPL-Compatible, Cube, curl, eGenix, Entessa, FTL, HTMLTIDY, IBM-pibs, ICU, Info-ZIP, Intel, JasPer-2.0, Libpng, libpng-2.0, libtiff, LPPL-1.3c, MIT-0, MIT-advertising, MIT-open-group, MIT-CMU, MIT-enna, MIT-feh, MITNFA, MTLL, MulanPSL-2.0, Multics, Naumen, NCSA, Net-SNMP, NetCDF, NTP, OLDAP-2.0, OLDAP-2.0.1, OLDAP-2.1, OLDAP-2.2, OLDAP-2.2.1, OLDAP-2.2.2, OLDAP-2.3, OLDAP-2.4, OLDAP-2.5, OLDAP-2.6, OLDAP-2.7, OLDAP-2.8, OML, OpenSSL, PHP-3.0, PHP-3.01, Plexus, PSF-2.0, Python-2.0, Ruby, Saxpath, SGI-B-2.0, SMLNJ, SWL, TCL, TCP-wrappers, Unicode-DFS-2015, Unicode-DFS-2016, Unlicense, VSL-1.0, W3C, X11, XFree86-1.1, Xnet, xpp, Zlib, zlib-acknowledgement, ZPL-2.0, ZPL-2.1, AAL, Adobe-2006, Afmparse, Artistic-1.0, Artistic-1.0-cl8, Artistic-1.0-Perl, Beerware, blessing, Borceux, CECILL-B, ClArtistic, Condor-1.1, Crossword, CrystalStacker, diffmark, DOC, EFL-1.0, EFL-2.0, Fair, FSFUL, FSFULLR, Giftware, HPND, IJG, Leptonica, LPL-1.0, LPL-1.02, MirOS, mpich2, NASA-1.3, NBPL-1.0, Newsletr, NLPL, NRL, OGTSL, OLDAP-1.1, OLDAP-1.2, OLDAP-1.3, OLDAP-1.4, psutils, Qhull, Rdisc, RSA-MD, Spencer-86, Spencer-94, TU-Berlin-1.0, TU-Berlin-2.0, Vim, W3C-19980720, W3C-20150513, Wsuipa, WTFPL, xinetd, Zed, Zend-2.0, ZPL-1.1 Excluded from license check: pkg:golang/github.com/hashicorp/terraform-plugin-framework@v1.15.0, pkg:golang/github.com/hashicorp/terraform-plugin-go@v0.27.0, pkg:golang/github.com/hashicorp/terraform-registry-address@v0.2.5, pkg:golang/google.golang.org/protobuf, pkg:golang/golang.org/x/crypto, pkg:golang/golang.org/x/mod, pkg:golang/golang.org/x/net, pkg:golang/golang.org/x/sync, pkg:golang/golang.org/x/sys, pkg:golang/golang.org/x/text, pkg:golang/golang.org/x/time, pkg:golang/golang.org/x/tools, pkg:golang/honnef.co/go/tools, pkg:golang/go.yaml.in/yaml/v3 OpenSSF Scorecard
Scanned Files
|
Trivy flagged two advisories against kin-openapi v0.135.0: a critical fail-open authentication bypass in ValidationHandler.Load() and a nil-pointer panic when validating requests against a content schema. Neither is reachable from this provider — both live in openapi3filter, and only openapi3 is in our build graph (via the generated client's embedded spec). A fixed version exists, so bump rather than suppress. Regenerating the API clients against v0.144.0 produces no diff.
|
Complexity only (correctness/security out of scope). Feature and the dependency-bump rationale both look sound; these are cut-only notes.
net: -8 lines possible. Nothing blocking. |
Review feedback: the wssUrl != nil && *wssUrl != "" guard duplicated what baseUrl already rejects, since the empty string parses to no scheme or host. Document that contract on baseUrl now that it is load-bearing, and drop the single-use strPtr test helper in favour of local fixtures. The nil and empty-string cases stay separate in the table test: they are distinct wire representations, and they are what proves this collapse is behaviour-preserving.
nexx88
approved these changes
Aug 4, 2026
jscaltreto
pushed a commit
that referenced
this pull request
Aug 4, 2026
🤖 I have created a release *beep* *boop* --- ## [0.10.0](v0.9.1...v0.10.0) (2026-08-04) ### Features * **endpoint:** add wss_url output to endpoint resource ([#81](#81)) ([b8da509](b8da509)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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
The
quicknode_endpointresource exposed only a singleurlattribute holding the RPC endpoint, so there was no way to reach the WebSocket endpoint QuickNode returns alongside it — users had to hand-construct thewss://URL or step outside Terraform entirely. This surfaces the API'swss_urlas its own computed attribute.Detail
New attribute:
internal/provider/endpoint_resource.go: Adds a computedwss_urlattribute, populated from thewss_urlfield thatsingle_endpointalready returns on bothCreateEndpointandShowEndpoint. No additional API calls are made. It is null when the API returns null or empty, which is how chains and networks without WebSocket support report it.urltreatment, so neither attribute carries the authentication token path. Callers compose the full URL from the attribute plussecurity.tokens[0].token, exactly as they already do forurl.UseStateForUnknownlike the other computed attributes, so pre-existing state populateswss_urlon the next refresh instead of forcing a diff.Refactor:
baseUrlhelper and asetUrlsmethod, replacing theurl.Parse/Sprintfpair that was duplicated verbatim inCreateandRead.baseUrlnow returns null rather than a malformed"://"string when the URL fails to parse — the previous code discarded the parse error and used the zero-valueURLregardless.urldescription, which read only "Endpoint URL that was created" and did not mention that the token path is stripped.Dependency bump (unrelated to the feature, included to keep the Trivy gate green):
github.com/getkin/kin-openapiv0.135.0 -> v0.144.0, resolving GHSA-r277-6w6q-xmqw (critical:ValidationHandler.Load()fail-open auth bypass via the defaultNoopAuthenticationFunc) and GHSA-jpcw-4wr7-c3vq (medium: unauthenticated nil-pointer panic validating a request against acontentschema).openapi3filter, andgo list -deps ./...shows onlyopenapi3in the build graph, pulled in by the generated client's embedded spec andGetSwagger(). This provider is an API client and does no server-side request validation. Bumped rather than.trivyignore'd because a fixed version exists.go-openapi/jsonpointer,go-openapi/swag/jsonname,oasdiff/yaml, andoasdiff/yaml3. Re-runninggo generate ./api/...against v0.144.0 produces no diff in the generated clients.Testing
TestSetUrls, a table test over the URL mapping: both URLs present, nilwss_url, empty-stringwss_url, and an unparseablehttp_url.TestAccMinimalQuicknodeEndpointResourceto assert thaturlandwss_urlmatch^https://[^/]+$and^wss://[^/]+$respectively. The test provisions eth/mainnet, which offers WebSocket support, sowss_urlmust be populated — this is the check that confirms the field is really present on live API responses and not just in the spec. The existingImportStateVerifystep covers theReadpath, since it compareswss_urlbetween created state and a fresh import.go build ./...,go vet ./..., andgo test ./internal/...pass locally. Acceptance tests need CI to run, hence the branch on this repo rather than a fork.trivy fs --scanners vuln --exit-code 1 .reports 0 vulnerabilities locally after the bump (2 before).Documentation
docs/resources/endpoint.mdregenerated viago generate ./...(tfplugindocs) to addwss_urland pick up the revisedurldescription.