From e5d0c5b78856b84511e4a7462db9f57a2476a903 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Fri, 16 Jul 2021 11:55:48 +0530
Subject: [PATCH 01/30] Apps/appinstall is replaced with apps/local.

Update:
- Apps/appinstall is replaced with apps/local.
- Application Path is replaced with just application name while loading app.
---
 splunk/src/test/java/com/splunk/SDKTestCase.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/splunk/src/test/java/com/splunk/SDKTestCase.java b/splunk/src/test/java/com/splunk/SDKTestCase.java
index 100899af..0ea6617d 100644
--- a/splunk/src/test/java/com/splunk/SDKTestCase.java
+++ b/splunk/src/test/java/com/splunk/SDKTestCase.java
@@ -248,10 +248,12 @@ public void installApplicationFromTestData(String applicationName) {
         String appPath = Util.join(separator, pathComponents);
 
         Args args = new Args();
-        args.put("name", appPath);
+        // Application name is used here instead of appPath. As folder name in appPath should not contain special characters & spaces.
+        args.put("name", applicationName);
+        args.put("filename", false);
         args.put("update", "1");
-        service.post("apps/appinstall", args);
-        
+        service.post("apps/local", args);
+
         installedApps.add(applicationName);
     }
     

From 11fd633fa88e20dce7ce43409e09120ed4aee7ba Mon Sep 17 00:00:00 2001
From: Abhi Shah <abhis@splunk.com>
Date: Wed, 4 Aug 2021 20:36:23 +0530
Subject: [PATCH 02/30] Test Case for the PR 150

---
 splunk/src/main/java/com/splunk/Service.java         | 10 ++++++++++
 splunk/src/test/java/com/splunk/SavedSearchTest.java | 10 +++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/splunk/src/main/java/com/splunk/Service.java b/splunk/src/main/java/com/splunk/Service.java
index 8856c1e2..2ae6b01a 100644
--- a/splunk/src/main/java/com/splunk/Service.java
+++ b/splunk/src/main/java/com/splunk/Service.java
@@ -1013,6 +1013,16 @@ public SavedSearchCollection getSavedSearches(Args args) {
         return new SavedSearchCollection(this, args);
     }
 
