hb-client 0.5.3__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.
- hb_client-0.5.3/LICENSE +17 -0
- hb_client-0.5.3/PKG-INFO +139 -0
- hb_client-0.5.3/README.md +101 -0
- hb_client-0.5.3/pyproject.toml +90 -0
- hb_client-0.5.3/setup.cfg +4 -0
- hb_client-0.5.3/src/hb_client/__init__.py +31 -0
- hb_client-0.5.3/src/hb_client/hbclient.py +1094 -0
- hb_client-0.5.3/src/hb_client.egg-info/PKG-INFO +139 -0
- hb_client-0.5.3/src/hb_client.egg-info/SOURCES.txt +16 -0
- hb_client-0.5.3/src/hb_client.egg-info/dependency_links.txt +1 -0
- hb_client-0.5.3/src/hb_client.egg-info/entry_points.txt +2 -0
- hb_client-0.5.3/src/hb_client.egg-info/requires.txt +14 -0
- hb_client-0.5.3/src/hb_client.egg-info/top_level.txt +1 -0
- hb_client-0.5.3/tests/test_cli.py +101 -0
- hb_client-0.5.3/tests/test_config.py +63 -0
- hb_client-0.5.3/tests/test_duration.py +92 -0
- hb_client-0.5.3/tests/test_hbclient.py +188 -0
- hb_client-0.5.3/tests/test_keymanager.py +148 -0
hb_client-0.5.3/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026, J. Will Pierce
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
hb_client-0.5.3/PKG-INFO
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hb-client
|
|
3
|
+
Version: 0.5.3
|
|
4
|
+
Summary: Secure heartbeat client for the Nuclei monitoring ecosystem
|
|
5
|
+
Author-email: "J. Will Pierce" <willp@users.noreply.github.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/willp/heartbeat-client
|
|
8
|
+
Project-URL: Repository, https://github.com/willp/heartbeat-client
|
|
9
|
+
Project-URL: Documentation, https://github.com/willp/heartbeat-client/blob/main/README.md
|
|
10
|
+
Project-URL: Issues, https://github.com/willp/heartbeat-client/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/willp/heartbeat-client/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: heartbeat,monitoring,nuclei,client,heartbeat-monitoring
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Topic :: System :: Monitoring
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: cryptography>=41.0.0
|
|
27
|
+
Requires-Dist: filelock>=3.12.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: build>=1.2.2; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest>=8.3.0; extra == "dev"
|
|
31
|
+
Requires-Dist: ruff>=0.6.0; extra == "dev"
|
|
32
|
+
Requires-Dist: twine>=5.1.0; extra == "dev"
|
|
33
|
+
Provides-Extra: typecheck
|
|
34
|
+
Requires-Dist: mypy>=1.11.0; extra == "typecheck"
|
|
35
|
+
Provides-Extra: release
|
|
36
|
+
Requires-Dist: commitizen>=3.29.0; extra == "release"
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# hb-client
|
|
40
|
+
|
|
41
|
+
A secure, high-reliability heartbeat client for monitoring your systems
|
|
42
|
+
using `hbserver` and `hbwatcher`.
|
|
43
|
+
|
|
44
|
+
## Project Scope
|
|
45
|
+
|
|
46
|
+
This repository contains only the Python client library and CLI for sending
|
|
47
|
+
heartbeat packets and managing local enrollment keys.
|
|
48
|
+
|
|
49
|
+
Related repositories:
|
|
50
|
+
|
|
51
|
+
- `hbserver` (`hb_backend`): API/authentication and key lifecycle services
|
|
52
|
+
- `hbwatcher` (`hb_watcher`): monitoring process that evaluates heartbeat data
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install hb-client
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
See [MIGRATION.md](MIGRATION.md) if upgrading from older distribution or config paths.
|
|
61
|
+
|
|
62
|
+
This installs:
|
|
63
|
+
|
|
64
|
+
- the Python package `hb_client`
|
|
65
|
+
- the CLI command `hbclient`
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
### As a library
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from hb_client import HbClient, HbConfig
|
|
73
|
+
|
|
74
|
+
config = HbConfig(server="hb.example.com", serverport=8333)
|
|
75
|
+
client = HbClient(name="my-service", interval=60, config=config)
|
|
76
|
+
client.send(task="deployment-complete")
|
|
77
|
+
client.close()
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### From the CLI
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
hbclient --server-url https://hb.example.com:8333 login
|
|
84
|
+
hbclient --server-url https://hb.example.com:8333 status
|
|
85
|
+
hbclient send --app my-service --task deploy --interval 60
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Features
|
|
89
|
+
|
|
90
|
+
- **AES-GCM encrypted UDP transport** with CRC32 integrity
|
|
91
|
+
- **OAuth Device Flow** for key management
|
|
92
|
+
- **Secure by default** with `strict_security=True`
|
|
93
|
+
- **Transparent DNS resolution** with configurable refresh intervals
|
|
94
|
+
- **Deterministic key rotation** with jitter to prevent thundering herd
|
|
95
|
+
- **Atomic file I/O** for crash-safe credential storage
|
|
96
|
+
- **Human-readable duration parsing** (e.g., `6h`, `2.5d`, `3w`)
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
Enrollment keys are stored under:
|
|
101
|
+
|
|
102
|
+
- Linux: `$XDG_CONFIG_HOME/hbclient/` or `~/.config/hbclient/`
|
|
103
|
+
- macOS: `~/Library/Application Support/hbclient/`
|
|
104
|
+
- Windows: `%APPDATA%/hbclient/`
|
|
105
|
+
|
|
106
|
+
## Security Mode (`strict_security`)
|
|
107
|
+
|
|
108
|
+
`HbClient` accepts `strict_security` (default: `True`). If enrollment is missing, construction raises `RuntimeError` with guidance to run:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
hbclient --server-url https://hb.example.com:8333 login
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## CLI Reference
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
hbclient [--server SERVER] [--serverport PORT] [--server-url URL] COMMAND
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Development
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
pip install -e ".[dev]"
|
|
124
|
+
make test
|
|
125
|
+
make pre-release
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Releasing
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
pip install -e ".[release]"
|
|
132
|
+
cz bump
|
|
133
|
+
make pre-release
|
|
134
|
+
python -m twine upload dist/hb_client-<version>*
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
Apache-2.0 — see [LICENSE](LICENSE)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# hb-client
|
|
2
|
+
|
|
3
|
+
A secure, high-reliability heartbeat client for monitoring your systems
|
|
4
|
+
using `hbserver` and `hbwatcher`.
|
|
5
|
+
|
|
6
|
+
## Project Scope
|
|
7
|
+
|
|
8
|
+
This repository contains only the Python client library and CLI for sending
|
|
9
|
+
heartbeat packets and managing local enrollment keys.
|
|
10
|
+
|
|
11
|
+
Related repositories:
|
|
12
|
+
|
|
13
|
+
- `hbserver` (`hb_backend`): API/authentication and key lifecycle services
|
|
14
|
+
- `hbwatcher` (`hb_watcher`): monitoring process that evaluates heartbeat data
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install hb-client
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
See [MIGRATION.md](MIGRATION.md) if upgrading from older distribution or config paths.
|
|
23
|
+
|
|
24
|
+
This installs:
|
|
25
|
+
|
|
26
|
+
- the Python package `hb_client`
|
|
27
|
+
- the CLI command `hbclient`
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
### As a library
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from hb_client import HbClient, HbConfig
|
|
35
|
+
|
|
36
|
+
config = HbConfig(server="hb.example.com", serverport=8333)
|
|
37
|
+
client = HbClient(name="my-service", interval=60, config=config)
|
|
38
|
+
client.send(task="deployment-complete")
|
|
39
|
+
client.close()
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### From the CLI
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
hbclient --server-url https://hb.example.com:8333 login
|
|
46
|
+
hbclient --server-url https://hb.example.com:8333 status
|
|
47
|
+
hbclient send --app my-service --task deploy --interval 60
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Features
|
|
51
|
+
|
|
52
|
+
- **AES-GCM encrypted UDP transport** with CRC32 integrity
|
|
53
|
+
- **OAuth Device Flow** for key management
|
|
54
|
+
- **Secure by default** with `strict_security=True`
|
|
55
|
+
- **Transparent DNS resolution** with configurable refresh intervals
|
|
56
|
+
- **Deterministic key rotation** with jitter to prevent thundering herd
|
|
57
|
+
- **Atomic file I/O** for crash-safe credential storage
|
|
58
|
+
- **Human-readable duration parsing** (e.g., `6h`, `2.5d`, `3w`)
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
Enrollment keys are stored under:
|
|
63
|
+
|
|
64
|
+
- Linux: `$XDG_CONFIG_HOME/hbclient/` or `~/.config/hbclient/`
|
|
65
|
+
- macOS: `~/Library/Application Support/hbclient/`
|
|
66
|
+
- Windows: `%APPDATA%/hbclient/`
|
|
67
|
+
|
|
68
|
+
## Security Mode (`strict_security`)
|
|
69
|
+
|
|
70
|
+
`HbClient` accepts `strict_security` (default: `True`). If enrollment is missing, construction raises `RuntimeError` with guidance to run:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
hbclient --server-url https://hb.example.com:8333 login
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## CLI Reference
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
hbclient [--server SERVER] [--serverport PORT] [--server-url URL] COMMAND
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Development
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install -e ".[dev]"
|
|
86
|
+
make test
|
|
87
|
+
make pre-release
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Releasing
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install -e ".[release]"
|
|
94
|
+
cz bump
|
|
95
|
+
make pre-release
|
|
96
|
+
python -m twine upload dist/hb_client-<version>*
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
Apache-2.0 — see [LICENSE](LICENSE)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "hb-client"
|
|
7
|
+
version = "0.5.3"
|
|
8
|
+
description = "Secure heartbeat client for the Nuclei monitoring ecosystem"
|
|
9
|
+
readme = {file = "README.md", content-type = "text/markdown"}
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "J. Will Pierce", email = "willp@users.noreply.github.com"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["heartbeat", "monitoring", "nuclei", "client", "heartbeat-monitoring"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
"Topic :: System :: Monitoring",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"cryptography>=41.0.0",
|
|
30
|
+
"filelock>=3.12.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = [
|
|
35
|
+
"build>=1.2.2",
|
|
36
|
+
"pytest>=8.3.0",
|
|
37
|
+
"ruff>=0.6.0",
|
|
38
|
+
"twine>=5.1.0",
|
|
39
|
+
]
|
|
40
|
+
typecheck = [
|
|
41
|
+
"mypy>=1.11.0",
|
|
42
|
+
]
|
|
43
|
+
release = [
|
|
44
|
+
"commitizen>=3.29.0",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[project.urls]
|
|
48
|
+
Homepage = "https://github.com/willp/heartbeat-client"
|
|
49
|
+
Repository = "https://github.com/willp/heartbeat-client"
|
|
50
|
+
Documentation = "https://github.com/willp/heartbeat-client/blob/main/README.md"
|
|
51
|
+
Issues = "https://github.com/willp/heartbeat-client/issues"
|
|
52
|
+
Changelog = "https://github.com/willp/heartbeat-client/blob/main/CHANGELOG.md"
|
|
53
|
+
|
|
54
|
+
[project.scripts]
|
|
55
|
+
hbclient = "hb_client.hbclient:main"
|
|
56
|
+
|
|
57
|
+
[tool.setuptools.packages.find]
|
|
58
|
+
where = ["src"]
|
|
59
|
+
include = ["hb_client*"]
|
|
60
|
+
|
|
61
|
+
[tool.pytest.ini_options]
|
|
62
|
+
minversion = "8.0"
|
|
63
|
+
testpaths = ["tests"]
|
|
64
|
+
addopts = "-ra"
|
|
65
|
+
|
|
66
|
+
[tool.ruff]
|
|
67
|
+
target-version = "py310"
|
|
68
|
+
line-length = 120
|
|
69
|
+
|
|
70
|
+
[tool.ruff.lint]
|
|
71
|
+
select = ["E", "F", "I"]
|
|
72
|
+
ignore = ["E501"]
|
|
73
|
+
|
|
74
|
+
[tool.mypy]
|
|
75
|
+
python_version = "3.10"
|
|
76
|
+
warn_return_any = true
|
|
77
|
+
warn_unused_configs = true
|
|
78
|
+
disallow_untyped_defs = false
|
|
79
|
+
check_untyped_defs = true
|
|
80
|
+
no_implicit_optional = true
|
|
81
|
+
strict_equality = true
|
|
82
|
+
pretty = true
|
|
83
|
+
|
|
84
|
+
[tool.commitizen]
|
|
85
|
+
name = "cz_conventional_commits"
|
|
86
|
+
tag_format = "$version"
|
|
87
|
+
version_scheme = "pep440"
|
|
88
|
+
version_provider = "pep621"
|
|
89
|
+
update_changelog_on_bump = true
|
|
90
|
+
major_version_zero = true
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
2
|
+
|
|
3
|
+
from .hbclient import (
|
|
4
|
+
CLI_NAME,
|
|
5
|
+
CONFIG_DIR_NAME,
|
|
6
|
+
HbClient,
|
|
7
|
+
HbConfig,
|
|
8
|
+
KeyManager,
|
|
9
|
+
cmd_login,
|
|
10
|
+
cmd_logout,
|
|
11
|
+
cmd_status,
|
|
12
|
+
parse_time_duration,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
try:
|
|
16
|
+
__version__ = version(__name__)
|
|
17
|
+
except PackageNotFoundError:
|
|
18
|
+
__version__ = "unknown"
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"CLI_NAME",
|
|
22
|
+
"CONFIG_DIR_NAME",
|
|
23
|
+
"HbClient",
|
|
24
|
+
"HbConfig",
|
|
25
|
+
"KeyManager",
|
|
26
|
+
"cmd_login",
|
|
27
|
+
"cmd_status",
|
|
28
|
+
"cmd_logout",
|
|
29
|
+
"parse_time_duration",
|
|
30
|
+
"__version__",
|
|
31
|
+
]
|