From 6a10df85abb84d824fc9cd385fc90dd624447c10 Mon Sep 17 00:00:00 2001 From: catbref Date: Wed, 16 Jan 2019 15:46:35 +0000 Subject: [PATCH] Hide internal-use references from some objects emitted by API --- src/main/java/org/qora/data/asset/AssetData.java | 6 ++++++ src/main/java/org/qora/data/group/GroupAdminData.java | 3 +++ src/main/java/org/qora/data/group/GroupBanData.java | 3 +++ src/main/java/org/qora/data/group/GroupData.java | 3 +++ src/main/java/org/qora/data/group/GroupInviteData.java | 3 +++ src/main/java/org/qora/data/group/GroupJoinRequestData.java | 3 +++ src/main/java/org/qora/data/group/GroupMemberData.java | 3 +++ .../data/transaction/CancelGroupBanTransactionData.java | 1 + .../data/transaction/CancelGroupInviteTransactionData.java | 1 + .../org/qora/data/transaction/GroupBanTransactionData.java | 3 +++ .../qora/data/transaction/GroupInviteTransactionData.java | 1 + .../org/qora/data/transaction/GroupKickTransactionData.java | 3 +++ .../org/qora/data/transaction/JoinGroupTransactionData.java | 1 + .../qora/data/transaction/LeaveGroupTransactionData.java | 2 ++ 14 files changed, 36 insertions(+) diff --git a/src/main/java/org/qora/data/asset/AssetData.java b/src/main/java/org/qora/data/asset/AssetData.java index ff3abc4c..d0652d21 100644 --- a/src/main/java/org/qora/data/asset/AssetData.java +++ b/src/main/java/org/qora/data/asset/AssetData.java @@ -2,6 +2,9 @@ package org.qora.data.asset; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlTransient; + +import io.swagger.v3.oas.annotations.media.Schema; // All properties to be converted to JSON via JAX-RS @XmlAccessorType(XmlAccessType.FIELD) @@ -14,6 +17,9 @@ public class AssetData { private String description; private long quantity; private boolean isDivisible; + // No need to expose this via API + @XmlTransient + @Schema(hidden = true) private byte[] reference; // Constructors diff --git a/src/main/java/org/qora/data/group/GroupAdminData.java b/src/main/java/org/qora/data/group/GroupAdminData.java index d5803423..d107bfb2 100644 --- a/src/main/java/org/qora/data/group/GroupAdminData.java +++ b/src/main/java/org/qora/data/group/GroupAdminData.java @@ -4,6 +4,8 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient; +import io.swagger.v3.oas.annotations.media.Schema; + // All properties to be converted to JSON via JAX-RS @XmlAccessorType(XmlAccessType.FIELD) public class GroupAdminData { @@ -14,6 +16,7 @@ public class GroupAdminData { /** Reference to transaction that triggered adminship. Could be JOIN_GROUP, GROUP_INVITE, CREATE_GROUP or others... */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] reference; // Constructors diff --git a/src/main/java/org/qora/data/group/GroupBanData.java b/src/main/java/org/qora/data/group/GroupBanData.java index 6f956acd..aec4bc02 100644 --- a/src/main/java/org/qora/data/group/GroupBanData.java +++ b/src/main/java/org/qora/data/group/GroupBanData.java @@ -4,6 +4,8 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient; +import io.swagger.v3.oas.annotations.media.Schema; + // All properties to be converted to JSON via JAX-RS @XmlAccessorType(XmlAccessType.FIELD) public class GroupBanData { @@ -18,6 +20,7 @@ public class GroupBanData { /** Reference to GROUP_BAN transaction, used to rebuild this ban during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] reference; // Constructors diff --git a/src/main/java/org/qora/data/group/GroupData.java b/src/main/java/org/qora/data/group/GroupData.java index 1662f834..9b6350bc 100644 --- a/src/main/java/org/qora/data/group/GroupData.java +++ b/src/main/java/org/qora/data/group/GroupData.java @@ -4,6 +4,8 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient; +import io.swagger.v3.oas.annotations.media.Schema; + // All properties to be converted to JSON via JAX-RS @XmlAccessorType(XmlAccessType.FIELD) public class GroupData { @@ -19,6 +21,7 @@ public class GroupData { /** Reference to CREATE_GROUP or UPDATE_GROUP transaction, used to rebuild group during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] reference; // Constructors diff --git a/src/main/java/org/qora/data/group/GroupInviteData.java b/src/main/java/org/qora/data/group/GroupInviteData.java index 735cb017..4722103a 100644 --- a/src/main/java/org/qora/data/group/GroupInviteData.java +++ b/src/main/java/org/qora/data/group/GroupInviteData.java @@ -4,6 +4,8 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient; +import io.swagger.v3.oas.annotations.media.Schema; + // All properties to be converted to JSON via JAX-RS @XmlAccessorType(XmlAccessType.FIELD) public class GroupInviteData { @@ -16,6 +18,7 @@ public class GroupInviteData { /** Reference to GROUP_INVITE transaction, used to rebuild this invite during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] reference; // Constructors diff --git a/src/main/java/org/qora/data/group/GroupJoinRequestData.java b/src/main/java/org/qora/data/group/GroupJoinRequestData.java index 69c86301..ff902aa9 100644 --- a/src/main/java/org/qora/data/group/GroupJoinRequestData.java +++ b/src/main/java/org/qora/data/group/GroupJoinRequestData.java @@ -4,6 +4,8 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient; +import io.swagger.v3.oas.annotations.media.Schema; + // All properties to be converted to JSON via JAX-RS @XmlAccessorType(XmlAccessType.FIELD) public class GroupJoinRequestData { @@ -14,6 +16,7 @@ public class GroupJoinRequestData { /** Reference to JOIN_GROUP transaction, used to rebuild this join request during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] reference; // Constructors diff --git a/src/main/java/org/qora/data/group/GroupMemberData.java b/src/main/java/org/qora/data/group/GroupMemberData.java index e1c048ff..6d9b7d6e 100644 --- a/src/main/java/org/qora/data/group/GroupMemberData.java +++ b/src/main/java/org/qora/data/group/GroupMemberData.java @@ -4,6 +4,8 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient; +import io.swagger.v3.oas.annotations.media.Schema; + // All properties to be converted to JSON via JAX-RS @XmlAccessorType(XmlAccessType.FIELD) public class GroupMemberData { @@ -15,6 +17,7 @@ public class GroupMemberData { /** Reference to transaction that triggered membership. Could be JOIN_GROUP, GROUP_INVITE, CREATE_GROUP or others... */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] reference; // Constructors diff --git a/src/main/java/org/qora/data/transaction/CancelGroupBanTransactionData.java b/src/main/java/org/qora/data/transaction/CancelGroupBanTransactionData.java index 4366a808..3ce5afd7 100644 --- a/src/main/java/org/qora/data/transaction/CancelGroupBanTransactionData.java +++ b/src/main/java/org/qora/data/transaction/CancelGroupBanTransactionData.java @@ -26,6 +26,7 @@ public class CancelGroupBanTransactionData extends TransactionData { /** Reference to GROUP_BAN transaction, used to rebuild ban during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] banReference; // Constructors diff --git a/src/main/java/org/qora/data/transaction/CancelGroupInviteTransactionData.java b/src/main/java/org/qora/data/transaction/CancelGroupInviteTransactionData.java index 02d17f46..646f3664 100644 --- a/src/main/java/org/qora/data/transaction/CancelGroupInviteTransactionData.java +++ b/src/main/java/org/qora/data/transaction/CancelGroupInviteTransactionData.java @@ -26,6 +26,7 @@ public class CancelGroupInviteTransactionData extends TransactionData { /** Reference to GROUP_INVITE transaction, used to rebuild invite during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] inviteReference; // Constructors diff --git a/src/main/java/org/qora/data/transaction/GroupBanTransactionData.java b/src/main/java/org/qora/data/transaction/GroupBanTransactionData.java index d0835f28..c8a2fd33 100644 --- a/src/main/java/org/qora/data/transaction/GroupBanTransactionData.java +++ b/src/main/java/org/qora/data/transaction/GroupBanTransactionData.java @@ -46,14 +46,17 @@ public class GroupBanTransactionData extends TransactionData { /** Reference to transaction that triggered membership. Could be JOIN_GROUP, GROUP_INVITE or UPDATE_GROUP transaction. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] memberReference; /** Reference to transaction that triggered adminship. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] adminReference; /** Reference to pending join-request or invite transaction that was deleted by this so it (invite/join-request) can be rebuilt during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] joinInviteReference; // Constructors diff --git a/src/main/java/org/qora/data/transaction/GroupInviteTransactionData.java b/src/main/java/org/qora/data/transaction/GroupInviteTransactionData.java index c67fcc52..9f6bfde9 100644 --- a/src/main/java/org/qora/data/transaction/GroupInviteTransactionData.java +++ b/src/main/java/org/qora/data/transaction/GroupInviteTransactionData.java @@ -28,6 +28,7 @@ public class GroupInviteTransactionData extends TransactionData { /** Reference to JOIN_GROUP transaction, used to rebuild this join request during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] joinReference; // Constructors diff --git a/src/main/java/org/qora/data/transaction/GroupKickTransactionData.java b/src/main/java/org/qora/data/transaction/GroupKickTransactionData.java index b6fdcdaf..ae4087af 100644 --- a/src/main/java/org/qora/data/transaction/GroupKickTransactionData.java +++ b/src/main/java/org/qora/data/transaction/GroupKickTransactionData.java @@ -43,14 +43,17 @@ public class GroupKickTransactionData extends TransactionData { /** Reference to transaction that triggered membership. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] memberReference; /** Reference to transaction that triggered adminship. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] adminReference; /** Reference to JOIN_GROUP transaction, used to rebuild this join request during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] joinReference; // Constructors diff --git a/src/main/java/org/qora/data/transaction/JoinGroupTransactionData.java b/src/main/java/org/qora/data/transaction/JoinGroupTransactionData.java index be156319..3e04484b 100644 --- a/src/main/java/org/qora/data/transaction/JoinGroupTransactionData.java +++ b/src/main/java/org/qora/data/transaction/JoinGroupTransactionData.java @@ -24,6 +24,7 @@ public class JoinGroupTransactionData extends TransactionData { /** Reference to GROUP_INVITE transaction, used to rebuild invite during orphaning. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] inviteReference; // Constructors diff --git a/src/main/java/org/qora/data/transaction/LeaveGroupTransactionData.java b/src/main/java/org/qora/data/transaction/LeaveGroupTransactionData.java index 6770621d..7c2dfa5a 100644 --- a/src/main/java/org/qora/data/transaction/LeaveGroupTransactionData.java +++ b/src/main/java/org/qora/data/transaction/LeaveGroupTransactionData.java @@ -24,10 +24,12 @@ public class LeaveGroupTransactionData extends TransactionData { /** Reference to transaction that triggered membership. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] memberReference; /** Reference to transaction that triggered adminship. */ // No need to ever expose this via API @XmlTransient + @Schema(hidden = true) private byte[] adminReference; // Constructors