Skip to content

Commit fbfb9d0

Browse files
netromsclaude
andauthored
fix: make ApiTokenAttribute Serializable for Ehcache L2 cache (#24002)
Ehcache 3.12.0 uses SerializingCopier which requires Java serialization. ApiTokenAttribute (and subclasses MethodAllowedList, IpAllowedList, RefererAllowedList) lacked Serializable, causing 500 errors on /api/me and /api/apiTokens when PATs exist. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 488028f commit fbfb9d0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

dhis-2/dhis-api/src/main/java/org/hisp/dhis/security/apikey/ApiTokenAttribute.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.fasterxml.jackson.annotation.JsonSubTypes;
3434
import com.fasterxml.jackson.annotation.JsonTypeInfo;
3535
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
36+
import java.io.Serializable;
3637
import org.hisp.dhis.common.DxfNamespaces;
3738
import org.hisp.dhis.common.EmbeddedObject;
3839

@@ -49,7 +50,7 @@
4950
@JsonSubTypes.Type(value = MethodAllowedList.class, name = "MethodAllowedList")
5051
})
5152
@JacksonXmlRootElement(localName = "apiTokenAttribute", namespace = DxfNamespaces.DXF_2_0)
52-
public abstract class ApiTokenAttribute implements EmbeddedObject {
53+
public abstract class ApiTokenAttribute implements EmbeddedObject, Serializable {
5354
protected final String type;
5455

5556
protected ApiTokenAttribute(String type) {

0 commit comments

Comments
 (0)