From a8e70c730b3fcedf21ad979aeaa27c169210c053 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sun, 15 Mar 2026 15:00:58 -0700 Subject: [PATCH 1/3] doc(CONTRIBUTORS): updated --- .release | 2 +- CONTRIBUTORS.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release b/.release index 03a6c1a..648aa35 160000 --- a/.release +++ b/.release @@ -1 +1 @@ -Subproject commit 03a6c1ae3688bb05c658a775ec5d66086aa18bba +Subproject commit 648aa356cba200c1a46f4bda9e29871d1e9ba557 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c2e6fcf..26f7985 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,8 +2,8 @@ This handcrafted artisanal software is brought to you by: -|
msimerson (23) | -| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +|
msimerson (24)| +| :---: | this file is generated by [.release](https://github.com/msimerson/.release). Contribute to this project to get your GitHub profile included here. From f7bb3a8eadf44e6a4046ae8854551b89f91fea5e Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sun, 15 Mar 2026 15:13:13 -0700 Subject: [PATCH 2/3] zone.GET_req: add search params - zone_rec.owner: disable domain/hostname validation - zone_rec: add algorithm - zone_rec: change gateway type to a number - zone_rec: add timestamp --- CHANGELOG.md | 11 ++++++++++- lib/zone.js | 7 +++++++ lib/zone_record.js | 13 +++++++++++-- lib/zone_record.test.js | 10 +++++++++- package.json | 4 ++-- 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e626e..5a9338b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Unreleased +### [0.8.5] - 2026-03-15 + +- zone.GET_req: add search params +- zone_rec.owner: disable domain/hostname validation +- zone_rec: add algorithm +- zone_rec: change gateway type to a number +- zone_rec: add timestamp + ### [0.8.4] - 2026-03-14 - disable domain validation, until joi.string.domain supports / @@ -95,7 +103,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). [0.6.3]: https://github.com/NicTool/validate/releases/tag/v0.6.3 [0.7.0]: https://github.com/NicTool/validate/releases/tag/0.7.0 [0.7.1]: https://github.com/NicTool/validate/releases/tag/v0.7.1 -[0.7.2]: https://github.com/NicTool/validate/releases/tag/0.7.2 +[0.7.2]: https://github.com/NicTool/validate/releases/tag/v0.7.2 [0.7.3]: https://github.com/NicTool/validate/releases/tag/0.7.3 [0.7.4]: https://github.com/NicTool/validate/releases/tag/v0.7.4 [0.8.0]: https://github.com/NicTool/validate/releases/tag/v0.8.0 @@ -103,3 +111,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). [0.8.2]: https://github.com/NicTool/validate/releases/tag/v0.8.2 [0.8.3]: https://github.com/NicTool/validate/releases/tag/v0.8.3 [0.8.4]: https://github.com/NicTool/validate/releases/tag/v0.8.4 +[0.8.5]: https://github.com/NicTool/validate/releases/tag/v0.8.5 diff --git a/lib/zone.js b/lib/zone.js index 84d63a5..6456c8c 100644 --- a/lib/zone.js +++ b/lib/zone.js @@ -42,6 +42,13 @@ exports.v3 = Joi.object({ exports.GET_req = Joi.object({ id: exports.id, zone: exports.zone, + search: Joi.string().max(255).allow(''), + zone_like: Joi.string().max(255).allow(''), + description_like: Joi.string().max(255).allow(''), + limit: shared.uint32, + offset: shared.uint32, + sort_by: Joi.string().valid('id', 'zone', 'description', 'last_modified'), + sort_dir: Joi.string().lowercase().valid('asc', 'desc'), deleted: Joi.boolean(), }) diff --git a/lib/zone_record.js b/lib/zone_record.js index 905d1d6..44049e7 100644 --- a/lib/zone_record.js +++ b/lib/zone_record.js @@ -7,7 +7,12 @@ exports.id = shared.uint32.min(1).required() exports.owner = Joi.string() .min(1) .max(255) - .domain({ minDomainSegments: 1, allowFullyQualified: false, tlds: false }) + // .hostname({ + // minDomainSegments: 1, + // allowFullyQualified: false, + // allowUnderscore: true, + // tlds: false, + // }) .required() exports.v3 = Joi.object({ @@ -61,6 +66,8 @@ exports.v3 = Joi.object({ address: Joi.string().min(2).max(39), + algorithm: Joi.number().integer().min(0).max(255), + cname: Joi.string(), data: Joi.string(), @@ -77,7 +84,7 @@ exports.v3 = Joi.object({ gateway: Joi.string().empty(''), - 'gateway type': Joi.string().empty(''), + 'gateway type': Joi.number().empty(''), location: Joi.string().empty(''), @@ -105,6 +112,8 @@ exports.v3 = Joi.object({ target: Joi.string(), + timestamp: Joi.date(), + weight: shared.uint16, value: Joi.string(), diff --git a/lib/zone_record.test.js b/lib/zone_record.test.js index 8b2081e..eb81b9b 100644 --- a/lib/zone_record.test.js +++ b/lib/zone_record.test.js @@ -68,8 +68,16 @@ describe('zone_record', function () { assert.strictEqual(error.message, '"owner" is not allowed to be empty') }) + it('accepts underscores in labels', () => { + const testCase = JSON.parse(JSON.stringify(testZR)) + testCase.owner = '_acme-challenge.example' + const { error, value } = schema.validate(testCase) + assert.ifError(error) + assert.deepEqual(value, testCase) + }) + for (const owner of ['a.m.', 'something.test.']) { - it(`rejects invalid: ${owner}`, () => { + it.skip(`rejects invalid: ${owner}`, () => { const testCase = JSON.parse(JSON.stringify(testZR)) testCase.owner = owner const { error } = schema.validate(testCase) diff --git a/package.json b/package.json index 5adeada..d275e31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nictool/validate", - "version": "0.8.4", + "version": "0.8.5", "description": "NicTool Object Validation", "files": [ "lib", @@ -66,4 +66,4 @@ "trailingComma": "all", "printWidth": 100 } -} +} \ No newline at end of file From 24d854f10cac276d9b976005d805b30af1acba65 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Sun, 15 Mar 2026 15:13:26 -0700 Subject: [PATCH 3/3] chore: format --- CONTRIBUTORS.md | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 26f7985..e1fe672 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,8 +2,8 @@ This handcrafted artisanal software is brought to you by: -|
msimerson (24)| -| :---: | +|
msimerson (24) | +| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | this file is generated by [.release](https://github.com/msimerson/.release). Contribute to this project to get your GitHub profile included here. diff --git a/package.json b/package.json index d275e31..2383930 100644 --- a/package.json +++ b/package.json @@ -66,4 +66,4 @@ "trailingComma": "all", "printWidth": 100 } -} \ No newline at end of file +}