secploy 0.2.4__tar.gz → 0.2.5__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: secploy
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Python SDK for Secploy security monitoring and event tracking
5
5
  Author-email: Abdulsamad Abdulganiyu <agastronics@gmail.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "secploy"
7
- version = "0.2.4"
7
+ version = "0.2.5"
8
8
  description = "Python SDK for Secploy security monitoring and event tracking"
9
9
  authors = [
10
10
  { name="Abdulsamad Abdulganiyu", email="agastronics@gmail.com" }
@@ -2,6 +2,6 @@ from .client import SecployClient
2
2
  from .schemas import SecployConfig
3
3
  from .enums import LogLevel
4
4
 
5
- __version__ = "0.2.4"
5
+ __version__ = "0.2.5"
6
6
  __all__ = ["SecployClient", "SecployConfig", "LogLevel"]
7
7
 
@@ -5,10 +5,8 @@ from typing import Any, Dict, Optional
5
5
  import requests
6
6
  from dataclasses import dataclass, field
7
7
 
8
- from lib.secploy_logger import setup_logger
9
- from .utils import log
10
- from lib.config import load_config, DEFAULT_CONFIG
11
- from .schemas import SecployConfig, LogLevel
8
+ from lib import setup_logger, load_config, DEFAULT_CONFIG, secploy_logger
9
+ from schemas import SecployConfig, LogLevel
12
10
 
13
11
  @dataclass
14
12
  class EventBatch:
@@ -105,7 +103,7 @@ class SecployClient:
105
103
  })
106
104
  return True
107
105
  except Exception as e:
108
- log(f"Failed to queue event: {e}", self.debug)
106
+ secploy_logger.error(f"Failed to queue event: {e}", self.debug)
109
107
  return False
110
108
 
111
109
  def _send_batch(self, events: list) -> bool:
@@ -123,10 +121,10 @@ class SecployClient:
123
121
  try:
124
122
  resp = requests.post(url, json={"events": events}, headers=self._headers(), timeout=5)
125
123
  if resp.status_code == 200:
126
- log(f"Batch of {len(events)} events sent successfully", self.debug)
124
+ secploy_logger.info(f"Batch of {len(events)} events sent successfully", self.debug)
127
125
  return True
128
126
  except Exception as e:
129
- log(f"Send batch failed: {e}", self.debug)
127
+ secploy_logger.error(f"Send batch failed: {e}", self.debug)
130
128
  time.sleep(1)
131
129
  return False
132
130
 
@@ -157,7 +155,7 @@ class SecployClient:
157
155
  time.sleep(1)
158
156
 
159
157
  except Exception as e:
160
- log(f"Error processing events: {e}", self.debug)
158
+ secploy_logger.error(f"Error processing events: {e}", self.debug)
161
159
 
162
160
  def _heartbeat_loop(self):
163
161
  """Send periodic heartbeats to the server."""
@@ -166,16 +164,16 @@ class SecployClient:
166
164
  try:
167
165
  resp = requests.post(url, headers=self._headers(), timeout=5)
168
166
  if resp.status_code == 200:
169
- log(f"Heartbeat sent successfully", self.debug)
167
+ secploy_logger.info(f"Heartbeat sent successfully", self.debug)
170
168
  else:
171
- log(f"Heartbeat failed with status {resp.status_code}", self.debug)
169
+ secploy_logger.error(f"Heartbeat failed with status {resp.status_code}", self.debug)
172
170
  except Exception as e:
173
- log(f"Heartbeat failed: {e}", self.debug)
171
+ secploy_logger.error(f"Heartbeat failed: {e}", self.debug)
174
172
  time.sleep(self.heartbeat_interval)
175
173
 
176
174
  def start(self):
177
175
  """Start the client's background threads for heartbeat and event processing."""
178
- log("Starting Secploy client...", self.debug)
176
+ secploy_logger.info("Starting Secploy client...", self.debug)
179
177
  self._stop_event.clear()
180
178
 
181
179
  # Start heartbeat thread
@@ -196,7 +194,7 @@ class SecployClient:
196
194
 
197
195
  def stop(self):
198
196
  """Stop the client and wait for background threads to finish."""
199
- log("Stopping Secploy client...", self.debug)
197
+ secploy_logger.info("Stopping Secploy client...", self.debug)
200
198
  self._stop_event.set()
201
199
 
202
200
  # Wait for threads to finish
@@ -1,6 +1,6 @@
1
1
  from typing import TypedDict, Optional, Union
2
2
 
3
- from secploy.enums import LogLevel
3
+ from enums import LogLevel
4
4
 
5
5
 
6
6
  class SecployConfig(TypedDict, total=False):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: secploy
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Python SDK for Secploy security monitoring and event tracking
5
5
  Author-email: Abdulsamad Abdulganiyu <agastronics@gmail.com>
6
6
  License: MIT License
@@ -7,14 +7,12 @@ setup.cfg
7
7
  ./secploy/client.py
8
8
  ./secploy/enums.py
9
9
  ./secploy/exceptions.py
10
- ./secploy/schema.py
11
10
  ./secploy/schemas.py
12
11
  ./secploy/utils.py
13
12
  secploy/__init__.py
14
13
  secploy/client.py
15
14
  secploy/enums.py
16
15
  secploy/exceptions.py
17
- secploy/schema.py
18
16
  secploy/schemas.py
19
17
  secploy/utils.py
20
18
  secploy.egg-info/PKG-INFO
@@ -1,5 +0,0 @@
1
-
2
- def log(message, debug):
3
- if debug:
4
- print(f"[Secploy] {message}")
5
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes