This repository was archived by the owner on Jun 23, 2026. It is now read-only.
Sync changes from upstream openrdap/rdap#2
Open
teward wants to merge 28 commits into
Open
Conversation
meta: upgrade to Go 1.20, switch to Github Actions
… path as...but was required as" error.
The only significant change is the -j/--json flag is implemented.
…ng) support by default. Run "rdap -v OPS4-RIPE" to see an entity query on RIPE's RDAP server. Object tags allow entity strings like OPS4-RIPE to be directed to the correct RDAP server using the -SUFFIX. There is a registry mapping suffixes to RDAP servers at https://data.iana.org/rdap/object-tags.json.
…ROXY, HTTPS_PROXY, NO_PROXY (or lowercase) environment variables.
…idProperties, which causes invalid vCard options to be silently ignored, rather than cause the vCard decode to fail entirely. #25
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.9.0 to 0.17.0. - [Commits](golang/crypto@v0.9.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
…/x/crypto-0.17.0 Bump golang.org/x/crypto from 0.9.0 to 0.17.0
…s specified for testing & use on openrdap.org's demo page)
Manual page for unix if people want to share the rdap command in their unix system.
* Various spelling fixes --------- Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
…S(), IPv4(), IPv6()) to call c.freshenFromCache with the corresponding RegistryType. (#40) Previously, all types tried to freshen ServiceProvider, which wouldn't have existed if you hadn't accessed that Registry, and wouldn't cause the registry you asked for to be added to the cache. This means the disk cache wasn't used for any type other than ServiceProvider Change all uses of ioutil.* to the calls in os.* and io.*. In the comments for bootstrap/client.go, change "b := bootstrap.NewClient()" to "b := &bootstrap.Client{}" because bootstrap.NewClient() deesn't exist. Co-authored-by: Kevin White <kwhite@datapulse.global>
* Use XDG_CACHE_HOME for the bootstrap cache directory Default the disk cache to $XDG_CACHE_HOME/openrdap, falling back to $HOME/.cache/openrdap when XDG_CACHE_HOME is unset or not absolute, instead of $HOME/.openrdap. This keeps non-essential cache files out of $HOME and lets users clear the cache predictably via $XDG_CACHE_HOME. InitDir now uses MkdirAll so the cache parent (e.g. ~/.cache) is created as needed. Closes #35 * Revise panic message
* chore: update dependencies and modernize with go fix
- Bump go directive to 1.25 and update module dependencies
(kingpin v2.4.0, httpmock v1.4.1, x/crypto v0.52.0)
- Replace interface{} with any throughout
- Use reflect.Pointer over the deprecated reflect.Ptr
- Adopt maps.Copy and slices.Contains from the standard library
- Use strings.Builder in DecodeData.String()
- Replace the Go CI workflow with a dedicated build workflow
* chore: ignore editor, IDE, and OS artifacts
* perf: cache decoder field plans, slim DecodeData, optimize string hot paths
Resolve each struct type's decode plan (where every RDAP field lives, and
where the DecodeData field lives) once per Go type and cache it, instead of
re-running reflection and struct-tag parsing on every struct decode.
decodeStruct binds the cached plan to the instance and resolves only the
fields present in the JSON.
Slim down DecodeData, which is allocated for every decoded struct:
- values now references the parsed source map directly instead of copying it.
- isKnown shares the plan's read-only set of field names instead of being
rebuilt per instance.
- notes and overrideKnownValue are allocated lazily (most decodes need
neither) rather than eagerly.
Together these cut decoding of a representative nested domain response by
~53% in time, ~63% in allocated bytes, and ~49% in allocation count. What
remains is dominated by encoding/json parsing into map[string]any and the
reflection that fills the structs. The original BUG: invariant checks are
preserved; they now run once when a type's plan is built.
Also optimize three string hot paths:
- escapePath: fast-path the common no-escape case (returns the input with
zero allocation) and pre-size the buffer otherwise.
- Printer.cleanString: skip the rune-by-rune strings.Map scan when the
input contains no control runes.
- VCard.Tel/Fax: call VCardProperty.Values once per property instead of
twice; Fax now uses slices.Contains for consistency with Tel.
Add benchmark_test.go covering the decode path and string hot paths as
regression guards.
* docs: document exported and printer functions, fix gofmt drift
Add doc comments to every previously-undocumented exported function across
the package (Client.Do, the Error()/String() methods, the bootstrap
sort.Interface sorters, Response.ToWhoisStyleResponse, and the sandbox/test
helpers), and complete the comments for the Printer's print* routines.
Also fix pre-existing gofmt drift in bootstrap/cache/memory_cache.go,
bootstrap/question.go, and test/http_test.go.
* chore: bump deps
* fix: restore Answer field order, harden CI workflow permissions
* chore: add CI lint/test workflows and resolve golangci-lint findings
Add golangci-lint config (.golangci.yml) tuned for this library, plus
Lint and Tests GitHub Actions workflows with tightened token scopes.
Resolve all linter findings, including genuine fixes:
- propagate context via http.NewRequestWithContext (noctx)
- fix &*r.Server aliasing that mutated the shared Server URL (SA4001)
- lowercase error strings and drop redundant "Error" prefixes (ST1005)
- add explicit json tags to the bootstrap unmarshal struct (musttag)
- replace test init() with explicit var initialization
- tighten cache dir/file permissions to 0750/0600
- drop always-nil error returns from the decodeX helpers
* chore: apply linter fixes and formatting
* test: add golden-file end-to-end tests for RunCLI
Drive RunCLI for each output mode (text/json/whois/raw) plus version and
error paths, comparing exit code, stdout, and stderr against committed
golden files. Network-backed cases use an in-process fixture server via
--server and an in-memory cache, so nothing touches the network or the
real filesystem. Regenerate with `go test -run TestRunCLI -update`.
Also sort unknown-field output in the printer (printUnknowns and the
nested-map case of printUnknown) so CLI output is deterministic.
Raises RunCLI coverage from 0% to ~48%.
* ci: run unit tests on a Go 1.25.x and 1.26.x matrix
go.mod declares a 1.25.0 floor while CI ran only 1.26, which could mask
bugs that surface on the declared minimum. Test on both the floor and the
latest release; lint continues on the latest toolchain only.
* chore: apply linter fixes and formatting
* test: colocate benchmarks with the code they exercise
Distribute the benchmarks from benchmark_test.go into the _test.go file of
the package code each one exercises, matching this repo's per-file test
layout (idiomatic Go; the standard library colocates benchmarks too):
BenchmarkDecodeDomain -> decoder_test.go
BenchmarkEscapePathClean/Dirty -> request_test.go
BenchmarkCleanStringClean/Dirty -> print_test.go
BenchmarkVCardValues -> vcard_test.go
BenchmarkDecodeDomain now loads its fixture via test.LoadFile for
consistency (outside the timed loop, so results are unaffected).
* ci: exclude false-positive gosec G115 in print.go via config
The uint->int conversion in Printer.indent for strings.Repeat cannot
realistically overflow (indent depth is bounded by RDAP object nesting).
An in-code //nolint kept getting stripped by editor tooling, so suppress
it in .golangci.yml instead, which is stable across edits.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Sync upstream changes.