Package: release.debian.org
Severity: normal
Tags: buster
User: release.debian@packages.debian.org
Usertags: pu
X-Debbugs-Cc: debian-p...@lists.debian.org
[ Reason ]
USPS is sending notices that HTTP access will be turned off shortly, in
favor of HTTPS.
Given that is a web service that will break in the wild, in addition to
a regular update for unstable, we should update buster (and stretch)
via stable-updates (and oldstable-updates).
[ Impact ]
libbusiness-us-usps-webtools-perl will be unusable after June 24th,
2021.
[ Tests ]
(What automated or manual tests cover the affected code?)
[ Risks ]
Patch is a backport of 1.124 -> 1.125 adapted for 1.122. Even if there
is a little risk (since I'm not able to fully test it), not updating
this package is a more elevated risk.
[ Checklist ]
[X] *all* changes are documented in the d/changelog
[X] I reviewed all changes and I approve them
[X] attach debdiff against the package in (old)stable
[X] the issue is verified as fixed in unstable
[ Changes ]
API change
Cheers,
Yadd
diff --git a/debian/changelog b/debian/changelog
index 3a65ac0..964b422 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libbusiness-us-usps-webtools-perl (1.122-1+deb10u1) buster; urgency=medium
+
+ * Update to new US-USPS API (Closes: #988330)
+
+ -- Yadd Sat, 22 May 2021 12:17:01 +0200
+
libbusiness-us-usps-webtools-perl (1.122-1) unstable; urgency=medium
[ gregor herrmann ]
diff --git a/debian/patches/series b/debian/patches/series
index 38edaa7..4562936 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
spelling-errors.patch
+update-us-usps-webtools-to-https.patch
diff --git a/debian/patches/update-us-usps-webtools-to-https.patch
b/debian/patches/update-us-usps-webtools-to-https.patch
new file mode 100644
index 000..7269fd1
--- /dev/null
+++ b/debian/patches/update-us-usps-webtools-to-https.patch
@@ -0,0 +1,307 @@
+Description: update due to US-USPS changes
+Author: Xavier Guimard
+Forwarded: not-needed
+Last-Update: 2021-05-21
+
+--- a/lib/Business/US/USPS/WebTools.pm
b/lib/Business/US/USPS/WebTools.pm
+@@ -41,7 +41,7 @@
+ =cut
+
+ my $LiveServer = "production.shippingapis.com";
+-my $TestServer = "testing.shippingapis.com";
++my $TestServer = "stg-production.shippingapis.com";
+
+ =item new( ANONYMOUS_HASH )
+
+@@ -123,7 +123,7 @@
+ $_[0]->_live ?
+ "/ShippingAPI.dll"
+ :
+- "/ShippingAPITest.dll"
++ "/ShippingAPI.dll"
+ }
+
+ sub _make_query_string {
+@@ -145,7 +145,7 @@
+ sub _make_url {
+ my( $self, $hash ) = @_;
+
+- $self->{url} = qq|http://| . $self->_api_host . $self->_api_path .
++ $self->{url} = qq|https://| . $self->_api_host . $self->_api_path .
+ "?" . $self->_make_query_string( $hash );
+ }
+
+--- a/t/address_verification.t
b/t/address_verification.t
+@@ -21,23 +21,35 @@
+ "environment variables to run these tests\n";
+ }
+
++my $is_testing = uc($ENV{USPS_WEBTOOLS_ENVIRONMENT}) eq 'TESTING';
++
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
+ use_ok( $class );
+
+ my $verifier;
+-my $base =
qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=%3CAddressValidateRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CIncludeOptionalElements%3Etrue%3C%2FIncludeOptionalElements%3E%3CReturnCarrierRoute%3Etrue%3C%2FReturnCarrierRoute%3E|;
++
++my $base = 'https://' . ($is_testing ? 'stg-' : '') .
qq|production.shippingapis.com/ShippingAPI.dll?API=Verify&XML=%3CAddressValidateRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CIncludeOptionalElements%3Etrue%3C%2FIncludeOptionalElements%3E%3CReturnCarrierRoute%3Etrue%3C%2FReturnCarrierRoute%3E|;
+
+ subtest setup => sub {
+ $verifier = $class->new( {
+ UserID => $ENV{USPS_WEBTOOLS_USERID},
+ Password => $ENV{USPS_WEBTOOLS_PASSWORD},
+- Testing => 1,
++Testing => $is_testing,
+ } );
+ isa_ok( $verifier, $class );
+
+ can_ok( $verifier, $method );
+ };
+
++=pod
++
++2021-05-19: This test is failing because the API is no longer returning the
++expected output; it now includes the following warning:
++
++Default address: The address you entered was found but more information is
++needed (such as an apartment, suite, or box number) to match to a specific
++address.
++
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
+ # Good response #1
+ subtest good_response_1 => sub {
+@@ -81,6 +93,8 @@
+ is( $hash->{Zip4}, '1441', 'Zip4 matches for
Ivy Lane' );
+ };
+
++=cut
++
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
+ # Good response #2
+ subtest good_response_