mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1244944 - Remove untyped EJO.putAll. r=rnewman
MozReview-Commit-ID: 2TQNGErFAMv
This commit is contained in:
parent
c6f78cf224
commit
80a6d27839
@ -35,14 +35,7 @@ public class JSONWebTokenUtils {
|
||||
public static final String DEFAULT_ASSERTION_ISSUER = "127.0.0.1";
|
||||
|
||||
public static String encode(String payload, SigningPrivateKey privateKey) throws UnsupportedEncodingException, GeneralSecurityException {
|
||||
return encode(payload, privateKey, null);
|
||||
}
|
||||
|
||||
protected static String encode(String payload, SigningPrivateKey privateKey, Map<String, Object> headerFields) throws UnsupportedEncodingException, GeneralSecurityException {
|
||||
ExtendedJSONObject header = new ExtendedJSONObject();
|
||||
if (headerFields != null) {
|
||||
header.putAll(headerFields);
|
||||
}
|
||||
final ExtendedJSONObject header = new ExtendedJSONObject();
|
||||
header.put("alg", privateKey.getAlgorithm());
|
||||
String encodedHeader = Base64.encodeBase64URLSafeString(header.toJSONString().getBytes("UTF-8"));
|
||||
String encodedPayload = Base64.encodeBase64URLSafeString(payload.getBytes("UTF-8"));
|
||||
|
@ -294,11 +294,6 @@ public class ExtendedJSONObject {
|
||||
map.put(key, value);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void putAll(Map map) {
|
||||
this.object.putAll(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove key-value pair from JSONObject.
|
||||
*
|
||||
|
@ -20,6 +20,7 @@ import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertNull;
|
||||
@ -62,7 +63,6 @@ public class TestExtendedJSONObject {
|
||||
public void testSafeInteger() {
|
||||
ExtendedJSONObject o = new ExtendedJSONObject();
|
||||
o.put("integer", Integer.valueOf(5));
|
||||
o.put("double", Double.valueOf(1.2));
|
||||
o.put("string", "66");
|
||||
o.put("object", new ExtendedJSONObject());
|
||||
o.put("null", null);
|
||||
@ -146,8 +146,7 @@ public class TestExtendedJSONObject {
|
||||
ExtendedJSONObject q = new ExtendedJSONObject(exampleJSON);
|
||||
q.put("modified", 0);
|
||||
assertNotSame(o, q);
|
||||
q.put("modified", o.get("modified"));
|
||||
assertEquals(o, q);
|
||||
assertNotEquals(o, q);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user