Skip to content

Commit 494f52c

Browse files
authored
fix: authentication strategy comparison now uses equals function for strings correctly (#23)
## Summary ### Bug Fixes - Fixed few instances of faulty string comparisons in `ApiClient.java` (fixes #22)
1 parent 712502a commit 494f52c

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Add this dependency to your project's POM:
4949
<dependency>
5050
<groupId>one.talon</groupId>
5151
<artifactId>talon-one-client</artifactId>
52-
<version>4.4.0</version>
52+
<version>4.4.1</version>
5353
<scope>compile</scope>
5454
</dependency>
5555
```
@@ -59,7 +59,7 @@ Add this dependency to your project's POM:
5959
Add this dependency to your project's build file:
6060

6161
```groovy
62-
compile "one.talon:talon-one-client:4.4.0"
62+
compile "one.talon:talon-one-client:4.4.1"
6363
```
6464

6565
### Others
@@ -72,7 +72,7 @@ mvn clean package
7272

7373
Then manually install the following JARs:
7474

75-
* `target/talon-one-client-4.4.0.jar`
75+
* `target/talon-one-client-4.4.1.jar`
7676
* `target/lib/*.jar`
7777

7878
## Getting Started

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'eclipse'
33
apply plugin: 'java'
44

55
group = 'one.talon'
6-
version = '4.4.0'
6+
version = '4.4.1'
77

88
buildscript {
99
repositories {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "one.talon",
44
name := "talon-one-client",
5-
version := "4.4.0",
5+
version := "4.4.1",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>talon-one-client</artifactId>
66
<packaging>jar</packaging>
77
<name>talon-one-client</name>
8-
<version>4.4.0</version>
8+
<version>4.4.1</version>
99
<url>https://github.com/talon-one/maven-artefacts</url>
1010
<description>Talon.One unified JAVA SDK. It allows for programmatic access to the integration and management API with their respective authentication strategies</description>
1111
<scm>

src/main/java/one/talon/ApiClient.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ public class ApiClient {
9090
public ApiClient(String authenticationStrategy) {
9191
init();
9292

93-
if (authenticationStrategy == "manager_auth") {
93+
if (authenticationStrategy.equals("manager_auth")) {
9494
authentications.put("manager_auth", new ApiKeyAuth("header", "Authorization"));
9595
}
9696

97-
if (authenticationStrategy == "api_key_v1") {
97+
if (authenticationStrategy.equals("api_key_v1")) {
9898
authentications.put("api_key_v1", new ApiKeyAuth("header", "Authorization"));
9999
}
100100

101-
if (authenticationStrategy == "integration_auth") {
101+
if (authenticationStrategy.equals("integration_auth")) {
102102
authentications.put("integration_auth", new ApiKeyAuth("header", "Content-Signature"));
103103
}
104104
}
@@ -128,7 +128,7 @@ private void init() {
128128
json = new JSON();
129129

130130
// Set default User-Agent.
131-
setUserAgent("OpenAPI-Generator/4.4.0/java");
131+
setUserAgent("OpenAPI-Generator/4.4.1/java");
132132

133133
authentications = new HashMap<String, Authentication>();
134134
}
@@ -1252,7 +1252,7 @@ public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<
12521252
Authentication auth = authentications.get(authName);
12531253
if (auth != null) {
12541254
foundAuth = true;
1255-
if (authName == "integration_auth") {
1255+
if (authName.equals("integration_auth")) {
12561256
try {
12571257
if (body == null) {
12581258
throw new RuntimeException("No body provided to sign with HMAC");

0 commit comments

Comments
 (0)