Skip to content

Commit 8ec18bc

Browse files
authored
v4.0.1
FIX: AUTH TOKEN VALIDATION
2 parents 3b8563b + 1ee1776 commit 8ec18bc

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>io.github.isa-group</groupId>
99
<artifactId>Pricing4Java</artifactId>
10-
<version>4.0.0</version>
10+
<version>4.0.1</version>
1111

1212
<name>${project.groupId}:${project.artifactId}</name>
1313
<description>A pricing driven feature toggling library for java</description>

src/main/java/io/github/isagroup/PricingContext.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,19 @@ public abstract class PricingContext {
3030
public abstract String getConfigFilePath();
3131

3232
/**
33-
* Returns the secret used to encode the JWT.
33+
* Returns the secret used to encode the pricing JWT.
3434
* * @return JWT secret String
3535
*/
3636
public abstract String getJwtSecret();
3737

38+
/**
39+
* Returns the secret used to encode the authorization JWT.
40+
* * @return JWT secret String
41+
*/
42+
public String getAuthJwtSecret(){
43+
return this.getJwtSecret();
44+
}
45+
3846
/**
3947
* Returns the expiration time of the JWT in milliseconds
4048
*

src/main/java/io/github/isagroup/services/jwt/PricingJwtUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public String getUserNameFromJwtToken(String token) {
121121
*/
122122
public boolean validateJwtToken(String authToken) {
123123
try {
124-
Jwts.parser().setSigningKey(pricingContext.getJwtSecret()).parseClaimsJws(authToken);
124+
Jwts.parser().setSigningKey(pricingContext.getAuthJwtSecret()).parseClaimsJws(authToken);
125125
return true;
126126
} catch (SignatureException e) {
127127
logger.error("Invalid JWT signature: {}", e.getMessage());

0 commit comments

Comments
 (0)