Load API specifications from a remote URL with authentication (Apicurio Registry / HTTP)#385
Merged
jemacineiras merged 5 commits intoJul 24, 2026
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 23 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
`specFile.filePath` may now be an http/https/ftp/file URL; the spec is fetched from that URL at generation time instead of the filesystem/classpath. This enables consuming specs published in an Apicurio Registry (artifacts served over HTTP) and any URL-addressable source, for both the OpenAPI and AsyncAPI generators. - PathUtil.isRemoteUri detects URL-scheme paths. - SchemaUtil.readFile fetches remote specs directly (shared main-spec reader for both generators). - New RemoteFileLocation resolves external $refs relative to a remote spec's URL. - AsyncApiGenerator / BaseAsyncApiHandler resolve remote spec locations. - ApiTool.nodeFromFile handles URL references. - OpenApiGenerator uses the URL parent as the $ref base when the spec is remote. Adds PathUtilTest and a SchemaUtil URL-loading test (file:// URL, network-free). Documents the Apicurio/URL usage in the README. Bumps version 6.5.1 -> 6.6.0 (new feature). Closes #7 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
joseegman-idoneea
force-pushed
the
feat/remote-spec-loading
branch
from
July 24, 2026 11:50
069abfa to
d17195a
Compare
- Add bounded connect (15s) / read (30s) timeouts to all URL fetches via PathUtil.openUrlStream, so an unresponsive remote spec server cannot hang the build. Timeouts are harmless for file:/jar: schemes. - Drop `ftp` from the accepted URL schemes (plaintext, effectively unused for API specs) — remote specs are now http/https/file only, reducing attack surface. - Document TLS expectations for https registries with internal/self-signed certs (must be trusted by the build JVM; validation is not disabled). Full multiapi-engine suite: 113/113 (mvn clean test). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds authentication for remote spec fetching, resolving credentials from system properties (preferred) or environment variables - never from build files: bearer token, basic auth, and an arbitrary header (e.g. X-Registry-ApiKey). Headers are applied only to http/https fetches. Optional host scoping (scs.multiapi.remote.host) sends credentials only to the configured host, so a token is never leaked to a different host via an external $ref or cross-host redirect. Credentials are never logged; TLS validation is unchanged. Adds PathUtilTest coverage and documents the setup in the README. Full multiapi-engine suite: 118/118 (mvn clean test). Closes #8 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Replace deprecated new URL(String) with URI.create(...).toURL() (ApiTool, SchemaUtil) - Remove fully-qualified names (java.net.URL, StandardCharsets in test) - Route AsyncApi remote read through PathUtil.openUrlStream (timeouts + shorter line) - Wrap long lines Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…st spacing) The 17 Codacy issues were all markdownlint on the new README section: lines over 80 chars and a list not surrounded by blank lines. Rewrap prose to <=80, replace the wide auth table with a wrapped bullet list, and add blank lines around lists. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jemacineiras
approved these changes
Jul 24, 2026
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.
Loads spec files from a remote URL for both OpenAPI and AsyncAPI, including authentication for protected registries. Implements joseegman-idoneea#7 and joseegman-idoneea#8.
What
specFile.filePathaccepts anhttp/https/fileURL; the spec is fetched at generation time. This is the mechanism to consume a spec published in an Apicurio Registry (artifacts served over HTTP) or any URL-addressable source.How
PathUtil.isRemoteUridetects URL-scheme paths;SchemaUtil.readFilefetches remote specs — the shared main-spec reader for both generators, so one change covers OpenAPI and AsyncAPI.RemoteFileLocationresolves external$refs relative to a remote spec's base URL;AsyncApiGenerator/BaseAsyncApiHandler/ApiTool/OpenApiGeneratorhandle remote locations and$refbases.Security / robustness
http/https/fileonly (noftp).X-Registry-ApiKey). Applied only to http/https.scs.multiapi.remote.host/SCS_MULTIAPI_REMOTE_HOST): credentials are sent only to the configured host, so a token is never leaked to another host via an external$refor cross-host redirect. Credentials are never logged; TLS validation is unchanged.Tests
PathUtilTest(scheme detection, bearer/basic/custom-header, host scoping) and aSchemaUtilfile://URL-loading test — network-free and deterministic.multiapi-enginesuite: 118/118 (mvn clean test).Docs & version
main(6.5.3, after Release 6.5.3: Gradle JDK 21 fix + OpenAPI 3.1 refinements (enum metadata, deprecated) #384). Bumps to 6.6.0 (new feature).🤖 Generated with Claude Code