- Reject base URLs containing user info, query strings, or fragments - Update README example and changelog to reflect the stricter policy - Adapt tests to use the private CfDnsClient constructor for local HTTP servers - Bump version from 1.0.0-rc.1-SNAPSHOT to 1.0.0-SNAPSHOT in pom.xml and changelog Co-authored-by: Junie <junie@jetbrains.com>
6.5 KiB
6.5 KiB
Changelog
- 1.0.0-SNAPSHOT:
- Breaking Changes:
recordListoverloads replaced, because they were ambiguous (e.g.recordList(zone, null)didn't compile):recordList(zone, String subdomain, RecordType... types)andrecordList(zone, String subdomain)→recordListBySubdomain(zone, subdomain, types...)recordList(zone, RecordType... types)→recordListByType(zone, types...)recordList(zone)andrecordList(zone, PagingRequest)remain unchanged
CfDnsClient#recordCreateSld(...)was removed; userecordCreateSubdomain(...)PagingRequestis now an immutable record withpage()andperPage()accessors. The setters andgetPagingParams()were removed; useforRecords(...),forZones(...),next()andwithPage(...)instead.PagingRequest.defaultPaging()now requests 50 items instead of 1,000. Page numbers and page sizes are validated; zone requests accept 5–50 items per page, while DNS record requests accept 1–5,000,000.withBaseUrlonly accepts HTTPS URLs, otherwise anIllegalArgumentExceptionis thrownbuild()throws anIllegalStateExceptionif no authentication was configured,nullcredentials throw anIllegalArgumentException- zone names and subdomains with whitespace, control characters or
\ ? # & ; | < > " ' ```` are rejected with anIllegalArgumentException, zone and record IDs must be alphanumeric - timestamps of
RecordEntityandZoneEntity(createdOn,modifiedOn,activatedOn) are of typejava.time.Instantinstead ofLocalDateTime, so the time zone (UTC) isn't lost anymore - Cloudflare responses with HTTP status 404 throw a
CloudflareNotFoundException(independent ofemptyResultThrowsException) - unexpected runtime exceptions aren't wrapped into a
CloudflareApiException("Unexpected error!")anymore - batch DELETE sends only the record IDs, batch PATCH sends all writable attributes which aren't
null(before: only the content)
- security: query values (zone names, subdomains) are URL-encoded and IDs are validated, which prevents query parameter injection and path traversal
- Unicode subdomains are converted to Punycode before requests are sent
- connect and response timeouts (defaults: 10 s / 30 s), configurable via
withConnectTimeout/withResponseTimeout CfDnsClientuses one shared HTTP client with connection pooling instead of a new one per request and implementsAutoCloseable, callclose()to release the connectionsCloudflareApiExceptionprovides the HTTP status code (getStatusCode()) and the errors reported by Cloudflare (getErrors())RecordEntitysupports the attributespriority(MX, URI),data(e.g. SRV incl. its priority, CAA),commentandtags; they are also considered by batch operations, as isproxiedrecordCreateandrecordUpdatedon't modify the givenRecordEntityanymore and send only writable attributes- fluent
update(content)sends only the new content (partial update) - filtering by exactly one record type is done by Cloudflare (
?type=), unknown record types in responses don't break the client-side filter anymore - updated dependencies: jackson 3.2.4, httpclient5 5.6.4, lombok 1.18.48, logback-classic 1.6.6, mockito-junit-jupiter 5.24.0
- updated maven plugins: maven-compiler-plugin 3.16.0, maven-surefire-plugin 3.6.0, maven-jar-plugin 3.5.1
- fixed "getRecord" wording in log and exception messages (e.g. "Invalid record type")
- Deprecation: the misleading term "sld" was renamed to "subdomain":
RecordEntity#getSld()is deprecated for removal; useRecordEntity#getSubdomain() getSubdomain()returns"@"for the zone apex;CfDnsClient.APEXcan be used to address the zone apex- fixed: API errors were wrapped into a generic "Unexpected error!" exception
- fixed:
zoneGetthrew anIndexOutOfBoundsExceptionfor unknown zones, it now returnsnullor throws aCloudflareNotFoundException(depending onemptyResultThrowsException) - fixed:
getSubdomain()failed for apex records and records with multi-level subdomains, batch operations now send the full record name- fixed:
zoneList()andrecordList(...)withoutPagingRequestreturned only the first page, now all pages are fetched;recordList(zone, null)uses a page size of 1,000 to limit response memory use
- fixed:
- fixed: DNS records are listed with a stable order (
order=name), because without it Cloudflare's pages can overlap and miss records; fetched records are de-duplicated and inconsistent pages are fetched again - fixed:
recordDeletethrew aNullPointerExceptionfor an empty result
- Breaking Changes:
- 0.5.0:
- moved the project to git.mein-gateway.de
- replaced sonarqube with own actions
- migrate to jackson 3.x
- 0.4.0:
- fixed some paging issues
- Breaking Change: renamed
client.zone().record()toclient.zone().getRecord() - Code quality improvements: Increasing test coverage
- 0.3.0:
- Breaking Change:
- New Fluent API: Changed the initialization of the client(
new CfDnsClientBuilder().withApiTokenAuth("your-api-token").build())
- New Fluent API: Changed the initialization of the client(
- Authentication with API token.
- Breaking Change:
- 0.2.0:
- Breaking Change:
emptyResultThrowsExceptiondefault changed fromtruetofalse. Now applies to both single and multiple result requests. Empty results will be returned by default without throwing exceptions.- API method names refactored for consistency:
zoneListAll→zoneList,zoneInfo→zoneGet,sldListAll→recordList - RecordEntity getter methods renamed for clarity:
getName()→getSld() - New Fluent API: Changed the initialization of the client(
new CfDnsClientBuilder().withApiTokenAuth("your-api-token").build()) and added chainable method interface for more readable DNS operations (client.zone().record()...)
- API method names refactored for consistency:
- Code quality improvements: removed duplication in batch operations, improved type safety in HTTP methods,
optimized string concatenation, removed mutable setters from CfDnsClient
- Enhanced type validation in
RecordEntity.build()with better error messages - CfClient#recordList must return multiple RecordEntries
- add a missing source jar
- ResponseResultInfo#Errors: wrong object structure
- changing multiple records with put, post, patch and delete for dns-records
- Enhanced type validation in
- Breaking Change:
- 0.1.0:
- refactored / extended tests
- 0.1.0-beta.3:
- fixed json deserialization
- added logging of api errors
- 0.1.0-beta.1: 1st runnable version