File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import decouple
22from leakix import Client
3- from leakix .query import MustQuery , MustNotQuery
3+ from leakix .query import MustQuery , MustNotQuery , RawQuery
44from leakix .field import PluginField , CountryField
55from leakix .plugin import Plugin
66
@@ -52,8 +52,22 @@ def example_get_leaks_multiple_filter_plugins_must_not():
5252 )
5353
5454
55+ def example_get_leak_raw_query ():
56+ raw_query = '+plugin:HttpNTLM +country:"France"'
57+ query = RawQuery (raw_query )
58+ response = CLIENT .get_leak (queries = [query ])
59+ assert response .status_code () == 200
60+ assert all (
61+ (
62+ i .geoip .country_name == "France" and i .tags == ["ntlm" ]
63+ for i in response .json ()
64+ )
65+ )
66+
67+
5568if __name__ == "__main__" :
5669 example_get_host_filter_plugin ()
5770 example_get_service_filter_plugin ()
5871 example_get_leaks_filter_multiple_plugins ()
5972 example_get_leaks_multiple_filter_plugins_must_not ()
73+ example_get_leak_raw_query ()
Original file line number Diff line number Diff line change @@ -32,3 +32,11 @@ def serialize(self) -> str:
3232class ShouldQuery (Query ):
3333 def serialize (self ) -> str :
3434 return "%s" % self .field .serialize ()
35+
36+
37+ class RawQuery (AbstractQuery ):
38+ def __init__ (self , raw_q : str ):
39+ self .raw_q = raw_q
40+
41+ def serialize (self ) -> str :
42+ return self .raw_q
You can’t perform that action at this time.
0 commit comments