diff options
Diffstat (limited to 'internal/api')
| -rw-r--r-- | internal/api/client/admin/domainpermissionsubscriptioncreate.go | 11 | ||||
| -rw-r--r-- | internal/api/client/admin/domainpermissionsubscriptionupdate.go | 11 | ||||
| -rw-r--r-- | internal/api/model/domain.go | 7 |
3 files changed, 29 insertions, 0 deletions
diff --git a/internal/api/client/admin/domainpermissionsubscriptioncreate.go b/internal/api/client/admin/domainpermissionsubscriptioncreate.go index f44eda748..e57b4bc3f 100644 --- a/internal/api/client/admin/domainpermissionsubscriptioncreate.go +++ b/internal/api/client/admin/domainpermissionsubscriptioncreate.go @@ -94,6 +94,15 @@ import ( // type: boolean // default: false // - +// name: remove_retracted +// in: formData +// description: >- +// If true, then when a list is processed, if the list does *not* contain entries that +// it *did* contain previously, ie., retracted entries, then domain permissions +// corresponding to those entries will be removed. If false, they will just be orphaned instead. +// type: boolean +// default: true +// - // name: uri // required: true // in: formData @@ -234,6 +243,8 @@ func (m *Module) DomainPermissionSubscriptionPOSTHandler(c *gin.Context) { contentType, permType, asDraft, + form.AdoptOrphans, + form.RemoveRetracted, util.PtrOrZero(form.FetchUsername), // Optional. util.PtrOrZero(form.FetchPassword), // Optional. ) diff --git a/internal/api/client/admin/domainpermissionsubscriptionupdate.go b/internal/api/client/admin/domainpermissionsubscriptionupdate.go index 364e75f80..416f8ec10 100644 --- a/internal/api/client/admin/domainpermissionsubscriptionupdate.go +++ b/internal/api/client/admin/domainpermissionsubscriptionupdate.go @@ -97,6 +97,15 @@ import ( // type: boolean // default: false // - +// name: remove_retracted +// in: formData +// description: >- +// If true, then when a list is processed, if the list does *not* contain entries that +// it *did* contain previously, ie., retracted entries, then domain permissions +// corresponding to those entries will be removed. If false, they will just be orphaned instead. +// type: boolean +// default: true +// - // name: content_type // in: formData // description: >- @@ -227,6 +236,7 @@ func (m *Module) DomainPermissionSubscriptionPATCHHandler(c *gin.Context) { contentType == nil && form.AsDraft == nil && form.AdoptOrphans == nil && + form.RemoveRetracted == nil && form.FetchUsername == nil && form.FetchPassword == nil { const errText = "no updateable fields set on request" @@ -244,6 +254,7 @@ func (m *Module) DomainPermissionSubscriptionPATCHHandler(c *gin.Context) { contentType, form.AsDraft, form.AdoptOrphans, + form.RemoveRetracted, form.FetchUsername, form.FetchPassword, ) diff --git a/internal/api/model/domain.go b/internal/api/model/domain.go index b793d77b0..c6d868975 100644 --- a/internal/api/model/domain.go +++ b/internal/api/model/domain.go @@ -131,6 +131,9 @@ type DomainPermissionSubscription struct { // If true, this domain permission subscription will "adopt" domain permissions which already exist on the instance, and which meet the following conditions: 1) they have no subscription ID (ie., they're "orphaned") and 2) they are present in the subscribed list. Such orphaned domain permissions will be given this subscription's subscription ID value. // example: false AdoptOrphans bool `json:"adopt_orphans"` + // If true, then when a list is processed, if the list does *not* contain entries that it *did* contain previously, ie., retracted entries, then domain permissions corresponding to those entries will be removed. If false, they will just be orphaned instead. + // example: true + RemoveRetracted bool `json:"remove_retracted"` // Time at which the subscription was created (ISO 8601 Datetime). // example: 2021-07-30T09:20:25+00:00 CreatedAt string `json:"created_at"` @@ -198,6 +201,10 @@ type DomainPermissionSubscriptionRequest struct { // in the subscribed list. Such orphaned domain permissions will be given this // subscription's subscription ID value and be managed by this subscription. AdoptOrphans *bool `form:"adopt_orphans" json:"adopt_orphans"` + // If true, then when a list is processed, if the list does *not* contain entries that + // it *did* contain previously, ie., retracted entries, then domain permissions + // corresponding to those entries will be removed. If false, they will just be orphaned instead. + RemoveRetracted *bool `form:"remove_retracted" json:"remove_retracted"` // (Optional) username to set for basic auth when doing a fetch of URI. // example: admin123 FetchUsername *string `form:"fetch_username" json:"fetch_username"` |
