From 03d42d6e6ccaee4ff9d2a0808e51e5f9f0dc18c3 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 22 Aug 2021 06:55:37 +0300 Subject: ActivityPub: return Application profile for service user --- .../www/api/activity/model/objects/Actor.java | 81 ++++++++++++++++++++++ .../api/activity/model/objects/Application.java | 2 +- .../www/api/activity/model/objects/Person.java | 68 +----------------- .../api/activity/model/objects/SecurityObject.java | 36 ---------- 4 files changed, 83 insertions(+), 104 deletions(-) create mode 100644 src/main/java/com/juick/www/api/activity/model/objects/Actor.java delete mode 100644 src/main/java/com/juick/www/api/activity/model/objects/SecurityObject.java (limited to 'src/main/java/com/juick/www/api/activity/model/objects') diff --git a/src/main/java/com/juick/www/api/activity/model/objects/Actor.java b/src/main/java/com/juick/www/api/activity/model/objects/Actor.java new file mode 100644 index 00000000..f8bd63e0 --- /dev/null +++ b/src/main/java/com/juick/www/api/activity/model/objects/Actor.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2008-2021, Juick + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package com.juick.www.api.activity.model.objects; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.juick.www.api.activity.model.Context; + +public class Actor extends Context { + + private String preferredUsername; + private String inbox; + private String outbox; + private String following; + private String followers; + + private Key publicKey; + + @JsonTypeInfo(use = JsonTypeInfo.Id.NONE) + public Key getPublicKey() { + return publicKey; + } + + public void setPublicKey(Key publicKey) { + this.publicKey = publicKey; + } + + public String getOutbox() { + return outbox; + } + + public void setOutbox(String outbox) { + this.outbox = outbox; + } + + public String getInbox() { + return inbox; + } + + public void setInbox(String inbox) { + this.inbox = inbox; + } + + public String getFollowing() { + return following; + } + + public void setFollowing(String following) { + this.following = following; + } + + public String getFollowers() { + return followers; + } + + public void setFollowers(String followers) { + this.followers = followers; + } + + public String getPreferredUsername() { + return preferredUsername; + } + + public void setPreferredUsername(String preferredUsername) { + this.preferredUsername = preferredUsername; + } +} diff --git a/src/main/java/com/juick/www/api/activity/model/objects/Application.java b/src/main/java/com/juick/www/api/activity/model/objects/Application.java index 29361b33..d30d36c9 100644 --- a/src/main/java/com/juick/www/api/activity/model/objects/Application.java +++ b/src/main/java/com/juick/www/api/activity/model/objects/Application.java @@ -17,5 +17,5 @@ package com.juick.www.api.activity.model.objects; -public class Application extends SecurityObject { +public class Application extends Actor { } diff --git a/src/main/java/com/juick/www/api/activity/model/objects/Person.java b/src/main/java/com/juick/www/api/activity/model/objects/Person.java index 84844510..e59c793a 100644 --- a/src/main/java/com/juick/www/api/activity/model/objects/Person.java +++ b/src/main/java/com/juick/www/api/activity/model/objects/Person.java @@ -17,72 +17,6 @@ package com.juick.www.api.activity.model.objects; -import com.fasterxml.jackson.annotation.JsonTypeInfo; +public class Person extends Actor { -public class Person extends SecurityObject { - - private String name; - private String preferredUsername; - private Image icon; - private String inbox; - private String outbox; - private String following; - private String followers; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NONE) - public Image getIcon() { - return icon; - } - - public void setIcon(Image icon) { - this.icon = icon; - } - - public String getOutbox() { - return outbox; - } - - public void setOutbox(String outbox) { - this.outbox = outbox; - } - - public String getInbox() { - return inbox; - } - - public void setInbox(String inbox) { - this.inbox = inbox; - } - - public String getFollowing() { - return following; - } - - public void setFollowing(String following) { - this.following = following; - } - - public String getFollowers() { - return followers; - } - - public void setFollowers(String followers) { - this.followers = followers; - } - - public String getPreferredUsername() { - return preferredUsername; - } - - public void setPreferredUsername(String preferredUsername) { - this.preferredUsername = preferredUsername; - } } diff --git a/src/main/java/com/juick/www/api/activity/model/objects/SecurityObject.java b/src/main/java/com/juick/www/api/activity/model/objects/SecurityObject.java deleted file mode 100644 index 8d17aa29..00000000 --- a/src/main/java/com/juick/www/api/activity/model/objects/SecurityObject.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2008-2021, Juick - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package com.juick.www.api.activity.model.objects; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.juick.www.api.activity.model.Context; - -public class SecurityObject extends Context { - - private Key publicKey; - - @JsonTypeInfo(use = JsonTypeInfo.Id.NONE) - public Key getPublicKey() { - return publicKey; - } - - public void setPublicKey(Key publicKey) { - this.publicKey = publicKey; - } - -} -- cgit v1.2.3