From 8ebb7775a35b632d49a8f294d83ac786666631f3 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Mon, 18 Dec 2023 14:18:25 +0000 Subject: [feature] request blocking by http headers (#2409) --- internal/api/client/admin/admin.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'internal/api/client/admin/admin.go') diff --git a/internal/api/client/admin/admin.go b/internal/api/client/admin/admin.go index 16c5fa8f8..6173218e0 100644 --- a/internal/api/client/admin/admin.go +++ b/internal/api/client/admin/admin.go @@ -35,6 +35,10 @@ const ( DomainAllowsPath = BasePath + "/domain_allows" DomainAllowsPathWithID = DomainAllowsPath + "/:" + IDKey DomainKeysExpirePath = BasePath + "/domain_keys_expire" + HeaderAllowsPath = BasePath + "/header_allows" + HeaderAllowsPathWithID = HeaderAllowsPath + "/:" + IDKey + HeaderBlocksPath = BasePath + "/header_blocks" + HeaderBlocksPathWithID = HeaderAllowsPath + "/:" + IDKey AccountsPath = BasePath + "/accounts" AccountsPathWithID = AccountsPath + "/:" + IDKey AccountsActionPath = AccountsPathWithID + "/action" @@ -95,6 +99,16 @@ func (m *Module) Route(attachHandler func(method string, path string, f ...gin.H attachHandler(http.MethodGet, DomainAllowsPathWithID, m.DomainAllowGETHandler) attachHandler(http.MethodDelete, DomainAllowsPathWithID, m.DomainAllowDELETEHandler) + // header filtering administration routes + attachHandler(http.MethodGet, HeaderAllowsPathWithID, m.HeaderFilterAllowGET) + attachHandler(http.MethodGet, HeaderBlocksPathWithID, m.HeaderFilterBlockGET) + attachHandler(http.MethodGet, HeaderAllowsPath, m.HeaderFilterAllowsGET) + attachHandler(http.MethodGet, HeaderBlocksPath, m.HeaderFilterBlocksGET) + attachHandler(http.MethodPost, HeaderAllowsPath, m.HeaderFilterAllowPOST) + attachHandler(http.MethodPost, HeaderBlocksPath, m.HeaderFilterBlockPOST) + attachHandler(http.MethodDelete, HeaderAllowsPathWithID, m.HeaderFilterAllowDELETE) + attachHandler(http.MethodDelete, HeaderBlocksPathWithID, m.HeaderFilterBlockDELETE) + // domain maintenance stuff attachHandler(http.MethodPost, DomainKeysExpirePath, m.DomainKeysExpirePOSTHandler) -- cgit v1.2.3