+    /**
+     * Returns a Saved Search by the provided title key.
+     *
+     * @param title The title for a job.
+     * @return A SavedSearch.
+     */
+    public SavedSearch getSavedSearch(String title) {
+        return new SavedSearch(this, JobCollection.REST_PATH + "/" + title);
+    }
+
     /**
      * Returns service configuration information for an instance of Splunk.
      *
diff --git a/splunk/src/test/java/com/splunk/SavedSearchTest.java b/splunk/src/test/java/com/splunk/SavedSearchTest.java
index 2ccc93ad..fcaf672b 100644
--- a/splunk/src/test/java/com/splunk/SavedSearchTest.java
+++ b/splunk/src/test/java/com/splunk/SavedSearchTest.java
@@ -314,7 +314,15 @@ public void testScheduled() {
         
         savedSearch.remove();
     }
-    
+
+    @Test
+    public void testGetSavedSearchByTitle(){
+        try{
+            SavedSearch fetchedSavedSearch = this.savedSearches.getService().getSavedSearch(savedSearchName);
+            Assert.assertEquals(fetchedSavedSearch.getName(),savedSearch.getName());
+        }catch (Exception e) { }
+    }
+
     @Test
     public void testCreateWithNoSearch() {
         try {

From 992b81f60567b40c9f210561bb6123acd33e7cf5 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Fri, 16 Jul 2021 11:55:48 +0530
Subject: [PATCH 03/30] Apps/appinstall is replaced with apps/local.

Update:
- Apps/appinstall is replaced with apps/local.
- Application Path is replaced with just application name while loading app.
---
 splunk/src/test/java/com/splunk/SDKTestCase.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/splunk/src/test/java/com/splunk/SDKTestCase.java b/splunk/src/test/java/com/splunk/SDKTestCase.java
index 100899af..0ea6617d 100644
--- a/splunk/src/test/java/com/splunk/SDKTestCase.java
+++ b/splunk/src/test/java/com/splunk/SDKTestCase.java
@@ -248,10 +248,12 @@ public void installApplicationFromTestData(String applicationName) {
         String appPath = Util.join(separator, pathComponents);
 
         Args args = new Args();
-        args.put("name", appPath);
+        // Application name is used here instead of appPath. As folder name in appPath should not contain special characters & spaces.
+        args.put("name", applicationName);
+        args.put("filename", false);
         args.put("update", "1");
-        service.post("apps/appinstall", args);
-        
+        service.post("apps/local", args);
+
         installedApps.add(applicationName);
     }
     

From be182261e47ff5f78d7e8fc177f35f2c4adbf6cd Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Mon, 9 Aug 2021 17:34:57 +0530
Subject: [PATCH 04/30] Modular input change introduced

Update:
- Modular input folder name is renamed as modular_input.
- Ignored test cases are enabled again for execution.
- Docker file points to newer sdkappcollection.
---
 docker-compose.yml                            |  2 +-
 .../test/java/com/splunk/ApplicationTest.java |  1 -
 .../src/test/java/com/splunk/IndexTest.java   |  3 --
 .../test/java/com/splunk/InputCrudTest.java   |  7 ++---
 .../com/splunk/ModularInputKindsTest.java     | 30 +++++++------------
 .../java/com/splunk/ModularInputTest.java     |  6 ++--
 .../src/test/java/com/splunk/SDKTestCase.java | 16 +++++-----
 .../test/java/com/splunk/SearchJobTest.java   |  7 -----
 8 files changed, 24 insertions(+), 48 deletions(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index bfee5176..ae2830ab 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -8,7 +8,7 @@ services:
             - SPLUNK_START_ARGS=--accept-license
             - SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
             - SPLUNK_PASSWORD=changed!
-            - SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.0.0/sdk-app-collection.tgz
+            - SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.2.0/sdkappcollection.tgz
         ports:
             - 8000:8000
             - 8088:8088
diff --git a/splunk/src/test/java/com/splunk/ApplicationTest.java b/splunk/src/test/java/com/splunk/ApplicationTest.java
index 7637c0b2..df8afe2a 100644
--- a/splunk/src/test/java/com/splunk/ApplicationTest.java
+++ b/splunk/src/test/java/com/splunk/ApplicationTest.java
@@ -76,7 +76,6 @@ public void testForEmptySetup() {
         Assert.assertTrue(setupXml.contains("stub"));
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testForSetupPresent() throws Exception {
         if (!hasTestData()) {
diff --git a/splunk/src/test/java/com/splunk/IndexTest.java b/splunk/src/test/java/com/splunk/IndexTest.java
index 01baac66..a98dd56a 100644
--- a/splunk/src/test/java/com/splunk/IndexTest.java
+++ b/splunk/src/test/java/com/splunk/IndexTest.java
@@ -688,7 +688,6 @@ public boolean predicate() {
         });
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testUploadArgs() throws Exception {
         if (!hasTestData()) {
@@ -732,7 +731,6 @@ public boolean predicate() {
         });
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testUploadArgsFailure() throws Exception{
         if (!hasTestData()) {
@@ -764,7 +762,6 @@ public void testUploadArgsFailure() throws Exception{
 
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testUpload() throws Exception {
         if (!hasTestData()) {
diff --git a/splunk/src/test/java/com/splunk/InputCrudTest.java b/splunk/src/test/java/com/splunk/InputCrudTest.java
index 656e2fcb..d0d3a1f7 100644
--- a/splunk/src/test/java/com/splunk/InputCrudTest.java
+++ b/splunk/src/test/java/com/splunk/InputCrudTest.java
@@ -248,7 +248,6 @@ public boolean predicate() {
         });
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testScriptInputCrud() {
         if (!hasTestData()) {
@@ -256,16 +255,16 @@ public void testScriptInputCrud() {
             return;
         }
 
-        installApplicationFromTestData("modular-inputs");
+        installApplicationFromTestData("modular_inputs");
 
         // Determine what script to use for the input
         String filename;
         if (service.getInfo().getOsName().equals("Windows")) {
             // Windows
-            filename = "etc\\apps\\modular-inputs\\bin\\echo.bat";
+            filename = "etc\\apps\\modular_inputs\\bin\\echo.bat";
         } else {
             // Linux or Mac OS X
-            filename = "etc/apps/modular-inputs/bin/echo.sh";
+            filename = "etc/apps/modular_inputs/bin/echo.sh";
         }
 
         // Create
diff --git a/splunk/src/test/java/com/splunk/ModularInputKindsTest.java b/splunk/src/test/java/com/splunk/ModularInputKindsTest.java
index 8b07de0a..8c7d7fff 100644
--- a/splunk/src/test/java/com/splunk/ModularInputKindsTest.java
+++ b/splunk/src/test/java/com/splunk/ModularInputKindsTest.java
@@ -29,7 +29,7 @@ public void checkModularInputKind(ModularInputKind m) {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
 
@@ -43,28 +43,25 @@ public void checkModularInputKind(ModularInputKind m) {
 
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testListInputKinds() {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
-
         for (ModularInputKind kind : inputKinds.values()) {
             checkModularInputKind(kind);
         }
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testInputByName() {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
         ModularInputKind m;
@@ -74,13 +71,12 @@ public void testInputByName() {
         checkModularInputKind(m);
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testNonexistantArg() {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
         ModularInputKind test1 = inputKinds.get("test1");
@@ -88,13 +84,12 @@ public void testNonexistantArg() {
         Assert.assertNull(test1.getArgument("nonexistant_argument"));
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testInputKindDescriptionAndTitle() {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
         ModularInputKind test1 = inputKinds.get("test1");
@@ -107,13 +102,12 @@ public void testInputKindDescriptionAndTitle() {
         Assert.assertEquals("test2", test2.getTitle());
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testArgDescription() {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
 
@@ -135,13 +129,12 @@ public void testArgDescription() {
         }
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testArgDataType() {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
 
@@ -162,13 +155,12 @@ public void testArgDataType() {
         }
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testRequiredOnCreate() {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
 
@@ -187,13 +179,12 @@ public void testRequiredOnCreate() {
         }
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testRequiredOnEdit() {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
 
@@ -212,13 +203,12 @@ public void testRequiredOnEdit() {
         }
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testGetArguments() {
         if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             inputKinds = service.getModularInputKinds();
         }
 
diff --git a/splunk/src/test/java/com/splunk/ModularInputTest.java b/splunk/src/test/java/com/splunk/ModularInputTest.java
index 17dd8b4d..7e3ca981 100644
--- a/splunk/src/test/java/com/splunk/ModularInputTest.java
+++ b/splunk/src/test/java/com/splunk/ModularInputTest.java
@@ -21,13 +21,12 @@
 import org.junit.Test;
 
 public class ModularInputTest extends InputTest {
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testModularInputKinds() {
         if (service.versionCompare("5.0") < 0 || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             // Will not pick up the new inputs unless a restart is done.
             // Nevertheless Splunk does not request a restart after app installation.
             uncheckedSplunkRestart();
@@ -43,13 +42,12 @@ public void testModularInputKinds() {
         Assert.assertTrue(hasTest2);
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testListModularInputs() {
         if (service.versionCompare("5.0") < 0 || !hasTestData()) {
             return;
         } else {
-            installApplicationFromTestData("modular-inputs");
+            installApplicationFromTestData("modular_inputs");
             // Will not pick up the new inputs unless a restart is done.
             // Nevertheless Splunk does not request a restart after app installation.
             uncheckedSplunkRestart();
diff --git a/splunk/src/test/java/com/splunk/SDKTestCase.java b/splunk/src/test/java/com/splunk/SDKTestCase.java
index 0ea6617d..4e6a6986 100644
--- a/splunk/src/test/java/com/splunk/SDKTestCase.java
+++ b/splunk/src/test/java/com/splunk/SDKTestCase.java
@@ -213,13 +213,13 @@ public static boolean assertEventuallyTrue(EventuallyTrueBehavior behavior) {
     // === Test Data Installation ===
 
     public boolean hasTestData() {
-        String collectionName = "sdk-app-collection";
-        return service.getApplications().containsKey("sdk-app-collection");
+        String collectionName = "sdkappcollection";
+        return service.getApplications().containsKey("sdkappcollection");
     }
 
     public void installApplicationFromTestData(String applicationName) {
-        String collectionName = "sdk-app-collection";
-        if (!service.getApplications().containsKey("sdk-app-collection")) {
+        String collectionName = "sdkappcollection";
+        if (!service.getApplications().containsKey("sdkappcollection")) {
             throw new TestDataNotInstalledException();
         }
 
@@ -248,10 +248,10 @@ public void installApplicationFromTestData(String applicationName) {
         String appPath = Util.join(separator, pathComponents);
 
         Args args = new Args();
-        // Application name is used here instead of appPath. As folder name in appPath should not contain special characters & spaces.
-        args.put("name", applicationName);
-        args.put("filename", false);
-        args.put("update", "1");
+
+        args.put("name", appPath);
+        args.put("filename", true);
+        args.put("update", true);
         service.post("apps/local", args);
 
         installedApps.add(applicationName);
diff --git a/splunk/src/test/java/com/splunk/SearchJobTest.java b/splunk/src/test/java/com/splunk/SearchJobTest.java
index 6afc6c70..5993417d 100644
--- a/splunk/src/test/java/com/splunk/SearchJobTest.java
+++ b/splunk/src/test/java/com/splunk/SearchJobTest.java
@@ -656,7 +656,6 @@ public void testAttributes() {
         job.cancel();
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testEnablePreview() throws InterruptedException {
         if (!hasTestData()) {
@@ -709,7 +708,6 @@ public boolean predicate() {
         waitForSleepingJobToDie(job);
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testDisablePreview() throws InterruptedException {
         if (!hasTestData()) {
@@ -782,7 +780,6 @@ public boolean predicate() {
         } catch (InterruptedException e) {}
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testSetPriority() throws InterruptedException {
         if (!hasTestData()) {
@@ -833,7 +830,6 @@ public boolean predicate() {
         job.cancel();
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testPause() throws InterruptedException {
         if (!hasTestData()) {
@@ -867,7 +863,6 @@ public boolean predicate() {
         job.cancel();
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testUnpause() throws InterruptedException {
         if (!hasTestData()) {
@@ -901,7 +896,6 @@ public boolean predicate() {
         job.cancel();
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testFinalize() throws InterruptedException {
         if (!hasTestData()) {
@@ -932,7 +926,6 @@ public boolean predicate() {
         job.cancel();
     }
 
-    @Ignore("apps/appinstall endpoint is removed in version 8.1.0")
     @Test
     public void testDone() throws InterruptedException {
         if (!hasTestData()) {

From b3cdb95b3034468cd0d8fd57d57adaa39266c16a Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Tue, 10 Aug 2021 10:04:50 +0530
Subject: [PATCH 05/30] Splunk Apps URL added in Github actions test

---
 .github/workflows/test.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 14caac84..1783cb61 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -26,6 +26,7 @@ jobs:
           TEST_TCP_PORT: 10667
           TEST_UDP_PORT: 10668
           SPLUNK_HOME: "/opt/splunk"
+          SPLUNK_APPS_URL: https://github.com/splunk/sdk-app-collection/releases/download/v1.2.0/sdkappcollection.tgz
         ports:
           - 8000:8000
           - 8089:8089

From 9370c443b4b0aa6cf9deb55277cdc647c5bddff4 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Tue, 10 Aug 2021 10:57:01 +0530
Subject: [PATCH 06/30] Github workflow test modified.

---
 .github/workflows/test.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 1783cb61..3ebdfde4 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -59,7 +59,7 @@ jobs:
           echo version=${{ matrix.splunk }} >> .splunkrc
 
       - name: Test using maven
-        run: make test
+        run: mvn test -fae
         env:
           SPLUNK_HOME: "/opt/splunk"
           TEST_TCP_PORT: 10667

From 46f6a2449f81595cb4766398bc25f545170b459e Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Tue, 10 Aug 2021 15:33:36 +0530
Subject: [PATCH 07/30] SDK App collection URL updated.

---
 .github/workflows/test.yml | 2 +-
 docker-compose.yml         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3ebdfde4..8be22ddd 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -26,7 +26,7 @@ jobs:
           TEST_TCP_PORT: 10667
           TEST_UDP_PORT: 10668
           SPLUNK_HOME: "/opt/splunk"
-          SPLUNK_APPS_URL: https://github.com/splunk/sdk-app-collection/releases/download/v1.2.0/sdkappcollection.tgz
+          SPLUNK_APPS_URL: https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
         ports:
           - 8000:8000
           - 8089:8089
diff --git a/docker-compose.yml b/docker-compose.yml
index ae2830ab..1e3f76b9 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -8,7 +8,7 @@ services:
             - SPLUNK_START_ARGS=--accept-license
             - SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
             - SPLUNK_PASSWORD=changed!
-            - SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.2.0/sdkappcollection.tgz
+            - SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
         ports:
             - 8000:8000
             - 8088:8088

From c4b973721b957889583f3e9d8070c11653b3992b Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Fri, 16 Jul 2021 11:55:48 +0530
Subject: [PATCH 08/30] Apps/appinstall is replaced with apps/local.

Update:
- Apps/appinstall is replaced with apps/local.
- Application Path is replaced with just application name while loading app.
---
 .idea/misc.xml | 29 -----------------------------
 1 file changed, 29 deletions(-)
 delete mode 100644 .idea/misc.xml

diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 7ffb7835..00000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="EntryPointsManager">
-    <entry_points version="2.0" />
-  </component>
-  <component name="JavadocGenerationManager">
-    <option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/out/docs" />
-    <option name="OPTION_SCOPE" value="protected" />
-    <option name="OPTION_HIERARCHY" value="true" />
-    <option name="OPTION_NAVIGATOR" value="true" />
-    <option name="OPTION_INDEX" value="true" />
-    <option name="OPTION_SEPARATE_INDEX" value="true" />
-    <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
-    <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
-    <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
-    <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
-    <option name="OPTION_DEPRECATED_LIST" value="true" />
-    <option name="OTHER_OPTIONS" />
-    <option name="HEAP_SIZE" />
-    <option name="LOCALE" />
-    <option name="OPEN_IN_BROWSER" value="true" />
-  </component>
-  <component name="ProjectResources">
-    <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
-  </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
-    <output url="file://$PROJECT_DIR$/out" />
-  </component>
-</project>
\ No newline at end of file

From d17415581788e2a86249769e8f606f8feb6da73b Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Tue, 10 Aug 2021 10:04:50 +0530
Subject: [PATCH 09/30] Splunk Apps URL added in Github actions test

---
 .github/workflows/test.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 14caac84..1783cb61 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -26,6 +26,7 @@ jobs:
           TEST_TCP_PORT: 10667
           TEST_UDP_PORT: 10668
           SPLUNK_HOME: "/opt/splunk"
+          SPLUNK_APPS_URL: https://github.com/splunk/sdk-app-collection/releases/download/v1.2.0/sdkappcollection.tgz
         ports:
           - 8000:8000
           - 8089:8089

From 70295971dcdc090121128fb4257434fbd3ba49ea Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Tue, 10 Aug 2021 10:57:01 +0530
Subject: [PATCH 10/30] Github workflow test modified.

---
 .github/workflows/test.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 1783cb61..3ebdfde4 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -59,7 +59,7 @@ jobs:
           echo version=${{ matrix.splunk }} >> .splunkrc
 
       - name: Test using maven
-        run: make test
+        run: mvn test -fae
         env:
           SPLUNK_HOME: "/opt/splunk"
           TEST_TCP_PORT: 10667

From 0781f7cc4f6c0663557025b63039362a314f5f00 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Tue, 10 Aug 2021 15:33:36 +0530
Subject: [PATCH 11/30] SDK App collection URL updated.

---
 .github/workflows/test.yml | 2 +-
 docker-compose.yml         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3ebdfde4..8be22ddd 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -26,7 +26,7 @@ jobs:
           TEST_TCP_PORT: 10667
           TEST_UDP_PORT: 10668
           SPLUNK_HOME: "/opt/splunk"
-          SPLUNK_APPS_URL: https://github.com/splunk/sdk-app-collection/releases/download/v1.2.0/sdkappcollection.tgz
+          SPLUNK_APPS_URL: https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
         ports:
           - 8000:8000
           - 8089:8089
diff --git a/docker-compose.yml b/docker-compose.yml
index ae2830ab..1e3f76b9 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -8,7 +8,7 @@ services:
             - SPLUNK_START_ARGS=--accept-license
             - SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
             - SPLUNK_PASSWORD=changed!
-            - SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.2.0/sdkappcollection.tgz
+            - SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
         ports:
             - 8000:8000
             - 8088:8088

From b4f075e2b1d49258cfceec00ecb9fc26d8537834 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Mon, 13 Sep 2021 12:03:35 +0530
Subject: [PATCH 12/30] Methods for setting Splunk and Bearer token added.

---
 splunk/src/main/java/com/splunk/Service.java  | 20 ++++++++++++++++
 .../src/test/java/com/splunk/ServiceTest.java | 23 +++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/splunk/src/main/java/com/splunk/Service.java b/splunk/src/main/java/com/splunk/Service.java
index 2ae6b01a..7749ba29 100644
--- a/splunk/src/main/java/com/splunk/Service.java
+++ b/splunk/src/main/java/com/splunk/Service.java
@@ -1319,6 +1319,26 @@ public void setToken(String value) {
         this.token = value;
     }
 
+    /**
+     * Provides a session token having <b>Splunk</b> added before token.
+     * This method is specifically used when user just have token value.
+     *
+     * @param value The token value
+     */
+    public void setSplunkToken(String value) {
+        this.token = value.contains("Splunk") ? value : "Splunk " + value;
+    }
+
+    /**
+     * Provides a session token having <b>Bearer</b> added before token.
+     * This method is specifically used when user just have token value.
+     *
+     * @param value The token value
+     */
+    public void setBearerToken(String value) {
+        this.token = value.contains("Splunk") || value.contains("Bearer") ? value : "Bearer " + value;
+    }
+
     /**
      * Returns true if this Splunk instance's version is no earlier than
      * the version specified in {@code version}.
diff --git a/splunk/src/test/java/com/splunk/ServiceTest.java b/splunk/src/test/java/com/splunk/ServiceTest.java
index b1681afe..2de9e93a 100644
--- a/splunk/src/test/java/com/splunk/ServiceTest.java
+++ b/splunk/src/test/java/com/splunk/ServiceTest.java
@@ -218,6 +218,29 @@ public void testLoginWithToken() {
         Assert.assertEquals(s.getToken(), validToken);
     }
 
+    @Test
+    public void testWithOnlyToken() {
+        String validToken = service.getToken();
+
+        ServiceArgs args = new ServiceArgs();
+        args.setHost((String) command.opts.get("host"));
+        args.setUsername((String) command.opts.get("username"));
+        args.setPassword((String) command.opts.get("password"));
+        args.setPort((Integer) command.opts.get("port"));
+        args.setScheme((String) command.opts.get("scheme"));
+
+        Service service2 = new Service(args);
+        service2.login();
+
+        // Manually removing Splunk keyword from preset token.
+        String modifiedToken = (service2.getToken().replace("Splunk", "")).trim();
+        service2.setSplunkToken(modifiedToken);
+
+        service2.getSettings().refresh();
+
+        Assert.assertEquals(service2.getToken(), validToken);
+    }
+
     @Test
     public void testLoginGetters() {
         Service s = new Service("theHost");

From fb9ff3816e6112baa6aa144dbbf3ce2e0ec7d20f Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Mon, 13 Sep 2021 12:15:26 +0530
Subject: [PATCH 13/30] Method name modified

---
 splunk/src/test/java/com/splunk/ServiceTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/splunk/src/test/java/com/splunk/ServiceTest.java b/splunk/src/test/java/com/splunk/ServiceTest.java
index 2de9e93a..755765cb 100644
--- a/splunk/src/test/java/com/splunk/ServiceTest.java
+++ b/splunk/src/test/java/com/splunk/ServiceTest.java
@@ -219,7 +219,7 @@ public void testLoginWithToken() {
     }
 
     @Test
-    public void testWithOnlyToken() {
+    public void testLoginWithOnlyTokenValue() {
         String validToken = service.getToken();
 
         ServiceArgs args = new ServiceArgs();

From 4dfeeabaeee101fa760300df6329d3111f1e745e Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Mon, 13 Sep 2021 12:48:31 +0530
Subject: [PATCH 14/30] Deploy plugin is removed from splunk module.

---
 examples/pom.xml | 1 +
 splunk/pom.xml   | 8 --------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/examples/pom.xml b/examples/pom.xml
index dfa0fc91..bd80052e 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -21,6 +21,7 @@
                     <skipTests>true</skipTests>
                 </configuration>
             </plugin>
+            <!-- Deploy plugin is overridden here because we are skipping deployment in case of examples module. -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-deploy-plugin</artifactId>
diff --git a/splunk/pom.xml b/splunk/pom.xml
index 4c376624..46eb0625 100644
--- a/splunk/pom.xml
+++ b/splunk/pom.xml
@@ -91,14 +91,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-deploy-plugin</artifactId>
-                <version>3.0.0-M1</version>
-                <configuration>
-                    <skip>false</skip>
-                </configuration>
-            </plugin>
         </plugins>
     </build>
 

From 7b50bf86afa8478d02d0fae421b713d03469b2cc Mon Sep 17 00:00:00 2001
From: Jakub Kozlowski <jkozlowski@users.noreply.github.com>
Date: Wed, 13 Oct 2021 21:15:28 +0100
Subject: [PATCH 15/30] Remove dependency on maven-deploy-plugin

---
 pom.xml | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index bbba9133..6b98d831 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,12 +31,6 @@
             <artifactId>opencsv</artifactId>
             <version>2.3</version>
         </dependency>
-        <dependency>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-deploy-plugin</artifactId>
-            <version>3.0.0-M1</version>
-            <type>maven-plugin</type>
-        </dependency>
     </dependencies>
     <modules>
         <module>splunk</module>

From 54ec8d04f3663df578caf0e782c7be023c107bd1 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Thu, 28 Oct 2021 12:52:50 +0530
Subject: [PATCH 16/30] Allowing all certificates for local environment.

Update:
- Boolean flag validateCertificates is introduced.
- createSSLFactory method is modified to handle certificates of local & non-local environment. For now local configuration are set up.
---
 .../src/main/java/com/splunk/HttpService.java | 47 ++++++++++++-------
 1 file changed, 31 insertions(+), 16 deletions(-)

diff --git a/splunk/src/main/java/com/splunk/HttpService.java b/splunk/src/main/java/com/splunk/HttpService.java
index 9ce22781..8f4d588b 100644
--- a/splunk/src/main/java/com/splunk/HttpService.java
+++ b/splunk/src/main/java/com/splunk/HttpService.java
@@ -38,7 +38,15 @@ public class HttpService {
     private static final boolean VERBOSE_REQUESTS = false;
     public static boolean useTLS=false;
     protected static SSLSecurityProtocol sslSecurityProtocol = null;
-    private static SSLSocketFactory sslSocketFactory = createSSLFactory();
+
+    /**
+     * Boolean flag for validating certificates at either of the sides (client/server).
+     * If true, then it will check and validate relevant certificates otherwise, in case of false, it will accept all certificates by default.
+     * While working in localhost OR development environment, FALSE is set. But for PROD environment, TRUE is strongly recommended.
+     */
+    protected static boolean validateCertificates = false;
+
+    private static SSLSocketFactory sslSocketFactory = createSSLFactory(validateCertificates);
     private static String HTTPS_SCHEME = "https";
     private static String HTTP_SCHEME = "http";
     private static String HOSTNAME = "localhost";
