Skip to content

Commit

Permalink
Merge pull request #206 from marc-vanderwal/feature/#160/part-1
Browse files Browse the repository at this point in the history
Deprecate case randomization feature
  • Loading branch information
marc-vanderwal authored Sep 5, 2024
2 parents 8932dac + c11f083 commit 17b3a80
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Enabled by default.
=item --[no-]randomize
Experimental.
This feature is deprecated and will be removed in Zonemaster 2025.1.
Randomizes the capitalization of returned domain names.
Disabled by default.
Expand Down Expand Up @@ -298,6 +298,7 @@ else {

if ( $opt_randomize ) {
print "Feature randomized capitalization enabled\n";
print "WARNING: This feature is DEPRECATED and will be removed in Zonemaster v2025.1.\n";
cc_define '-DRANDOMIZE';
}
else {
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* [Ed25519]
* [IDN]
* [Internal ldns]
* [Randomized capitalization](#randomized-capitalization)
* [Randomized capitalization (deprecated)](#randomized-capitalization-deprecated)
* [Custom OpenSSL]
* [Custom LDNS]
* [Custom Libidn]
Expand Down Expand Up @@ -166,12 +166,12 @@ When enabled, an included version of ldns is statically linked into
Zonemaster::LDNS.
When disabled, libldns is dynamically linked just like other dependencies.

### Randomized capitalization
### Randomized capitalization (deprecated)

Disabled by default.
Enable with `--randomize`.

> **Note:** This feature is experimental.
> **Note:** This feature is deprecated and will be removed in Zonemaster 2025.1.
Randomizes the capitalization of returned domain names.

Expand Down
1 change: 1 addition & 0 deletions src/assist.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ char *
randomize_capitalization(char *in)
{
#ifdef RANDOMIZE
#warning "Case randomization is deprecated and will be removed in v2025.1."
char *str;
str = in;
while(*str) {
Expand Down
8 changes: 5 additions & 3 deletions t/rr.t
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use v5.16;

use Test::More;
use Test::Fatal;
use Devel::Peek;
Expand Down Expand Up @@ -67,7 +69,7 @@ subtest 'AAAA' => sub {
SKIP: {
skip 'no network', 1 unless $ENV{TEST_WITH_NETWORK};

$p = $s->query( 'a.ns.se', 'AAAA' );
my $p = $s->query( 'a.ns.se', 'AAAA' );
plan skip_all => 'No response, cannot test' if not $p;

foreach my $rr ( $p->answer ) {
Expand Down Expand Up @@ -355,7 +357,7 @@ subtest 'SPF' => sub {
subtest 'DNAME' => sub {
my $rr = Zonemaster::LDNS::RR->new( 'examplë.fake 3600 IN DNAME example.fake' );
isa_ok( $rr, 'Zonemaster::LDNS::RR::DNAME' );
is($rr->dname(), 'example.fake.');
is(fc($rr->dname()), fc('example.fake.'));
};

subtest 'croak when given malformed CAA records' => sub {
Expand All @@ -366,7 +368,7 @@ subtest 'croak when given malformed CAA records' => sub {
# This will always croak
$bad_caa->string();
};
like( exception { $will_croak->() }, qr/^Failed to convert RR to string/ );
like( exception(sub { $will_croak->() }), qr/^Failed to convert RR to string/ );
};

done_testing;

0 comments on commit 17b3a80

Please sign in to comment.