diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api/activity/model')
3 files changed, 38 insertions, 3 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java b/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java index 7859be86..84a3e018 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/ActivityObject.java @@ -3,6 +3,9 @@ package com.juick.server.api.activity.model; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.Instant; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; public abstract class ActivityObject { @@ -23,11 +26,12 @@ public abstract class ActivityObject { } @JsonProperty("@context") - public String getContext() { - return CONTEXT_URI; + public List<String> getContext() { + return Arrays.asList(ACTIVITY_STREAMS_URI, SECURITY_URI); } - public final static String CONTEXT_URI = "https://www.w3.org/ns/activitystreams"; + public final static String ACTIVITY_STREAMS_URI = "https://www.w3.org/ns/activitystreams"; + public final static String SECURITY_URI = "https://w3id.org/security/v1"; public final static String LD_JSON_MEDIA_TYPE = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""; public final static String ACTIVITY_JSON_MEDIA_TYPE = "application/activity+json; profile=\"https://www.w3.org/ns/activitystreams\""; diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Key.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Key.java new file mode 100644 index 00000000..32417778 --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Key.java @@ -0,0 +1,22 @@ +package com.juick.server.api.activity.model; + +public class Key extends ActivityObject { + private String owner; + private String publicKeyPem; + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getPublicKeyPem() { + return publicKeyPem; + } + + public void setPublicKeyPem(String publicKeyPem) { + this.publicKeyPem = publicKeyPem; + } +} diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java index f4312ffc..97fa5ae8 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java @@ -9,6 +9,7 @@ public class Person extends ActivityObject { private String following; private String followers; private Link url; + private Key publicKey; @Override public String getType() { @@ -70,4 +71,12 @@ public class Person extends ActivityObject { public void setUrl(Link url) { this.url = url; } + + public Key getPublicKey() { + return publicKey; + } + + public void setPublicKey(Key publicKey) { + this.publicKey = publicKey; + } } |