@@ -211,7 +219,7 @@ public static void setSslSecurityProtocol(SSLSecurityProtocol securityProtocol)
         // Only update the SSL_SOCKET_FACTORY if changing protocols
         if (sslSecurityProtocol != securityProtocol) {
             sslSecurityProtocol = securityProtocol;
-            sslSocketFactory = new SplunkHttpsSocketFactory(createSSLFactory());
+            sslSocketFactory = new SplunkHttpsSocketFactory(createSSLFactory(validateCertificates));
         }
     }
 
@@ -415,6 +423,7 @@ public ResponseMessage send(String path, RequestMessage request) {
             throw new RuntimeException(e.getMessage(), e);
         }
         if (cn instanceof HttpsURLConnection) {
+            // sslSocketFactory instance will be created based on the above flag "validateCertificate".
             ((HttpsURLConnection) cn).setSSLSocketFactory(sslSocketFactory);
             ((HttpsURLConnection) cn).setHostnameVerifier(HOSTNAME_VERIFIER);
         }
@@ -520,20 +529,8 @@ public static SSLSocketFactory getSSLSocketFactory() {
         return HttpService.sslSocketFactory;
     }
 
-    public static SSLSocketFactory createSSLFactory() {
-        TrustManager[] trustAll = new TrustManager[]{
-                new X509TrustManager() {
-                    public X509Certificate[] getAcceptedIssuers() {
-                        return null;
-                    }
-
-                    public void checkClientTrusted(X509Certificate[] certs, String authType) {
-                    }
+    public static SSLSocketFactory createSSLFactory(boolean validateCertificate) {
 
-                    public void checkServerTrusted(X509Certificate[] certs, String authType) {
-                    }
-                }
-        };
         try {
             String contextStr = "";
             if (sslSecurityProtocol != null) {
@@ -545,7 +542,25 @@ public void checkServerTrusted(X509Certificate[] certs, String authType) {
             }
             SSLContext context = SSLContext.getInstance(contextStr);
 
-            context.init(null, trustAll, new java.security.SecureRandom());
+            if (validateCertificate) {
+                // TODO: Validate certificates.
+            } else {
+                TrustManager[] trustAll = new TrustManager[]{
+                        new X509TrustManager() {
+                            public X509Certificate[] getAcceptedIssuers() {
+                                return null;
+                            }
+
+                            public void checkClientTrusted(X509Certificate[] certs, String authType) {
+                            }
+
+                            public void checkServerTrusted(X509Certificate[] certs, String authType) {
+                            }
+                        }
+                };
+                context.init(null, trustAll, new java.security.SecureRandom());
+            }
+
             return new SplunkHttpsSocketFactory(context.getSocketFactory());
         } catch (Exception e) {
             throw new RuntimeException("Error setting up SSL socket factory: " + e, e);

From e3f1a6cd53f68bac14bf15a1bff3bcbbdf3f2d66 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Mon, 1 Nov 2021 12:12:37 +0530
Subject: [PATCH 17/30] ValidateCertificates made public and true by default.

---
 .../src/main/java/com/splunk/HttpService.java | 47 +++++++++----------
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/splunk/src/main/java/com/splunk/HttpService.java b/splunk/src/main/java/com/splunk/HttpService.java
index 8f4d588b..d3f7314b 100644
--- a/splunk/src/main/java/com/splunk/HttpService.java
+++ b/splunk/src/main/java/com/splunk/HttpService.java
@@ -36,17 +36,18 @@
 public class HttpService {
     // For debugging purposes
     private static final boolean VERBOSE_REQUESTS = false;
-    public static boolean useTLS=false;
+    public static boolean useTLS = false;
     protected static SSLSecurityProtocol sslSecurityProtocol = null;
 
     /**
      * Boolean flag for validating certificates at either of the sides (client/server).
-     * If true, then it will check and validate relevant certificates otherwise, in case of false, it will accept all certificates by default.
-     * While working in localhost OR development environment, FALSE is set. But for PROD environment, TRUE is strongly recommended.
+     * If true, then it will check and validate relevant certificates otherwise, in case of false, it will accept all certificates.
+     * For PROD environment, TRUE is strongly recommended, whereas working in localhost OR development environment, FALSE is used.
+     * Default Value: TRUE
      */
-    protected static boolean validateCertificates = false;
+    public static boolean validateCertificates = true;
 
-    private static SSLSocketFactory sslSocketFactory = createSSLFactory(validateCertificates);
+    private static SSLSocketFactory sslSocketFactory = createSSLFactory();
     private static String HTTPS_SCHEME = "https";
     private static String HTTP_SCHEME = "http";
     private static String HOSTNAME = "localhost";
@@ -219,7 +220,7 @@ public static void setSslSecurityProtocol(SSLSecurityProtocol securityProtocol)
         // Only update the SSL_SOCKET_FACTORY if changing protocols
         if (sslSecurityProtocol != securityProtocol) {
             sslSecurityProtocol = securityProtocol;
-            sslSocketFactory = new SplunkHttpsSocketFactory(createSSLFactory(validateCertificates));
+            sslSocketFactory = new SplunkHttpsSocketFactory(createSSLFactory());
         }
     }
 
@@ -423,8 +424,9 @@ public ResponseMessage send(String path, RequestMessage request) {
             throw new RuntimeException(e.getMessage(), e);
         }
         if (cn instanceof HttpsURLConnection) {
-            // sslSocketFactory instance will be created based on the above flag "validateCertificate".
-            ((HttpsURLConnection) cn).setSSLSocketFactory(sslSocketFactory);
+            if (!validateCertificates) {
+                ((HttpsURLConnection) cn).setSSLSocketFactory(sslSocketFactory);
+            }
             ((HttpsURLConnection) cn).setHostnameVerifier(HOSTNAME_VERIFIER);
         }
         cn.setUseCaches(false);
@@ -529,7 +531,7 @@ public static SSLSocketFactory getSSLSocketFactory() {
         return HttpService.sslSocketFactory;
     }
 
-    public static SSLSocketFactory createSSLFactory(boolean validateCertificate) {
+    public static SSLSocketFactory createSSLFactory() {
 
         try {
             String contextStr = "";
@@ -542,24 +544,21 @@ public static SSLSocketFactory createSSLFactory(boolean validateCertificate) {
             }
             SSLContext context = SSLContext.getInstance(contextStr);
 
-            if (validateCertificate) {
-                // TODO: Validate certificates.
-            } else {
-                TrustManager[] trustAll = new TrustManager[]{
-                        new X509TrustManager() {
-                            public X509Certificate[] getAcceptedIssuers() {
-                                return null;
-                            }
+            TrustManager[] trustAll = new TrustManager[]{
+                    new X509TrustManager() {
+                        public X509Certificate[] getAcceptedIssuers() {
+                            return null;
+                        }
 
-                            public void checkClientTrusted(X509Certificate[] certs, String authType) {
-                            }
+                        public void checkClientTrusted(X509Certificate[] certs, String authType) {
+                        }
 
-                            public void checkServerTrusted(X509Certificate[] certs, String authType) {
-                            }
+                        public void checkServerTrusted(X509Certificate[] certs, String authType) {
                         }
-                };
-                context.init(null, trustAll, new java.security.SecureRandom());
-            }
+                    }
+            };
+            context.init(null, trustAll, new java.security.SecureRandom());
+
 
             return new SplunkHttpsSocketFactory(context.getSocketFactory());
         } catch (Exception e) {

From 4d3b762b55072f0eba6ad45fb2ce7c166ab0f2e6 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Mon, 8 Nov 2021 15:10:17 +0530
Subject: [PATCH 18/30] Test case for bypassing certificate validation added.

Update:
- Test case added to bypass certificate validation.
---
 .../src/main/java/com/splunk/HttpService.java |  5 +-
 .../splunk/HttpCertificateValidationTest.java | 95 +++++++++++++++++++
 2 files changed, 99 insertions(+), 1 deletion(-)
 create mode 100644 splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java

diff --git a/splunk/src/main/java/com/splunk/HttpService.java b/splunk/src/main/java/com/splunk/HttpService.java
index d3f7314b..22326dde 100644
--- a/splunk/src/main/java/com/splunk/HttpService.java
+++ b/splunk/src/main/java/com/splunk/HttpService.java
@@ -415,7 +415,6 @@ Socket open() throws IOException {
     public ResponseMessage send(String path, RequestMessage request) {
         // Construct a full URL to the resource
         URL url = getUrl(path);
-
         // Create and initialize the connection object
         HttpURLConnection cn;
         try {
@@ -531,6 +530,10 @@ public static SSLSocketFactory getSSLSocketFactory() {
         return HttpService.sslSocketFactory;
     }
 
+    public static void setValidateCertificates(boolean validateCertificates) {
+        HttpService.validateCertificates = validateCertificates;
+    }
+
     public static SSLSocketFactory createSSLFactory() {
 
         try {
diff --git a/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java b/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java
new file mode 100644
index 00000000..d7301ab8
--- /dev/null
+++ b/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2012 Splunk, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"): you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.splunk;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.security.SecureRandom;
+import java.security.cert.X509Certificate;
+
+public class HttpCertificateValidationTest extends SDKTestCase {
+    private HttpService httpService;
+
+    @BeforeClass
+    public static void ignoreCertificateValidation() {
+        // Bypass the certification validation here.
+        HttpService.setValidateCertificates(false);
+    }
+
+    @Before
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+
+        httpService = new HttpService(
+                (String) command.opts.get("host"),
+                (Integer) command.opts.get("port"),
+                (String) command.opts.get("scheme")
+        );
+    }
+
+    @Test
+    public void testSSLSocketUsingCertificateFlag() throws Exception {
+
+        try {
+            SSLContext sslContext = SSLContext.getInstance("TLS");
+            TrustManager[] byPassTrustManagers = new TrustManager[]{
+                    new X509TrustManager() {
+                        public X509Certificate[] getAcceptedIssuers() {
+                            return new X509Certificate[0];
+                        }
+
+                        public void checkClientTrusted(X509Certificate[] chain, String authType) {
+                        }
+
+                        public void checkServerTrusted(X509Certificate[] chain, String authType) {
+                        }
+                    }
+            };
+            sslContext.init(null, byPassTrustManagers, new SecureRandom());
+            SSLSocketFactory TLSOnlySSLFactory = sslContext.getSocketFactory();
+            Service.setSSLSocketFactory(TLSOnlySSLFactory);
+
+            validateSSLSocketFactory(Service.getSSLSocketFactory());
+        } catch (Exception e) {
+            Assert.assertNull(e);
+        }
+    }
+
+    public void validateSSLSocketFactory(SSLSocketFactory factory) {
+        // Backup the old value
+        SSLSocketFactory old = Service.getSSLSocketFactory();
+
+        Service.setSSLSocketFactory(factory);
+        Service s = new Service(service.getHost());
+        s.login(service.getUsername(), service.getPassword());
+        Assert.assertEquals(service.getUsername(), s.getUsername());
+        Assert.assertEquals(service.getPassword(), s.getPassword());
+        Assert.assertEquals(service.getInfo().keySet(), s.getInfo().keySet());
+        Assert.assertEquals(service.getInfo().getVersion(), s.getInfo().getVersion());
+
+        // Restore the old value
+        Service.setSSLSocketFactory(old);
+    }
+}

From d7e2fba84045f9461a316d62fdef99e27cfbd21c Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Mon, 8 Nov 2021 15:18:13 +0530
Subject: [PATCH 19/30] Method name modified.

---
 .../test/java/com/splunk/HttpCertificateValidationTest.java  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java b/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java
index d7301ab8..ebb846dc 100644
--- a/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java
+++ b/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java
@@ -31,8 +31,11 @@
 public class HttpCertificateValidationTest extends SDKTestCase {
     private HttpService httpService;
 
+    /**
+     * This method will be executed when class is loaded.
+     */
     @BeforeClass
-    public static void ignoreCertificateValidation() {
+    public static void preClassLoadActions() {
         // Bypass the certification validation here.
         HttpService.setValidateCertificates(false);
     }

From c167356b7824b8748baec16c8863c534ac90ed62 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Thu, 11 Nov 2021 12:15:37 +0530
Subject: [PATCH 20/30] Allow test cases to run for local environment

Update:
- Skipping certificate validation while executing test cases.
- Removed CertificateValidationTest file, as it is no longer required.
---
 .../splunk/HttpCertificateValidationTest.java | 98 -------------------
 .../src/test/java/com/splunk/SDKTestCase.java |  7 ++
 2 files changed, 7 insertions(+), 98 deletions(-)
 delete mode 100644 splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java

diff --git a/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java b/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java
deleted file mode 100644
index ebb846dc..00000000
--- a/splunk/src/test/java/com/splunk/HttpCertificateValidationTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2012 Splunk, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"): you may
- * not use this file except in compliance with the License. You may obtain
- * a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-
-package com.splunk;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-import java.security.SecureRandom;
-import java.security.cert.X509Certificate;
-
-public class HttpCertificateValidationTest extends SDKTestCase {
-    private HttpService httpService;
-
-    /**
-     * This method will be executed when class is loaded.
-     */
-    @BeforeClass
-    public static void preClassLoadActions() {
-        // Bypass the certification validation here.
-        HttpService.setValidateCertificates(false);
-    }
-
-    @Before
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-
-        httpService = new HttpService(
-                (String) command.opts.get("host"),
-                (Integer) command.opts.get("port"),
-                (String) command.opts.get("scheme")
-        );
-    }
-
-    @Test
-    public void testSSLSocketUsingCertificateFlag() throws Exception {
-
-        try {
-            SSLContext sslContext = SSLContext.getInstance("TLS");
-            TrustManager[] byPassTrustManagers = new TrustManager[]{
-                    new X509TrustManager() {
-                        public X509Certificate[] getAcceptedIssuers() {
-                            return new X509Certificate[0];
-                        }
-
-                        public void checkClientTrusted(X509Certificate[] chain, String authType) {
-                        }
-
-                        public void checkServerTrusted(X509Certificate[] chain, String authType) {
-                        }
-                    }
-            };
-            sslContext.init(null, byPassTrustManagers, new SecureRandom());
-            SSLSocketFactory TLSOnlySSLFactory = sslContext.getSocketFactory();
-            Service.setSSLSocketFactory(TLSOnlySSLFactory);
-
-            validateSSLSocketFactory(Service.getSSLSocketFactory());
-        } catch (Exception e) {
-            Assert.assertNull(e);
-        }
-    }
-
-    public void validateSSLSocketFactory(SSLSocketFactory factory) {
-        // Backup the old value
-        SSLSocketFactory old = Service.getSSLSocketFactory();
-
-        Service.setSSLSocketFactory(factory);
-        Service s = new Service(service.getHost());
-        s.login(service.getUsername(), service.getPassword());
-        Assert.assertEquals(service.getUsername(), s.getUsername());
-        Assert.assertEquals(service.getPassword(), s.getPassword());
-        Assert.assertEquals(service.getInfo().keySet(), s.getInfo().keySet());
-        Assert.assertEquals(service.getInfo().getVersion(), s.getInfo().getVersion());
-
-        // Restore the old value
-        Service.setSSLSocketFactory(old);
-    }
-}
diff --git a/splunk/src/test/java/com/splunk/SDKTestCase.java b/splunk/src/test/java/com/splunk/SDKTestCase.java
index 2f15dc80..c2c623fa 100644
--- a/splunk/src/test/java/com/splunk/SDKTestCase.java
+++ b/splunk/src/test/java/com/splunk/SDKTestCase.java
@@ -19,6 +19,7 @@
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.BeforeClass;
 
 import java.io.*;
 import java.net.InetSocketAddress;
@@ -90,6 +91,12 @@ public static Integer getJavaVersion() {
         return Integer.parseInt(version);
     }
 
+    @BeforeClass
+    public static void preClassLoadActions() {
+        // Bypass the certification validation here.
+        HttpService.setValidateCertificates(false);
+    }
+
     @Before
     public void setUp() throws Exception {
         // If using Charles Proxy for debugging, uncomment these lines.

From e0e4a91ad92700259b66679303311672111fc23d Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Thu, 11 Nov 2021 12:19:19 +0530
Subject: [PATCH 21/30] Github CI Test: Splunk version modified to latest from
 8.2.0

---
 .github/workflows/test.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 8be22ddd..1df987b9 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,7 +14,7 @@ jobs:
           - 1.8
         splunk-version:
           - "8.0"
-          - "8.2.0"
+          - "latest"
     runs-on: ${{ matrix.os }}
 
     services:

From 69d854cc2515eaea250e88bbe0a21c6138c7af0e Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Thu, 18 Nov 2021 17:08:38 +0530
Subject: [PATCH 22/30] HttpService: Unused flags & class are removed.

---
 .../src/main/java/com/splunk/HttpService.java | 117 ++++--------------
 1 file changed, 27 insertions(+), 90 deletions(-)

diff --git a/splunk/src/main/java/com/splunk/HttpService.java b/splunk/src/main/java/com/splunk/HttpService.java
index 22326dde..8497755a 100644
--- a/splunk/src/main/java/com/splunk/HttpService.java
+++ b/splunk/src/main/java/com/splunk/HttpService.java
@@ -36,7 +36,6 @@
 public class HttpService {
     // For debugging purposes
     private static final boolean VERBOSE_REQUESTS = false;
-    public static boolean useTLS = false;
     protected static SSLSecurityProtocol sslSecurityProtocol = null;
 
     /**
@@ -45,7 +44,7 @@ public class HttpService {
      * For PROD environment, TRUE is strongly recommended, whereas working in localhost OR development environment, FALSE is used.
      * Default Value: TRUE
      */
-    public static boolean validateCertificates = true;
+    protected static boolean validateCertificates = true;
 
     private static SSLSocketFactory sslSocketFactory = createSSLFactory();
     private static String HTTPS_SCHEME = "https";
@@ -220,7 +219,7 @@ public static void setSslSecurityProtocol(SSLSecurityProtocol securityProtocol)
         // Only update the SSL_SOCKET_FACTORY if changing protocols
         if (sslSecurityProtocol != securityProtocol) {
             sslSecurityProtocol = securityProtocol;
-            sslSocketFactory = new SplunkHttpsSocketFactory(createSSLFactory());
+            sslSocketFactory = createSSLFactory();
         }
     }
 
@@ -423,9 +422,7 @@ public ResponseMessage send(String path, RequestMessage request) {
             throw new RuntimeException(e.getMessage(), e);
         }
         if (cn instanceof HttpsURLConnection) {
-            if (!validateCertificates) {
-                ((HttpsURLConnection) cn).setSSLSocketFactory(sslSocketFactory);
-            }
+            ((HttpsURLConnection) cn).setSSLSocketFactory(sslSocketFactory);
             ((HttpsURLConnection) cn).setHostnameVerifier(HOSTNAME_VERIFIER);
         }
         cn.setUseCaches(false);
@@ -537,102 +534,42 @@ public static void setValidateCertificates(boolean validateCertificates) {
     public static SSLSocketFactory createSSLFactory() {
 
         try {
-            String contextStr = "";
+            SSLContext context;
             if (sslSecurityProtocol != null) {
-                contextStr = sslSecurityProtocol.toString().contains("SSL") ? "SSL" : "TLS";
-            } else if (useTLS || System.getProperty("java.version").compareTo("1.8") >= 0) {
-                contextStr = "TLS";
+                String contextStr = sslSecurityProtocol.toString().contains("SSL") ? "SSL" : "TLS";
+                context = SSLContext.getInstance(contextStr);
+            } else if (System.getProperty("java.version").compareTo("1.8") >= 0) {
+                context = SSLContext.getInstance("TLS");
             } else {
-                contextStr = "SSL";
+                context = SSLContext.getDefault();
             }
-            SSLContext context = SSLContext.getInstance(contextStr);
 
-            TrustManager[] trustAll = new TrustManager[]{
-                    new X509TrustManager() {
-                        public X509Certificate[] getAcceptedIssuers() {
-                            return null;
-                        }
+            if (validateCertificates) {
+                context.init(null, null, null);
+                // For now this check is set as null.
+                // TODO: Implementation logic for validating client certificate.
+            } else {
+                TrustManager[] trustAll = new TrustManager[]{
+                        new X509TrustManager() {
+                            public X509Certificate[] getAcceptedIssuers() {
+                                return null;
+                            }
 
-                        public void checkClientTrusted(X509Certificate[] certs, String authType) {
-                        }
+                            public void checkClientTrusted(X509Certificate[] certs, String authType) {
+                            }
 
-                        public void checkServerTrusted(X509Certificate[] certs, String authType) {
+                            public void checkServerTrusted(X509Certificate[] certs, String authType) {
+                            }
                         }
-                    }
-            };
-            context.init(null, trustAll, new java.security.SecureRandom());
-
+                };
+                context.init(null, trustAll, null);
+            }
 
-            return new SplunkHttpsSocketFactory(context.getSocketFactory());
+            return context.getSocketFactory();
         } catch (Exception e) {
             throw new RuntimeException("Error setting up SSL socket factory: " + e, e);
         }
     }
 
-    private static final class SplunkHttpsSocketFactory extends SSLSocketFactory {
-        private final SSLSocketFactory delegate;
-
-        public static String[] PROTOCOLS = {"SSLv3"};
-        public static String[] PROTOCOLS_TLS = {"TLSv1.3", "TLSv1.2", "TLSv1.1", "TLSv1"};
-
-        private SplunkHttpsSocketFactory(SSLSocketFactory delegate) {
-            this.delegate = delegate;
-        }
-
-        private Socket configure(Socket socket) {
-            if (socket instanceof SSLSocket) {
-                if (sslSecurityProtocol != null) {
-                    String[] protocols = {sslSecurityProtocol.toString()};
-                    ((SSLSocket) socket).setEnabledProtocols(protocols);
-                } else if (useTLS || System.getProperty("java.version").compareTo("1.8") >= 0) {
-                    ((SSLSocket) socket).setEnabledProtocols(PROTOCOLS_TLS);
-                } else {
-                    ((SSLSocket) socket).setEnabledProtocols(PROTOCOLS);
-                }
-            }
-            return socket;
-        }
-
-        @Override
-        public String[] getDefaultCipherSuites() {
-            return delegate.getDefaultCipherSuites();
-        }
-
-        @Override
-        public String[] getSupportedCipherSuites() {
-            return delegate.getSupportedCipherSuites();
-        }
-
-        @Override
-        public Socket createSocket(Socket socket, String s, int i, boolean b) throws IOException {
-            return configure(delegate.createSocket(socket, s, i, b));
-        }
-
-        @Override
-        public Socket createSocket() throws IOException {
-            return configure(delegate.createSocket());
-        }
-
-        @Override
-        public Socket createSocket(String s, int i) throws IOException, UnknownHostException {
-            return configure(delegate.createSocket(s, i));
-        }
-
-        @Override
-        public Socket createSocket(String s, int i, InetAddress inetAddress, int i1) throws IOException, UnknownHostException {
-            return configure(delegate.createSocket(s, i, inetAddress, i1));
-        }
-
-        @Override
-        public Socket createSocket(InetAddress inetAddress, int i) throws IOException {
-            return configure(delegate.createSocket(inetAddress, i));
-        }
-
-        @Override
-        public Socket createSocket(InetAddress inetAddress, int i, InetAddress inetAddress1, int i1) throws IOException {
-            return configure(delegate.createSocket(inetAddress, i, inetAddress1, i1));
-        }
-    }
-
 }
 

From 969a275b5dc0c08a651213a5c8b40baf654337a0 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Mon, 22 Nov 2021 17:06:04 +0530
Subject: [PATCH 23/30] ClientCert param was added in OutputServer class

---
 .../src/main/java/com/splunk/OutputServer.java | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/splunk/src/main/java/com/splunk/OutputServer.java b/splunk/src/main/java/com/splunk/OutputServer.java
index 9ec8e223..2bcd19b3 100644
--- a/splunk/src/main/java/com/splunk/OutputServer.java
+++ b/splunk/src/main/java/com/splunk/OutputServer.java
@@ -89,6 +89,15 @@ public String getStatus() {
         return getString("status", null);
     }
 
+    /**
+     *  Returns client certificate path.
+     *
+     * @return
+     */
+    public String getClientCert() {
+        return getString("clientCert", "");
+    }
+
     /**
      * Sets the type of data distribution method when two or more servers
      * exist in the same forwarder group. Valid values are: "clone", "balance", 
@@ -172,6 +181,15 @@ public void setSslVerifyServerCert(boolean sslVerifyServerCert) {
         setCacheValue("sslVerifyServerCert", sslVerifyServerCert);
     }
 
+    /**
+     * Sets the client certificate path which is being supported in recent versions.
+     *
+     * @param clientCert The path for client certificate.
+     */
+    public void setClientCert(String clientCert) {
+        setCacheValue("clientCert", clientCert);
+    }
+
     /**
      * Returns an object that contains all current connections to the output
      * server.

From 4c5562f1773acc1621c2866cda968d88be0067c2 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Wed, 24 Nov 2021 11:10:14 +0530
Subject: [PATCH 24/30] README.md updated with Test example

Update:
- Login Examples using creds & tokens are added.
- Job creation using search criteria example
---
 README.md | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 155 insertions(+)

diff --git a/README.md b/README.md
index 5798188b..345a5e5e 100644
--- a/README.md
+++ b/README.md
@@ -109,6 +109,161 @@ To build the documentation for the SDK, it is being automatically generated with
     cd splunk
     mvn javadoc:javadoc
 
+### Usage
+#### Login using username and password
+```java
+import com.splunk.Service;
+import com.splunk.ServiceArgs;
+
+/**
+ * Login using username and password
+ */
+public class SplunkLogin {
+
+    static Service service = null;
+    public static void main(String args[]) {
+        ServiceArgs loginArgs = new ServiceArgs();
+        loginArgs.setPort(8089);
+        loginArgs.setHost("localhost");
+        loginArgs.setScheme("https");
+        loginArgs.setUsername("USERNAME"); // Use your username
+        loginArgs.setPassword("PASSWORD"); // Use your password
+
+        // Initialize the SDK client
+        service = Service.connect(loginArgs);
+    }
+}
+```
+
+#### Login using Splunk Token
+```java
+import com.splunk.Service;
+import com.splunk.ServiceArgs;
+
+/**
+ * Login using Splunk token
+ */
+public class SplunkLogin {
+
+    static Service service = null;
+    /**
+     * Splunk Token.
+     * Actual token length would be longer than this token length.
+     */
+    static String splunkToken = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
+    
+    public static void main(String args[]) {
+        ServiceArgs loginArgs = new ServiceArgs();
+        loginArgs.setPort(8089);
+        loginArgs.setHost("localhost");
+        loginArgs.setScheme("https");
+        loginArgs.setToken(String.format("Splunk %s", splunkToken));
+
+        // Initialize the SDK client
+        service = Service.connect(loginArgs);
+    }
+}
+```
+* Login using username and password will create Splunk token internally.
+* Login using Credentials (username & password) OR directly using Splunk token are similar.
+* In above two approaches, there is one limitation that expiration time of Splunk token cannot be extended. User has to re-login every time when token expires.
+* To overcome this limitation, **Bearer** token is used instead of Splunk token.
+* In **Bearer** token, user has a provision to set token expiration time. Splunk allows user to set relative/absolute time for token expiration.
+* In other words, **Bearer** token is configurable whereas Splunk token cannot be configured.
+
+#### Login using Bearer Token (RECOMMENDED)
+```java
+import com.splunk.Service;
+import com.splunk.ServiceArgs;
+
+/**
+ * Login using Bearer token
+ */
+public class SplunkLogin {
+
+    static Service service = null;
+    /**
+     * Bearer Token.
+     * Actual token length would be longer than this token length.
+     */
+    static String bearerToken = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
+    
+    public static void main(String args[]) {
+        ServiceArgs loginArgs = new ServiceArgs();
+        loginArgs.setPort(8089);
+        loginArgs.setHost("localhost");
+        loginArgs.setScheme("https");
+        loginArgs.setToken(String.format("Bearer %s", bearerToken));
+
+        // Initialize the SDK client
+        service = Service.connect(loginArgs);
+    }
+}
+```
+
+#### Example of running a simple search by first creating the search job
+```java
+import com.splunk.Job;
+import com.splunk.ResultsReader;
+import com.splunk.ResultsReaderXml;
+import com.splunk.Service;
+import com.splunk.ServiceArgs;
+
+/**
+ * Logged in using Bearer token.
+ * Assuming that bearer token is already created from Splunk web.
+ * Create Job using search creation.
+ * Read results and print _raw fields
+ */
+public class SearchExample {
+
+    static Service service = null;
+
+    /**
+     * Bearer Token.
+     * Actual token length would be longer than this token length.
+     */
+    static String bearerToken = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
+    
+    public static void main(String args[]) {
+
+        ServiceArgs loginArgs = new ServiceArgs();
+        loginArgs.setPort(8089);
+        loginArgs.setHost("localhost");
+        loginArgs.setScheme("https");
+        loginArgs.setToken(String.format("Bearer %s", bearerToken));
+
+        // Initialize the SDK client
+        service = Service.connect(loginArgs);
+
+        // Run a simple search by first creating the search job
+        Job job = service.getJobs().create("search index=_internal | head 10");
+
+        // Waiting for search results to be ready
+        while (!job.isReady()) {
+            try {
+                Thread.sleep(500); // 500 ms
+            } catch (Exception e) {
+                // Handle exception here.
+            }
+        }
+
+        // Read results
+        try {
+            ResultsReader reader = new ResultsReaderXml(job.getEvents());
+
+            // Iterate over events and print _raw field
+            reader.forEach(event -> System.out.println(event.get("_raw")));
+
+        } catch (Exception e) {
+            // Handle exception here.
+        }
+    }
+}
+```
+
+For more information on authentication using tokens, please visit [Splunk Docs](https://docs.splunk.com/Documentation/Splunk/8.2.3/Security/Setupauthenticationwithtokens).
+
 ### Unit tests
 
 The Splunk SDK for Java includes several unit tests that are run at

From 842b8a07df9e4be54c70f968b8016f172ed5fe52 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Wed, 24 Nov 2021 12:18:20 +0530
Subject: [PATCH 25/30] Splunk version updated to latest.

---
 .github/workflows/test.yml | 2 +-
 docker-compose.yml         | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 8be22ddd..1df987b9 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,7 +14,7 @@ jobs:
           - 1.8
         splunk-version:
           - "8.0"
-          - "8.2.0"
+          - "latest"
     runs-on: ${{ matrix.os }}
 
     services:
diff --git a/docker-compose.yml b/docker-compose.yml
index 1e3f76b9..4584c6d3 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,13 +2,14 @@ version: '3.6'
 
 services:
     splunk:
-        image: "splunk/splunk:8.0"
+        image: "splunk/splunk:latest"
         container_name: splunk
         environment:
             - SPLUNK_START_ARGS=--accept-license
             - SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
             - SPLUNK_PASSWORD=changed!
             - SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
+            - JAVA_VERSION=openjdk:8
         ports:
             - 8000:8000
             - 8088:8088

From 98f9e3ff9bdcef2bcaf8933c6e425a1b27028e97 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Thu, 25 Nov 2021 10:17:11 +0530
Subject: [PATCH 26/30] README file updated

**Update:**
- Splunk token is replaced **Session token**.
- Bearer is replaced with **Authentication**.
- Splunk Docs URL is pointing to latest release.
---
 README.md | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/README.md b/README.md
index 345a5e5e..a43ec8e4 100644
--- a/README.md
+++ b/README.md
@@ -135,65 +135,65 @@ public class SplunkLogin {
 }
 ```
 
-#### Login using Splunk Token
+#### Login using Session Token
 ```java
 import com.splunk.Service;
 import com.splunk.ServiceArgs;
 
 /**
- * Login using Splunk token
+ * Login using Session token
  */
 public class SplunkLogin {
 
     static Service service = null;
     /**
-     * Splunk Token.
+     * Session Token.
      * Actual token length would be longer than this token length.
      */
-    static String splunkToken = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
+    static String token = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
     
     public static void main(String args[]) {
         ServiceArgs loginArgs = new ServiceArgs();
         loginArgs.setPort(8089);
         loginArgs.setHost("localhost");
         loginArgs.setScheme("https");
-        loginArgs.setToken(String.format("Splunk %s", splunkToken));
+        loginArgs.setToken(String.format("Splunk %s", token));
 
         // Initialize the SDK client
         service = Service.connect(loginArgs);
     }
 }
 ```
-* Login using username and password will create Splunk token internally.
-* Login using Credentials (username & password) OR directly using Splunk token are similar.
-* In above two approaches, there is one limitation that expiration time of Splunk token cannot be extended. User has to re-login every time when token expires.
-* To overcome this limitation, **Bearer** token is used instead of Splunk token.
-* In **Bearer** token, user has a provision to set token expiration time. Splunk allows user to set relative/absolute time for token expiration.
-* In other words, **Bearer** token is configurable whereas Splunk token cannot be configured.
-
-#### Login using Bearer Token (RECOMMENDED)
+* Login using username and password will create Session token internally.
+* Login using Credentials (username & password) OR directly using Session token are similar.
+* In above two approaches, there is one limitation that expiration time of Session token cannot be extended. User has to re-login every time when token expires.
+* To overcome this limitation, **Authentication** token is used instead of Session token.
+* In **Authentication** token, user has a provision to set token expiration time. Splunk allows user to set relative/absolute time for token expiration.
+* In other words, **Authentication** token is configurable whereas Session token cannot be configured.
+
+#### Login using Authentication Token (RECOMMENDED)
 ```java
 import com.splunk.Service;
 import com.splunk.ServiceArgs;
 
 /**
- * Login using Bearer token
+ * Login using Authentication token
  */
 public class SplunkLogin {
 
     static Service service = null;
     /**
-     * Bearer Token.
+     * Authentication Token.
      * Actual token length would be longer than this token length.
      */
-    static String bearerToken = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
+    static String token = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
     
     public static void main(String args[]) {
         ServiceArgs loginArgs = new ServiceArgs();
         loginArgs.setPort(8089);
         loginArgs.setHost("localhost");
         loginArgs.setScheme("https");
-        loginArgs.setToken(String.format("Bearer %s", bearerToken));
+        loginArgs.setToken(String.format("Bearer %s", token));
 
         // Initialize the SDK client
         service = Service.connect(loginArgs);
@@ -210,8 +210,8 @@ import com.splunk.Service;
 import com.splunk.ServiceArgs;
 
 /**
- * Logged in using Bearer token.
- * Assuming that bearer token is already created from Splunk web.
+ * Logged in using Authentication token.
+ * Assuming that authentication token is already created from Splunk web.
  * Create Job using search creation.
  * Read results and print _raw fields
  */
@@ -220,10 +220,10 @@ public class SearchExample {
     static Service service = null;
 
     /**
-     * Bearer Token.
+     * Authentication Token.
      * Actual token length would be longer than this token length.
      */
-    static String bearerToken = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
+    static String token = "1k_Ostpl6NBe4iVQ5d6I3Ohla_U5";
     
     public static void main(String args[]) {
 
@@ -231,7 +231,7 @@ public class SearchExample {
         loginArgs.setPort(8089);
         loginArgs.setHost("localhost");
         loginArgs.setScheme("https");
-        loginArgs.setToken(String.format("Bearer %s", bearerToken));
+        loginArgs.setToken(String.format("Bearer %s", token));
 
         // Initialize the SDK client
         service = Service.connect(loginArgs);
@@ -262,7 +262,7 @@ public class SearchExample {
 }
 ```
 
-For more information on authentication using tokens, please visit [Splunk Docs](https://docs.splunk.com/Documentation/Splunk/8.2.3/Security/Setupauthenticationwithtokens).
+For more information on authentication using tokens, please visit [Splunk Docs](https://docs.splunk.com/Documentation/Splunk/latest/Security/Setupauthenticationwithtokens).
 
 ### Unit tests
 

From 9e4a6fa02efd98729ad3734d23b4cef73e835d1a Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Wed, 1 Dec 2021 12:39:39 +0530
Subject: [PATCH 27/30] Headers modified in Socket creation.

Update:
- String formatter with \r\n removed and modified with alternate approach.
- Host param is removed.
---
 splunk/src/main/java/com/splunk/Receiver.java | 36 ++++++++-----------
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/splunk/src/main/java/com/splunk/Receiver.java b/splunk/src/main/java/com/splunk/Receiver.java
index e2369da8..b6057cc0 100644
--- a/splunk/src/main/java/com/splunk/Receiver.java
+++ b/splunk/src/main/java/com/splunk/Receiver.java
@@ -16,12 +16,12 @@
 
 package com.splunk;
 
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
+import java.io.*;
 import java.net.Socket;
 import java.lang.StringBuilder;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * The {@code Receiver} class represents a named index and unnamed index
  * receivers.
@@ -83,8 +83,7 @@ public Socket attach(Args args) throws IOException {
      */
     public Socket attach(String indexName, Args args) throws IOException {
         Socket socket = service.open();
-        OutputStream ostream = socket.getOutputStream();
-        Writer out = new OutputStreamWriter(ostream, "UTF-8");
+        PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), "UTF-8"));
         String postUrl = "POST /services/receivers/stream";
         if (indexName != null) {
             postUrl = postUrl + "?index=" + indexName;
@@ -94,26 +93,19 @@ public Socket attach(String indexName, Args args) throws IOException {
             postUrl = postUrl + args.encode();
         }
 
-        StringBuilder header = new StringBuilder(String.format(
-                "%s HTTP/1.1\r\n" +
-                "Host: %s:%d\r\n" +
-                "Accept-Encoding: identity\r\n" +
-                "X-Splunk-Input-Mode: Streaming\r\n",
-                postUrl,
-                service.getHost(), service.getPort()
-                ));
+        List<String> headers = new ArrayList<>();
+        headers.add(String.format("%s HTTP/1.1", postUrl));
+        headers.add("Accept-Encoding: identity");
+        headers.add("X-Splunk-Input-Mode: Streaming");
 
         if (service.hasCookies()) {
-            header.append("Cookie: ");
-            header.append(service.stringifyCookies());
+            headers.add(String.format("Cookie: %s", service.stringifyCookies()));
         } else {
-            header.append("Authorization: ");
-            header.append(service.getToken());
+            headers.add(String.format("Authorization: %s", service.getToken()));
         }
-        header.append("\r\n\r\n");
-
-        out.write(header.toString());
-        out.flush();
+        headers.add("");
+        headers.forEach(header -> writer.println(header));
+        writer.flush();
         return socket;
     }
 

From 7cd0e88bf9e9a11469aac97651a4b67a4e9ac951 Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Wed, 1 Dec 2021 16:59:02 +0530
Subject: [PATCH 28/30] External Entities restricted in XML factory.

---
 splunk/src/main/java/com/splunk/Xml.java                      | 4 ++++
 .../main/java/com/splunk/modularinput/InputDefinition.java    | 4 ++++
 .../java/com/splunk/modularinput/ValidationDefinition.java    | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/splunk/src/main/java/com/splunk/Xml.java b/splunk/src/main/java/com/splunk/Xml.java
index 516e5f20..ef582f72 100644
--- a/splunk/src/main/java/com/splunk/Xml.java
+++ b/splunk/src/main/java/com/splunk/Xml.java
@@ -52,6 +52,10 @@ public static Document parse(InputStream input, boolean silent) {
         try {
             DocumentBuilderFactory factory =
                 DocumentBuilderFactory.newInstance();
+            factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+            factory.setExpandEntityReferences(false);
+            factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+            factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
             factory.setNamespaceAware(false);
             DocumentBuilder builder = factory.newDocumentBuilder();
             if (silent)
diff --git a/splunk/src/main/java/com/splunk/modularinput/InputDefinition.java b/splunk/src/main/java/com/splunk/modularinput/InputDefinition.java
index deb6ffbc..f7431e78 100755
--- a/splunk/src/main/java/com/splunk/modularinput/InputDefinition.java
+++ b/splunk/src/main/java/com/splunk/modularinput/InputDefinition.java
@@ -175,6 +175,10 @@ public static InputDefinition parseDefinition(InputStream stream) throws ParserC
             IOException, SAXException, MalformedDataException {
         DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
         documentBuilderFactory.setIgnoringElementContentWhitespace(true);
+        documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+        documentBuilderFactory.setExpandEntityReferences(false);
+        documentBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+        documentBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
         DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
         Document doc = documentBuilder.parse(stream);
 
diff --git a/splunk/src/main/java/com/splunk/modularinput/ValidationDefinition.java b/splunk/src/main/java/com/splunk/modularinput/ValidationDefinition.java
index e6899a05..3ce60106 100755
--- a/splunk/src/main/java/com/splunk/modularinput/ValidationDefinition.java
+++ b/splunk/src/main/java/com/splunk/modularinput/ValidationDefinition.java
@@ -194,6 +194,10 @@ public static ValidationDefinition parseDefinition(InputStream stream) throws Pa
             IOException, SAXException, MalformedDataException {
         DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
         documentBuilderFactory.setIgnoringElementContentWhitespace(true);
+        documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+        documentBuilderFactory.setExpandEntityReferences(false);
+        documentBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
+        documentBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
         DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
         Document doc = documentBuilder.parse(stream);
 

From e747fe4127bb0e94809b812aeb5b7d94043e99ae Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Wed, 8 Dec 2021 15:21:41 +0530
Subject: [PATCH 29/30] Release v1.7.2

Update:
- POM files updated.
- Splunk version updated to 1.7.2 .
- Splunk parent version pom is updated to v1.0.1 .
- README.md and CHANGELOG.md updated with regards to v1.7.2 .
---
 CHANGELOG.md                                  | 24 +++++++++++++++
 README.md                                     |  6 ++--
 deploy                                        |  2 +-
 deploy.md                                     | 30 +++++++++----------
 examples/pom.xml                              |  4 +--
 pom.xml                                       |  4 +--
 splunk/pom.xml                                |  4 +--
 .../src/main/java/com/splunk/HttpService.java |  2 +-
 8 files changed, 50 insertions(+), 26 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e0416dd..c1e32e58 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,29 @@
 # Splunk Enterprise SDK for Java Changelog
 
+## Version 1.7.2
+
+### New Features and APIs
+* Added a support to add custom headers in Service class. (Github PR [#176](https://github.com/splunk/splunk-sdk-java/pull/176)).
+* SSL Certificate validation (default implementation) added. (Github PR [#175](https://github.com/splunk/splunk-sdk-java/pull/175)).
+  * Boolean flag is introduced to skip/validate certificate.
+  * Implementation is modified to validate certificate(s) of local and non-local environments.
+* Apps/app-install replaced with **apps/local**. (Github PR [#168](https://github.com/splunk/splunk-sdk-java/pull/168))
+
+### Minor Changes
+
+* External Entities restricted in XML factory. (Github PR [#180](https://github.com/splunk/splunk-sdk-java/pull/180)).
+  * Prevent expansion of external entities in Document Builder factory.
+* Headers modified in Socket creation. (Github PR [#179](https://github.com/splunk/splunk-sdk-java/pull/179)).
+  * Http Request uses raw request headers by including escape characters which seems vulnerable. It was replaced with PrintWriter methods to avoid escape characters.
+  * Host parameter used in Socket is omitted to prevent exposing it to external users.
+* README.md file modified with all login methods along with Splunk Search creation example. (Github PR [#177](https://github.com/splunk/splunk-sdk-java/pull/177)).
+* Deploy plugin is removed from Splunk module pom to avoid redundancy. (Github PR [#172](https://github.com/splunk/splunk-sdk-java/pull/172)).
+* Setter methods for Session and Bearer token added along with test case. (Github PR [#171](https://github.com/splunk/splunk-sdk-java/pull/171))
+* Modular input folder name renamed based on newer splunk folder name validation. (Github PR [#168](https://github.com/splunk/splunk-sdk-java/pull/168))
+* SDK app collection URL has been updated to v1.1.0 in docker compose file. (Github PR [#168](https://github.com/splunk/splunk-sdk-java/pull/168))
+  * Test files in sdk app collections are modified based on python v3 syntax.
+* Added Saved Search test case based on title. (Github PR [#166](https://github.com/splunk/splunk-sdk-java/pull/166))
+
 ## Version 1.7.1
 
 ### Minor Changes
diff --git a/README.md b/README.md
index a43ec8e4..8fa975d1 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-![Build Status](https://github.com/splunk/splunk-sdk-java/actions/workflows/release.yml/badge.svg?branch=master)
+[![Java SDK Test](https://github.com/splunk/splunk-sdk-java/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/splunk/splunk-sdk-java/actions/workflows/test.yml)
 # The Splunk Software Development Kit for Java
 
-#### Version 1.7.1
+#### Version 1.7.2
 
 The Splunk Software Development Kit (SDK) for Java contains library code and
 examples designed to enable developers to build applications using Splunk.
@@ -75,7 +75,7 @@ To add the Splunk SDK for Java `.JAR` file as a dependency:
   <dependency>
     <groupId>com.splunk</groupId>
     <artifactId>splunk</artifactId>
-    <version>1.7.1</version>
+    <version>1.7.2</version>
   </dependency>
 </dependencies>
 ```
diff --git a/deploy b/deploy
index 9cb18855..11bc3961 100755
--- a/deploy
+++ b/deploy
@@ -2,7 +2,7 @@
 
 declare -r scriptDirectory="$(dirname $(readlink -e $0))"
 declare -r scriptName="$(basename $0)"
-declare -r version="1.7.1"
+declare -r version="1.7.2"
 
 if [[ $# -ne 1 ]]; then
     echo 1>&2 "Usage: ${scriptName} {local|staging||production}"
diff --git a/deploy.md b/deploy.md
index f524be24..3e688c05 100644
--- a/deploy.md
+++ b/deploy.md
@@ -9,8 +9,8 @@ deploy \<repository-name>
 
 ##DESCRIPTION
 
-Deploy transmits **target/splunk-1.7.1.jar**, **target/splunk-1.7.1-javadoc.jar**, and
-**target/splunk-1.7.1-sources.jar** to the **local**, **staging**, or **production**
+Deploy transmits **target/splunk-1.7.2.jar**, **target/splunk-1.7.2-javadoc.jar**, and
+**target/splunk-1.7.2-sources.jar** to the **local**, **staging**, or **production**
 maven repository. Repository names are mapped to locations as follows.
 
 | repository-name | location                                                       |
@@ -21,18 +21,18 @@ maven repository. Repository names are mapped to locations as follows.
 
 After deployment you should find this tree structure at the location of your repository
 
-    com/splunk/splunk/1.7.1/
-    ├── splunk-1.7.1-javadoc.jar
-    ├── splunk-1.7.1-javadoc.jar.md5
-    ├── splunk-1.7.1-javadoc.jar.sha1
-    ├── splunk-1.7.1-sources.jar
-    ├── splunk-1.7.1-sources.jar.md5
-    ├── splunk-1.7.1-sources.jar.sha1
-    ├── splunk-1.7.1.jar
-    ├── splunk-1.7.1.jar.md5
-    ├── splunk-1.7.1.jar.sha1
-    ├── splunk-1.7.1.pom
-    ├── splunk-1.7.1.pom.md5
-    └── splunk-1.7.1.pom.sha1
+    com/splunk/splunk/1.7.2/
+    ├── splunk-1.7.2-javadoc.jar
+    ├── splunk-1.7.2-javadoc.jar.md5
+    ├── splunk-1.7.2-javadoc.jar.sha1
+    ├── splunk-1.7.2-sources.jar
+    ├── splunk-1.7.2-sources.jar.md5
+    ├── splunk-1.7.2-sources.jar.sha1
+    ├── splunk-1.7.2.jar
+    ├── splunk-1.7.2.jar.md5
+    ├── splunk-1.7.2.jar.sha1
+    ├── splunk-1.7.2.pom
+    ├── splunk-1.7.2.pom.md5
+    └── splunk-1.7.2.pom.sha1
 
 Verify this structure prior to release.
diff --git a/examples/pom.xml b/examples/pom.xml
index bd80052e..7a32d299 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -8,7 +8,7 @@
     <parent>
         <artifactId>splunk-sdk-java</artifactId>
         <groupId>com.splunk</groupId>
-        <version>1.0.0</version>
+        <version>1.0.1</version>
     </parent>
 
     <build>
@@ -37,7 +37,7 @@
         <dependency>
             <groupId>com.splunk</groupId>
             <artifactId>splunk</artifactId>
-            <version>1.7.1</version>
+            <version>1.7.2</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
diff --git a/pom.xml b/pom.xml
index 6b98d831..ec4ac168 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <properties>
-        <version.number>1.7.1</version.number>
+        <version.number>1.7.2</version.number>
         <maven.resources.overwrite>true</maven.resources.overwrite>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <maven.compiler.source>8</maven.compiler.source>
@@ -15,7 +15,7 @@
 
     <groupId>com.splunk</groupId>
     <artifactId>splunk-sdk-java</artifactId>
-    <version>1.0.0</version>
+    <version>1.0.1</version>
     <packaging>pom</packaging>
     <name>Splunk SDK for Java</name>
     <url>https://dev.splunk.com/enterprise/docs/devtools/java/sdk-java</url>
diff --git a/splunk/pom.xml b/splunk/pom.xml
index 46eb0625..e17ee521 100644
--- a/splunk/pom.xml
+++ b/splunk/pom.xml
@@ -5,11 +5,11 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>splunk</artifactId>
-    <version>1.7.1</version>
+    <version>1.7.2</version>
     <parent>
         <artifactId>splunk-sdk-java</artifactId>
         <groupId>com.splunk</groupId>
-        <version>1.0.0</version>
+        <version>1.0.1</version>
     </parent>
     <properties>
         <https.protocols>TLSv1.2</https.protocols>
diff --git a/splunk/src/main/java/com/splunk/HttpService.java b/splunk/src/main/java/com/splunk/HttpService.java
index b7ec204e..fa11b24d 100644
--- a/splunk/src/main/java/com/splunk/HttpService.java
+++ b/splunk/src/main/java/com/splunk/HttpService.java
@@ -89,7 +89,7 @@ public boolean verify(String s, SSLSession sslSession) {
     private String prefix = null;
 
     static Map<String, String> defaultHeader = new HashMap<String, String>() {{
-        put("User-Agent", "splunk-sdk-java/1.7.1");
+        put("User-Agent", "splunk-sdk-java/1.7.2");
         put("Accept", "*/*");
     }};
     

From 43c535d18cbddb16041fa4f5e29c631df373f2ab Mon Sep 17 00:00:00 2001
From: bparmar-splunk <bparmar@splunk.com>
Date: Thu, 9 Dec 2021 15:36:18 +0530
Subject: [PATCH 30/30] Release v1.8.0

---
 CHANGELOG.md                                  |  8 +++--
 README.md                                     |  4 +--
 deploy                                        |  2 +-
 deploy.md                                     | 30 +++++++++----------
 examples/pom.xml                              |  2 +-
 pom.xml                                       |  2 +-
 splunk/pom.xml                                |  2 +-
 .../src/main/java/com/splunk/HttpService.java |  2 +-
 8 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c1e32e58..2438cf0c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,13 +1,14 @@
 # Splunk Enterprise SDK for Java Changelog
 
-## Version 1.7.2
+## Version 1.8.0
 
 ### New Features and APIs
 * Added a support to add custom headers in Service class. (Github PR [#176](https://github.com/splunk/splunk-sdk-java/pull/176)).
 * SSL Certificate validation (default implementation) added. (Github PR [#175](https://github.com/splunk/splunk-sdk-java/pull/175)).
-  * Boolean flag is introduced to skip/validate certificate.
-  * Implementation is modified to validate certificate(s) of local and non-local environments.
+  * Boolean flag is introduced to skip/validate certificate. Use _HttpService.setValidateCertificates()_ to enable/disable certificate validation.
+  * Breaking change: Certificate validation is now enforced by default, for local or non-production use cases use _HttpService.setValidateCertificates(false)_.
 * Apps/app-install replaced with **apps/local**. (Github PR [#168](https://github.com/splunk/splunk-sdk-java/pull/168))
+* Breaking change: HttpService.useTLS flag removed, please use _HttpService.setSslSecurityProtocol()_ to set a specific SSL/TLS implementation or else TLS v1.2 is used by default for Java 1.8.
 
 ### Minor Changes
 
@@ -19,6 +20,7 @@
 * README.md file modified with all login methods along with Splunk Search creation example. (Github PR [#177](https://github.com/splunk/splunk-sdk-java/pull/177)).
 * Deploy plugin is removed from Splunk module pom to avoid redundancy. (Github PR [#172](https://github.com/splunk/splunk-sdk-java/pull/172)).
 * Setter methods for Session and Bearer token added along with test case. (Github PR [#171](https://github.com/splunk/splunk-sdk-java/pull/171))
+  * **Use:** service.setSplunkToken() for session tokens and service.setBearerToken() for long-lived tokens.
 * Modular input folder name renamed based on newer splunk folder name validation. (Github PR [#168](https://github.com/splunk/splunk-sdk-java/pull/168))
 * SDK app collection URL has been updated to v1.1.0 in docker compose file. (Github PR [#168](https://github.com/splunk/splunk-sdk-java/pull/168))
   * Test files in sdk app collections are modified based on python v3 syntax.
diff --git a/README.md b/README.md
index 8fa975d1..77483b8a 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 [![Java SDK Test](https://github.com/splunk/splunk-sdk-java/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/splunk/splunk-sdk-java/actions/workflows/test.yml)
 # The Splunk Software Development Kit for Java
 
-#### Version 1.7.2
+#### Version 1.8.0
 
 The Splunk Software Development Kit (SDK) for Java contains library code and
 examples designed to enable developers to build applications using Splunk.
@@ -75,7 +75,7 @@ To add the Splunk SDK for Java `.JAR` file as a dependency:
   <dependency>
     <groupId>com.splunk</groupId>
     <artifactId>splunk</artifactId>
-    <version>1.7.2</version>
+    <version>1.8.0</version>
   </dependency>
 </dependencies>
 ```
diff --git a/deploy b/deploy
index 11bc3961..5a7a6c0d 100755
--- a/deploy
+++ b/deploy
@@ -2,7 +2,7 @@
 
 declare -r scriptDirectory="$(dirname $(readlink -e $0))"
 declare -r scriptName="$(basename $0)"
-declare -r version="1.7.2"
+declare -r version="1.8.0"
 
 if [[ $# -ne 1 ]]; then
     echo 1>&2 "Usage: ${scriptName} {local|staging||production}"
diff --git a/deploy.md b/deploy.md
index 3e688c05..af57427a 100644
--- a/deploy.md
+++ b/deploy.md
@@ -9,8 +9,8 @@ deploy \<repository-name>
 
 ##DESCRIPTION
 
-Deploy transmits **target/splunk-1.7.2.jar**, **target/splunk-1.7.2-javadoc.jar**, and
-**target/splunk-1.7.2-sources.jar** to the **local**, **staging**, or **production**
+Deploy transmits **target/splunk-1.8.0.jar**, **target/splunk-1.8.0-javadoc.jar**, and
+**target/splunk-1.8.0-sources.jar** to the **local**, **staging**, or **production**
 maven repository. Repository names are mapped to locations as follows.
 
 | repository-name | location                                                       |
@@ -21,18 +21,18 @@ maven repository. Repository names are mapped to locations as follows.
 
 After deployment you should find this tree structure at the location of your repository
 
-    com/splunk/splunk/1.7.2/
-    ├── splunk-1.7.2-javadoc.jar
-    ├── splunk-1.7.2-javadoc.jar.md5
-    ├── splunk-1.7.2-javadoc.jar.sha1
-    ├── splunk-1.7.2-sources.jar
-    ├── splunk-1.7.2-sources.jar.md5
-    ├── splunk-1.7.2-sources.jar.sha1
-    ├── splunk-1.7.2.jar
-    ├── splunk-1.7.2.jar.md5
-    ├── splunk-1.7.2.jar.sha1
-    ├── splunk-1.7.2.pom
-    ├── splunk-1.7.2.pom.md5
-    └── splunk-1.7.2.pom.sha1
+    com/splunk/splunk/1.8.0/
+    ├── splunk-1.8.0-javadoc.jar
+    ├── splunk-1.8.0-javadoc.jar.md5
+    ├── splunk-1.8.0-javadoc.jar.sha1
+    ├── splunk-1.8.0-sources.jar
+    ├── splunk-1.8.0-sources.jar.md5
+    ├── splunk-1.8.0-sources.jar.sha1
+    ├── splunk-1.8.0.jar
+    ├── splunk-1.8.0.jar.md5
+    ├── splunk-1.8.0.jar.sha1
+    ├── splunk-1.8.0.pom
+    ├── splunk-1.8.0.pom.md5
+    └── splunk-1.8.0.pom.sha1
 
 Verify this structure prior to release.
diff --git a/examples/pom.xml b/examples/pom.xml
index 7a32d299..49d8981c 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -37,7 +37,7 @@
         <dependency>
             <groupId>com.splunk</groupId>
             <artifactId>splunk</artifactId>
-            <version>1.7.2</version>
+            <version>1.8.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
diff --git a/pom.xml b/pom.xml
index ec4ac168..9bfafba5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <properties>
-        <version.number>1.7.2</version.number>
+        <version.number>1.8.0</version.number>
         <maven.resources.overwrite>true</maven.resources.overwrite>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <maven.compiler.source>8</maven.compiler.source>
diff --git a/splunk/pom.xml b/splunk/pom.xml
index e17ee521..4e0e361d 100644
--- a/splunk/pom.xml
+++ b/splunk/pom.xml
@@ -5,7 +5,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>splunk</artifactId>
-    <version>1.7.2</version>
+    <version>1.8.0</version>
     <parent>
         <artifactId>splunk-sdk-java</artifactId>
         <groupId>com.splunk</groupId>
diff --git a/splunk/src/main/java/com/splunk/HttpService.java b/splunk/src/main/java/com/splunk/HttpService.java
index fa11b24d..ef7d335d 100644
--- a/splunk/src/main/java/com/splunk/HttpService.java
+++ b/splunk/src/main/java/com/splunk/HttpService.java
@@ -89,7 +89,7 @@ public boolean verify(String s, SSLSession sslSession) {
     private String prefix = null;
 
     static Map<String, String> defaultHeader = new HashMap<String, String>() {{
-        put("User-Agent", "splunk-sdk-java/1.7.2");
+        put("User-Agent", "splunk-sdk-java/1.8.0");
         put("Accept", "*/*");
     }};
     
