From 7db57451e570eeecae3a52db1804f2f6259ad225 Mon Sep 17 00:00:00 2001
From: Michael Calmer <michael.calmer@suse.com>
Date: Wed, 15 Jan 2025 09:17:44 +0100
Subject: [PATCH] SUSE CDN token identifier changed

---
 .../code/src/com/redhat/rhn/manager/content/MgrSyncUtils.java | 2 +-
 .../rhn/manager/content/test/ContentSyncManagerTest.java      | 4 ++--
 .../com/redhat/rhn/manager/content/test/MgrSyncUtilsTest.java | 2 +-
 java/spacewalk-java.changes.mcalmer.Manager-5.0               | 1 +
 4 files changed, 5 insertions(+), 4 deletions(-)
 create mode 100644 java/spacewalk-java.changes.mcalmer.Manager-5.0

diff --git a/java/code/src/com/redhat/rhn/manager/content/MgrSyncUtils.java b/java/code/src/com/redhat/rhn/manager/content/MgrSyncUtils.java
index 3da83e429b0..43a03f525a5 100644
--- a/java/code/src/com/redhat/rhn/manager/content/MgrSyncUtils.java
+++ b/java/code/src/com/redhat/rhn/manager/content/MgrSyncUtils.java
@@ -321,7 +321,7 @@ else if (queryParam.contains("&")) {
         //     Could be an JWT token
         boolean ret = !queryParam.contains("=") ||
                 // Our CDN tokens use this key
-                queryParam.startsWith("auth=") ||
+                queryParam.startsWith("dlauth=") ||
                 // typical Akamai token values
                 (queryParam.contains("exp=") && queryParam.contains("hmac="));
         LOG.debug("{} isAuthToken: {}", queryParam, ret);
diff --git a/java/code/src/com/redhat/rhn/manager/content/test/ContentSyncManagerTest.java b/java/code/src/com/redhat/rhn/manager/content/test/ContentSyncManagerTest.java
index cf91e340966..c79a10c8530 100644
--- a/java/code/src/com/redhat/rhn/manager/content/test/ContentSyncManagerTest.java
+++ b/java/code/src/com/redhat/rhn/manager/content/test/ContentSyncManagerTest.java
@@ -2568,9 +2568,9 @@ public Optional<String> getTokenFromURLTest(String url) {
         }
         Map<String, Optional<String>> urlMap = Map.of("http://my.host.top/?os=RHEL",
                 Optional.empty(),
-                "http://my.host.top/?auth=exp=1990353599~acl=/repo/$RCE/SLE11-WebYaST-SP2-Updates/sle-11-i586/*" +
+                "http://my.host.top/?dlauth=exp=1990353599~acl=/repo/$RCE/SLE11-WebYaST-SP2-Updates/sle-11-i586/*" +
                         "~hmac=984b6b366f696884d0e3ac619af3a41b2d678eeec523135cc70921c541e5ec60",
-                Optional.of("auth=exp=1990353599~acl=/repo/$RCE/SLE11-WebYaST-SP2-Updates/sle-11-i586/*" +
+                Optional.of("dlauth=exp=1990353599~acl=/repo/$RCE/SLE11-WebYaST-SP2-Updates/sle-11-i586/*" +
                         "~hmac=984b6b366f696884d0e3ac619af3a41b2d678eeec523135cc70921c541e5ec60"),
                 "http://my.host.top/?NoaBh00JIaJwSozVS2BK1G6x27JmfPxfKiiMZBlZ4SD1x3S_VUt7805g_G4XB0ShvcKDO4A5uhzv" +
                         "o74HNzCEAYhMxG8dIw0ZIMla3FzxXCKR5gUaW6PeLjCHG4LrgoXa3zG7KPyy8OQMSAni9F1bs2fqOjKqgQ",
diff --git a/java/code/src/com/redhat/rhn/manager/content/test/MgrSyncUtilsTest.java b/java/code/src/com/redhat/rhn/manager/content/test/MgrSyncUtilsTest.java
index 2f1778daefd..6e1ed239b74 100644
--- a/java/code/src/com/redhat/rhn/manager/content/test/MgrSyncUtilsTest.java
+++ b/java/code/src/com/redhat/rhn/manager/content/test/MgrSyncUtilsTest.java
@@ -173,7 +173,7 @@ public void testurlToFSPathLegacyQuoteNormalize2() throws Exception {
     @Test
     public void testTokens() {
         Map<String, Boolean> tokenMap = Map.of("os=RHEL", false,
-                "auth=exp=1990353599~acl=/repo/$RCE/SLE11-WebYaST-SP2-Updates/sle-11-i586/*~" +
+                "dlauth=exp=1990353599~acl=/repo/$RCE/SLE11-WebYaST-SP2-Updates/sle-11-i586/*~" +
                         "hmac=984b6b366f696884d0e3ac619af3a41b2d678eeec523135cc70921c541e5ec60", true,
                 "NoaBh00JIaJwSozVS2BK1G6x27JmfPxfKiiMZBlZ4SD1x3S_VUt7805g_G4XB0ShvcKDO4A5uhzvo74HNzCEAYh" +
                         "MxG8dIw0ZIMla3FzxXCKR5gUaW6PeLjCHG4LrgoXa3zG7KPyy8OQMSAni9F1bs2fqOjKqgQ", true,
diff --git a/java/spacewalk-java.changes.mcalmer.Manager-5.0 b/java/spacewalk-java.changes.mcalmer.Manager-5.0
new file mode 100644
index 00000000000..1ef8d1777f5
--- /dev/null
+++ b/java/spacewalk-java.changes.mcalmer.Manager-5.0
@@ -0,0 +1 @@
+- SUSE CDN token identifier changed
