Skip to content

Commit

Permalink
feat(oxauth): uppercased typ=JWT #1903 (#1904)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed May 1, 2024
1 parent d4cbc4f commit ebb93aa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Model/src/main/java/org/gluu/oxauth/model/jwt/JwtType.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
*/
public enum JwtType {

JWT;
JWT("JWT");

private final String paramName;

JwtType(String paramName) {
this.paramName = paramName;
}

/**
* Returns the corresponding {@link JwtType} for a parameter.
Expand All @@ -30,4 +36,13 @@ public static JwtType fromString(String param) {
}
return null;
}

public String getParamName() {
return paramName;
}

@Override
public String toString() {
return paramName;
}
}
16 changes: 16 additions & 0 deletions Model/src/test/java/org/gluu/oxauth/model/jwt/JwtTypeTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.gluu.oxauth.model.jwt;

import org.testng.annotations.Test;

import static org.testng.Assert.assertEquals;

/**
* @author Yuriy Z
*/
public class JwtTypeTest {

@Test
public void jwtTypeHeader_mustBeUppercased() {
assertEquals(JwtType.JWT.toString(), "JWT");
}
}

0 comments on commit ebb93aa

Please sign in to comment.