summaryrefslogtreecommitdiff
path: root/internal/api/model
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/model')
-rw-r--r--internal/api/model/domain.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/internal/api/model/domain.go b/internal/api/model/domain.go
index 94a190f63..8d94321d0 100644
--- a/internal/api/model/domain.go
+++ b/internal/api/model/domain.go
@@ -33,8 +33,13 @@ type Domain struct {
// example: 2021-07-30T09:20:25+00:00
SilencedAt string `json:"silenced_at,omitempty"`
// If the domain is blocked, what's the publicly-stated reason for the block.
+ // Alternative to `public_comment` to be used when serializing/deserializing via /api/v1/instance.
// example: they smell
- PublicComment string `form:"public_comment" json:"public_comment,omitempty"`
+ Comment *string `form:"comment" json:"comment,omitempty"`
+ // If the domain is blocked, what's the publicly-stated reason for the block.
+ // Alternative to `comment` to be used when serializing/deserializing NOT via /api/v1/instance.
+ // example: they smell
+ PublicComment *string `form:"public_comment" json:"public_comment,omitempty"`
}
// DomainPermission represents a permission applied to one domain (explicit block/allow).
@@ -48,10 +53,10 @@ type DomainPermission struct {
ID string `json:"id,omitempty"`
// Obfuscate the domain name when serving this domain permission entry publicly.
// example: false
- Obfuscate bool `json:"obfuscate,omitempty"`
+ Obfuscate *bool `json:"obfuscate,omitempty"`
// Private comment for this permission entry, visible to this instance's admins only.
// example: they are poopoo
- PrivateComment string `json:"private_comment,omitempty"`
+ PrivateComment *string `json:"private_comment,omitempty"`
// If applicable, the ID of the subscription that caused this domain permission entry to be created.
// example: 01FBW25TF5J67JW3HFHZCSD23K
SubscriptionID string `json:"subscription_id,omitempty"`
@@ -80,14 +85,14 @@ type DomainPermissionRequest struct {
// Obfuscate the domain name when displaying this permission entry publicly.
// Ie., instead of 'example.org' show something like 'e**mpl*.or*'.
// example: false
- Obfuscate bool `form:"obfuscate" json:"obfuscate"`
+ Obfuscate *bool `form:"obfuscate" json:"obfuscate"`
// Private comment for other admins on why this permission entry was created.
// example: don't like 'em!!!!
- PrivateComment string `form:"private_comment" json:"private_comment"`
+ PrivateComment *string `form:"private_comment" json:"private_comment"`
// Public comment on why this permission entry was created.
// Will be visible to requesters at /api/v1/instance/peers if this endpoint is exposed.
// example: foss dorks 😫
- PublicComment string `form:"public_comment" json:"public_comment"`
+ PublicComment *string `form:"public_comment" json:"public_comment"`
// Permission type to create (only applies to domain permission drafts, not explicit blocks and allows).
PermissionType string `form:"permission_type" json:"permission_type"`
}