Skip to content

Commit

Permalink
Drop: legacy search endpoint (#1002)
Browse files Browse the repository at this point in the history
* Drop: legacy search endpoint

* Fix test
  • Loading branch information
psrok1 authored Dec 12, 2024
1 parent da78e56 commit 3f1fe5d
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 88 deletions.
4 changes: 0 additions & 4 deletions mwdb/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
RemoteTextBlobPullResource,
RemoteTextBlobPushResource,
)
from mwdb.resources.search import SearchResource
from mwdb.resources.server import (
PingResource,
ServerAdminInfoResource,
Expand Down Expand Up @@ -305,9 +304,6 @@ def apply_rate_limit():
api.add_resource(RequestSampleDownloadResource, "/request/sample/<identifier>")
api.add_resource(DownloadResource, "/download/<access_token>")

# Search endpoints
api.add_resource(SearchResource, "/search")

# Quick query endpoints
api.add_resource(
QuickQueryResource, "/<any(file, config, blob, object):type>/quick_query"
Expand Down
4 changes: 0 additions & 4 deletions mwdb/core/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ class DeprecatedFeature(Enum):
# Use /file/<id>/download instead
# Deprecated in v2.2.0
legacy_file_download = "legacy_file_download"
# Legacy /search
# Use GET /<object_type> instead
# Deprecated in v2.0.0
legacy_search = "legacy_search"
# Legacy Metakey API
# Use Attribute API instead
# Deprecated in v2.6.0
Expand Down
68 changes: 0 additions & 68 deletions mwdb/resources/search.py

This file was deleted.

10 changes: 0 additions & 10 deletions mwdb/schema/search.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/backend/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ def recent_blobs(self, page):
return res.json()

def search(self, query):
res = self.session.post(self.mwdb_url + "/search", json={"query": query})
res = self.session.get(self.mwdb_url + "/object", params={"query": query})
res.raise_for_status()
return res.json()
return res.json()["objects"]

def check_operational(self):
for attempt in range(10):
Expand Down

0 comments on commit 3f1fe5d

Please sign in to comment.