howler-api 2.12.0.330__py3-none-any.whl → 2.13.0.dev327__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.

howler/datastore/store.py CHANGED
@@ -55,6 +55,8 @@ class ESStore(object):
55
55
  config = _config
56
56
 
57
57
  self._apikey: Optional[tuple[str, str]] = None
58
+ self._username: Optional[str] = None
59
+ self._password: Optional[str] = None
58
60
  self._hosts = []
59
61
 
60
62
  for host in config.datastore.hosts:
@@ -64,6 +66,9 @@ class ESStore(object):
64
66
  os.environ[f"{host.name.upper()}_HOST_APIKEY_ID"],
65
67
  os.environ[f"{host.name.upper()}_HOST_APIKEY_SECRET"],
66
68
  )
69
+ elif os.getenv(f"{host.name.upper()}_HOST_USERNAME") is not None:
70
+ self._username = os.environ[f"{host.name.upper()}_HOST_USERNAME"]
71
+ self._password = os.environ[f"{host.name.upper()}_HOST_PASSWORD"]
67
72
 
68
73
  self._closed = False
69
74
  self._collections: dict[str, ESCollection] = {}
@@ -73,12 +78,26 @@ class ESStore(object):
73
78
  tracer = logging.getLogger("elasticsearch")
74
79
  tracer.setLevel(logging.CRITICAL)
75
80
 
76
- self.client = elasticsearch.Elasticsearch(
77
- hosts=self._hosts, # type: ignore
78
- api_key=self._apikey,
79
- max_retries=0,
80
- request_timeout=TRANSPORT_TIMEOUT,
81
- )
81
+ if self._apikey is not None:
82
+ self.client = elasticsearch.Elasticsearch(
83
+ hosts=self._hosts, # type: ignore
84
+ api_key=self._apikey,
85
+ max_retries=0,
86
+ request_timeout=TRANSPORT_TIMEOUT,
87
+ )
88
+ elif self._username is not None and self._password is not None:
89
+ self.client = elasticsearch.Elasticsearch(
90
+ hosts=self._hosts, # type: ignore
91
+ basic_auth=(self._username, self._password),
92
+ max_retries=0,
93
+ request_timeout=TRANSPORT_TIMEOUT,
94
+ )
95
+ else:
96
+ self.client = elasticsearch.Elasticsearch(
97
+ hosts=self._hosts, # type: ignore
98
+ max_retries=0,
99
+ request_timeout=TRANSPORT_TIMEOUT,
100
+ )
82
101
  self.eql = elasticsearch.client.EqlClient(self.client)
83
102
  self.archive_access = archive_access
84
103
  self.url_path = "elastic"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: howler-api
3
- Version: 2.12.0.330
3
+ Version: 2.13.0.dev327
4
4
  Summary: Howler - API server
5
5
  License: MIT
6
6
  Keywords: howler,alerting,gc,canada,cse-cst,cse,cst,cyber,cccs
@@ -54,8 +54,8 @@ Requires-Dist: requests (==2.32.4)
54
54
  Requires-Dist: typing-extensions (>=4.12.2,<5.0.0)
55
55
  Requires-Dist: validators (>=0.34.0,<0.35.0)
56
56
  Requires-Dist: wsproto (==1.2.0)
57
- Project-URL: Documentation, https://cybercentrecanada.github.io/howler/developer/backend/
58
- Project-URL: Homepage, https://cybercentrecanada.github.io/howler/
57
+ Project-URL: Documentation, https://cybercentrecanada.github.io/howler-docs/developer/backend/
58
+ Project-URL: Homepage, https://cybercentrecanada.github.io/howler-docs/
59
59
  Project-URL: Repository, https://github.com/CybercentreCanada/howler-api
60
60
  Description-Content-Type: text/markdown
61
61
 
@@ -62,7 +62,7 @@ howler/datastore/howler_store.py,sha256=kW7FKM-tILcfTmrjSB1yZm-ZnumPS_tiQEZUDaQo
62
62
  howler/datastore/migrations/fix_process.py,sha256=J0FxqcXbQ161sgmQ5teyEcPuX7WYB9wqs0CO8m1jk0U,1218
63
63
  howler/datastore/operations.py,sha256=5WdJBewXRIG71ZexQcYASv0IYoDi1m9ia8332u5mXSs,3919
64
64
  howler/datastore/schemas.py,sha256=kuxqYVWMgqnrdU-ypkDxoSzEtECUrRCKXjU_R5Kg7X4,3158
65
- howler/datastore/store.py,sha256=MiAJO55jrkZuB572vbQJAceCNcA7PeU4tLbzkoSLLqA,6111
65
+ howler/datastore/store.py,sha256=MzIvZy8deMgpnKR-TKTTcttH6kkYy4EBSYMCh0Q-J0E,7055
66
66
  howler/datastore/support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
67
  howler/datastore/support/build.py,sha256=5cX2Jl9vTgCWa_hiM-7LwxVm3pwHN5k0eiyGzHo11vE,7861
68
68
  howler/datastore/support/schemas.py,sha256=kuxqYVWMgqnrdU-ypkDxoSzEtECUrRCKXjU_R5Kg7X4,3158
@@ -194,7 +194,7 @@ howler/utils/path.py,sha256=DfOU4i4zSs4wchHoE8iE7aWVLkTxiC_JRGepF2hBYBk,690
194
194
  howler/utils/socket_utils.py,sha256=nz1SklC9xBHUSfHyTJjpq3mbozX1GDf01WzdGxfaUII,2212
195
195
  howler/utils/str_utils.py,sha256=HE8Hqh2HlOLaj16w0H9zKOyDJLp-f1LQ50y_WeGZaEk,8389
196
196
  howler/utils/uid.py,sha256=p9dsqyvZ-lpiAuzZWCPCeEM99kdk0Ly9czf04HNdSuw,1341
197
- howler_api-2.12.0.330.dist-info/METADATA,sha256=vmtwJSZedsVHVimSkBgnYx743JN9yynqD30eWVFwbUM,2802
198
- howler_api-2.12.0.330.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
199
- howler_api-2.12.0.330.dist-info/entry_points.txt,sha256=Lu9SBGvwe0wczJHmc-RudC24lmQk7tv3ZBXon9RIihg,259
200
- howler_api-2.12.0.330.dist-info/RECORD,,
197
+ howler_api-2.13.0.dev327.dist-info/METADATA,sha256=9HnnzJyvMRuTNlutykpH3woD2k9yvHaDeKEMWR9d0HI,2815
198
+ howler_api-2.13.0.dev327.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
199
+ howler_api-2.13.0.dev327.dist-info/entry_points.txt,sha256=Lu9SBGvwe0wczJHmc-RudC24lmQk7tv3ZBXon9RIihg,259
200
+ howler_api-2.13.0.dev327.dist-info/RECORD,,