howler-api 3.0.0.dev365__py3-none-any.whl → 3.0.0.dev368__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of howler-api might be problematic. Click here for more details.

@@ -1,3 +1,4 @@
1
+ import json
1
2
  import sys
2
3
  import time
3
4
  from typing import Callable
@@ -45,7 +46,10 @@ if __name__ == "__main__":
45
46
  print("Invalid index provided, stopping.")
46
47
  sys.exit(1)
47
48
 
48
- print("You will be reindexing the following indexes:")
49
+ print("Index schema:")
50
+ print(json.dumps(ds.hit._get_index_mappings(), indent=2))
51
+
52
+ print("\nYou will be reindexing the following indexes:")
49
53
  print("\n".join(indexes[index_answer][0]))
50
54
 
51
55
  answer = input(("\nAre you sure you want to reindex these indexes? [yes/NO]\n"))
howler/odm/base.py CHANGED
@@ -1093,8 +1093,8 @@ class Model:
1093
1093
  return out
1094
1094
 
1095
1095
  @classmethod
1096
- def add_namespace(cls, namespace: str, field: _Field):
1097
- field.name = namespace
1096
+ def add_namespace(cls, namespace: str, field: _Field, index=None, store=None, description=None):
1097
+ recursive_set_name(field, namespace)
1098
1098
 
1099
1099
  if hasattr(cls, "_odm_field_cache_skip"):
1100
1100
  cls._odm_field_cache_skip[namespace.rstrip("_")] = field
@@ -1102,7 +1102,25 @@ class Model:
1102
1102
  if hasattr(cls, "_odm_field_cache"):
1103
1103
  cls._odm_field_cache[namespace.rstrip("_")] = field
1104
1104
 
1105
- return setattr(cls, namespace, field)
1105
+ setattr(cls, namespace, field)
1106
+
1107
+ field._Model__description = description
1108
+ for name, field_data in field.fields().items():
1109
+ if not FIELD_SANITIZER.match(name) or name in BANNED_FIELDS:
1110
+ raise HowlerValueError(f"Illegal variable name: {name}")
1111
+
1112
+ recursive_set_name(field_data, name)
1113
+ field_data.apply_defaults(index=index, store=store)
1114
+
1115
+ @classmethod
1116
+ def remove_namespace(cls, namespace: str):
1117
+ if hasattr(cls, "_odm_field_cache_skip"):
1118
+ del cls._odm_field_cache_skip[namespace.rstrip("_")]
1119
+
1120
+ if hasattr(cls, "_odm_field_cache"):
1121
+ del cls._odm_field_cache[namespace.rstrip("_")]
1122
+
1123
+ delattr(cls, namespace)
1106
1124
 
1107
1125
  @staticmethod
1108
1126
  def _recurse_fields(name, field, show_compound, skip_mappings, multivalued=False):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: howler-api
3
- Version: 3.0.0.dev365
3
+ Version: 3.0.0.dev368
4
4
  Summary: Howler - API server
5
5
  License: MIT
6
6
  Keywords: howler,alerting,gc,canada,cse-cst,cse,cst,cyber,cccs
@@ -70,7 +70,7 @@ howler/external/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
70
70
  howler/external/generate_mitre.py,sha256=B4ALOP9OdAuq45u0UahprtFkG-B0SuMw-PwuUdZFFfM,2638
71
71
  howler/external/generate_sigma_rules.py,sha256=QkdgEtOYqazRqvc0sfkP_sZmooDbmog6BUfgTJ2zhPY,831
72
72
  howler/external/generate_tlds.py,sha256=S_J-x3QUaRjpZKOcBrnL8w7-FfTNKLOIrvW3qJDcj4Y,1386
73
- howler/external/reindex_data.py,sha256=PHNivziWRi5EXemz3Eu0xQBWUkegJ-EMqgS_apVI6vw,2115
73
+ howler/external/reindex_data.py,sha256=37rHW3vsL0oUYZ9EDEyEzZKmnonUuSA6Q9ueM-6dshg,2219
74
74
  howler/external/wipe_databases.py,sha256=CO_mUdezp24h6xz6Di_K5-Mid61d9EVcBO4ap5qnVao,1610
75
75
  howler/gunicorn_config.py,sha256=0X7DPFcVDu3qAgMbNsdYGqCuvQGn5ZNx_eapOMyuXuI,750
76
76
  howler/healthz.py,sha256=nvb8MBBERYIkA_UxxLIyNEQazYOnPCcm0sH0Jm5nF0k,769
@@ -84,7 +84,7 @@ howler/helper/workflow.py,sha256=fsYhjeZo1foM0J8AW3nMjTEJOAnh9R6L0f4ZL12pE4E,480
84
84
  howler/helper/ws.py,sha256=ONxC7DFYGQKpp0AmrFqQLeIyxOMD4nHk5i6lFyWOtqo,15911
85
85
  howler/odm/README.md,sha256=Ihc_DyjVQlLaIOEbPoQNPkum9Ecn8kn37-PMFQsX77s,5645
86
86
  howler/odm/__init__.py,sha256=1n6vgBOrFcCHSBFysqgODERvqP7s5DIeJe8N8UeE5pM,44
87
- howler/odm/base.py,sha256=uAgEaccEfoLZpNPlRheDzZTuDWTz-UJrTWNrKHeSFmo,52254
87
+ howler/odm/base.py,sha256=uK405FXmcSKqgTyLutPTMDSmcBvAfa94PUlAjJFyg2w,52987
88
88
  howler/odm/charter.txt,sha256=-Wgrv7nqugZmeQknJk0_m6klLJStjVbuqKbi_KaDinQ,15277
89
89
  howler/odm/helper.py,sha256=EELMg3pvE7Kb9VDeKSYJQHiq6uCO2YuS095CPRgWrEM,13927
90
90
  howler/odm/howler_enum.py,sha256=JzRK3_adlhvfkoGdMZD1jgOwlneZs8-x7OxGEj3zcpY,768
@@ -192,7 +192,7 @@ howler/utils/path.py,sha256=DfOU4i4zSs4wchHoE8iE7aWVLkTxiC_JRGepF2hBYBk,690
192
192
  howler/utils/socket_utils.py,sha256=nz1SklC9xBHUSfHyTJjpq3mbozX1GDf01WzdGxfaUII,2212
193
193
  howler/utils/str_utils.py,sha256=HE8Hqh2HlOLaj16w0H9zKOyDJLp-f1LQ50y_WeGZaEk,8389
194
194
  howler/utils/uid.py,sha256=p9dsqyvZ-lpiAuzZWCPCeEM99kdk0Ly9czf04HNdSuw,1341
195
- howler_api-3.0.0.dev365.dist-info/METADATA,sha256=XsJAA4VR6oNnUAdD7R6sPLoog-6Eub-fooNZah4Iwx0,2804
196
- howler_api-3.0.0.dev365.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
197
- howler_api-3.0.0.dev365.dist-info/entry_points.txt,sha256=Lu9SBGvwe0wczJHmc-RudC24lmQk7tv3ZBXon9RIihg,259
198
- howler_api-3.0.0.dev365.dist-info/RECORD,,
195
+ howler_api-3.0.0.dev368.dist-info/METADATA,sha256=GlyB_75ki5fgrngEj51ppdQjbKACmDS9teMNhOjiTWQ,2804
196
+ howler_api-3.0.0.dev368.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
197
+ howler_api-3.0.0.dev368.dist-info/entry_points.txt,sha256=Lu9SBGvwe0wczJHmc-RudC24lmQk7tv3ZBXon9RIihg,259
198
+ howler_api-3.0.0.dev368.dist-info/RECORD,,