A new client (connection) may see a lagging state of the record list
for a short time, so the small page size check waits until all records
are listed.
refs #2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- list DNS records with order=name&direction=asc, without an order
Cloudflare's pages can overlap and miss records
- de-duplicate fetched entries by ID, fetch the pages again (up to 3
times) if fewer entries than total_count were fetched, otherwise log
a warning; debug log per fetched page
- testPaging: unique record names for an unambiguous order
- testDns: wait for the unfiltered record list, which can lag behind
directly after creating records
refs #2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- query values (zone names, subdomains) are URL-encoded, zone and
record IDs must be alphanumeric: prevents query parameter injection
and path traversal
- zone names and subdomains with whitespace, control characters or
\ ? # & ; | < > " ' ` are rejected with an IllegalArgumentException
- withBaseUrl only accepts HTTPS (plain HTTP only for loopback hosts),
no query/fragment, trailing slash is removed
- connect and response timeouts (defaults 10 s / 30 s), configurable
via withConnectTimeout / withResponseTimeout; values below 1 ms or
overflowing milliseconds are rejected
- null credentials throw an IllegalArgumentException, build() without
authentication an IllegalStateException
- tests, README and changelog updated
refs #2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- live tests for API error details (status code, Cloudflare errors),
404 on deleting an unknown record, unknown zones with and without
emptyResultThrowsException, closing the client, multi-level
subdomains and the zone apex, server- and client-side type filter,
record attributes (priority, comment, SRV data) and Instant
timestamps
- testPaging fetches all pages with a small page size, therefore
CfDnsClient got a package-private constructor with a custom page size
- testDns checks that recordUpdate doesn't modify the given record
- SRV records: the priority is part of the data, fixed javadoc,
README and changelog accordingly
refs #2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- bug fixes: API errors are no longer wrapped into "Unexpected error!",
zoneGet no longer crashes on unknown zones, getSubdomain handles apex
and multi-level names, batch operations send the full record name,
list methods fetch all pages, recordDelete handles empty results
- rename "sld" to "subdomain": getSubdomain(), recordCreateSubdomain(),
old methods deprecated; "@" (CfDnsClient.APEX) addresses the apex
- one shared HTTP client with connection pooling, CfDnsClient
implements AutoCloseable
- CloudflareApiException provides HTTP status code and Cloudflare
errors, HTTP 404 throws CloudflareNotFoundException
- RecordEntity supports priority, data, comment and tags
- recordCreate/recordUpdate send only writable attributes and don't
modify the given record
- breaking: recordList overloads replaced by recordListBySubdomain and
recordListByType, timestamps are java.time.Instant
- single record type is filtered server-side (?type=)
- tests, README and changelog updated
refs #2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README: fix fluent API examples (getRecord), complete recordCreate
docs, document paging, groupRecordsByFqdn, recordDelete by id and
multiple types in recordDeleteTypeIfExists, mention Java 17
- replace stray "getRecord" wording with "record" in javadoc, log and
exception messages
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change default behavior of `emptyResultThrowsException` to `false`, update `ResponseValidator` for improved handling of single and multiple results, and enhance test coverage and documentation.
Add Fluent API for DNS operations, update `README`, and refactor `CfDnsClient` for zone-level chaining.
Validate record type in `RecordEntity#build`, throw exception for invalid types, and add test coverage.
Refactor `RecordEntity#getSld` to handle `zoneName` cases, improve null safety, and enhance substring logic.
Refactor `RecordEntity` getter (`getName` → `getSld`) for clarity, improve string handling in batch processing, and enhance type safety in HTTP operations. Update tests and documentation accordingly.
Refactor `deleteRequest` and `patchRequest` to accept `responseType` parameter for improved flexibility. Extract methods for cleaning and processing batch DNS records.
Refactor API method names for consistency (`zoneListAll` → `zoneList`, `zoneInfo` → `zoneGet`, `sldListAll` → `recordList`, `sldInfo` → `recordGet`) and update related documentation and tests.
Replaced the ResultInfo class with a Java record for conciseness and immutability. Adjusted related validation logic and method calls to align with the new record structure. Minor updates to Javadoc documentation were also included.
Refined the condition for exception handling based on 'emptyResultThrowsException' to clarify when exceptions are triggered versus returning empty results. Updated Javadoc output files to reflect the latest documentation changes.