snipeit-eosl 1.0.0__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.
- snipeit_eosl/__init__.py +0 -0
- snipeit_eosl/cli.py +91 -0
- snipeit_eosl/eosl.py +83 -0
- snipeit_eosl/matching.py +140 -0
- snipeit_eosl/report.py +160 -0
- snipeit_eosl/snipeit.py +130 -0
- snipeit_eosl-1.0.0.dist-info/METADATA +130 -0
- snipeit_eosl-1.0.0.dist-info/RECORD +12 -0
- snipeit_eosl-1.0.0.dist-info/WHEEL +5 -0
- snipeit_eosl-1.0.0.dist-info/entry_points.txt +2 -0
- snipeit_eosl-1.0.0.dist-info/licenses/LICENSE +201 -0
- snipeit_eosl-1.0.0.dist-info/top_level.txt +1 -0
snipeit_eosl/__init__.py
ADDED
|
File without changes
|
snipeit_eosl/cli.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"""snipeit-eosl — audit a Snipe-IT inventory against the EOSL.ai lifecycle database.
|
|
2
|
+
|
|
3
|
+
Read-only. Exit codes: 0 nothing past EOSL, 1 something past EOSL (so it is usable in CI),
|
|
4
|
+
2 an error occurred. The distinction matters: "the check failed to run" must never look like
|
|
5
|
+
"the check passed".
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import argparse
|
|
9
|
+
import csv
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
import sys
|
|
13
|
+
|
|
14
|
+
from . import eosl, report
|
|
15
|
+
from .snipeit import SnipeIt, SnipeItError
|
|
16
|
+
|
|
17
|
+
__version__ = "1.0.0"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def build_parser():
|
|
21
|
+
p = argparse.ArgumentParser(
|
|
22
|
+
prog="snipeit-eosl",
|
|
23
|
+
description="Audit a Snipe-IT inventory against the EOSL.ai hardware lifecycle database.",
|
|
24
|
+
epilog="Credentials may also come from SNIPEIT_URL and SNIPEIT_TOKEN.",
|
|
25
|
+
)
|
|
26
|
+
p.add_argument("--url", default=os.environ.get("SNIPEIT_URL"),
|
|
27
|
+
help="Snipe-IT base URL, e.g. https://snipe.example.com")
|
|
28
|
+
p.add_argument("--token", default=os.environ.get("SNIPEIT_TOKEN"),
|
|
29
|
+
help="Snipe-IT API token (prefer the SNIPEIT_TOKEN env var)")
|
|
30
|
+
p.add_argument("--format", choices=("text", "json", "csv"), default="text")
|
|
31
|
+
p.add_argument("--all", action="store_true",
|
|
32
|
+
help="include current and untracked models in the output")
|
|
33
|
+
p.add_argument("--output", "-o", help="write to a file instead of stdout")
|
|
34
|
+
p.add_argument("--timeout", type=int, default=30)
|
|
35
|
+
p.add_argument("--api-url", default=eosl.DEFAULT_API_URL,
|
|
36
|
+
help="override the EOSL.ai lookup URL (for a mirror or an air-gapped copy)")
|
|
37
|
+
p.add_argument("--insecure", action="store_true",
|
|
38
|
+
help="skip TLS verification for Snipe-IT (self-signed internal certs only)")
|
|
39
|
+
p.add_argument("--fail-on", choices=("never", "unsupported"), default="unsupported",
|
|
40
|
+
help="exit 1 when models past end of service life are found (default) or never")
|
|
41
|
+
p.add_argument("--version", action="version", version="%(prog)s " + __version__)
|
|
42
|
+
return p
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def main(argv=None):
|
|
46
|
+
args = build_parser().parse_args(argv)
|
|
47
|
+
if not args.url or not args.token:
|
|
48
|
+
print("error: --url and --token are required (or set SNIPEIT_URL / SNIPEIT_TOKEN)",
|
|
49
|
+
file=sys.stderr)
|
|
50
|
+
return 2
|
|
51
|
+
|
|
52
|
+
try:
|
|
53
|
+
client = SnipeIt(args.url, args.token, timeout=args.timeout, insecure=args.insecure)
|
|
54
|
+
models = client.models()
|
|
55
|
+
skus = eosl.fetch_lookup(api_url=args.api_url, timeout=args.timeout)
|
|
56
|
+
except (SnipeItError, eosl.EoslError) as e:
|
|
57
|
+
# Exit 2, never 0. An audit that could not run has not found "no problems".
|
|
58
|
+
print("error: %s" % e, file=sys.stderr)
|
|
59
|
+
return 2
|
|
60
|
+
|
|
61
|
+
if not models:
|
|
62
|
+
print("error: Snipe-IT returned no models — nothing to audit. This is reported as an error "
|
|
63
|
+
"rather than a clean result on purpose.", file=sys.stderr)
|
|
64
|
+
return 2
|
|
65
|
+
|
|
66
|
+
rep = report.build(models, skus)
|
|
67
|
+
|
|
68
|
+
if args.format == "json":
|
|
69
|
+
text = json.dumps(rep, indent=2, sort_keys=True)
|
|
70
|
+
elif args.format == "csv":
|
|
71
|
+
import io
|
|
72
|
+
buf = io.StringIO()
|
|
73
|
+
csv.writer(buf, lineterminator="\n").writerows(report.to_csv_rows(rep))
|
|
74
|
+
text = buf.getvalue()
|
|
75
|
+
else:
|
|
76
|
+
text = report.to_text(rep, show_all=args.all)
|
|
77
|
+
|
|
78
|
+
if args.output:
|
|
79
|
+
with open(args.output, "w", encoding="utf-8", newline="") as fh:
|
|
80
|
+
fh.write(text if text.endswith("\n") else text + "\n")
|
|
81
|
+
print("wrote %s" % args.output, file=sys.stderr)
|
|
82
|
+
else:
|
|
83
|
+
print(text)
|
|
84
|
+
|
|
85
|
+
if args.fail_on == "unsupported" and rep["summary"]["unsupported"]["models"]:
|
|
86
|
+
return 1
|
|
87
|
+
return 0
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
if __name__ == "__main__":
|
|
91
|
+
sys.exit(main())
|
snipeit_eosl/eosl.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"""HTTP client for the EOSL.ai lifecycle dataset. Stdlib only — no third-party dependencies.
|
|
2
|
+
|
|
3
|
+
ONE FETCH, NOT N. https://eosl.ai/data/lookup.json carries every tracked part number in a single
|
|
4
|
+
document (~93 KB gzipped), so auditing an inventory of any size is one round trip.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import gzip
|
|
8
|
+
import io
|
|
9
|
+
import json
|
|
10
|
+
import urllib.error
|
|
11
|
+
import urllib.request
|
|
12
|
+
|
|
13
|
+
from . import matching
|
|
14
|
+
|
|
15
|
+
DEFAULT_API_URL = "https://eosl.ai/data/lookup.json"
|
|
16
|
+
USER_AGENT = "snipeit-eosl (+https://eosl.ai/)"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class EoslError(Exception):
|
|
20
|
+
"""Raised for any failure to obtain or parse the lifecycle data."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def fetch_lookup(api_url=DEFAULT_API_URL, timeout=30):
|
|
24
|
+
"""Fetch and parse the lifecycle lookup document. Returns the list of sku records."""
|
|
25
|
+
req = urllib.request.Request(
|
|
26
|
+
api_url,
|
|
27
|
+
headers={
|
|
28
|
+
"Accept": "application/json",
|
|
29
|
+
"User-Agent": USER_AGENT,
|
|
30
|
+
"Accept-Encoding": "gzip",
|
|
31
|
+
},
|
|
32
|
+
)
|
|
33
|
+
try:
|
|
34
|
+
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
|
35
|
+
raw = resp.read()
|
|
36
|
+
except urllib.error.HTTPError as e:
|
|
37
|
+
raise EoslError("HTTP %s fetching %s" % (e.code, api_url)) from e
|
|
38
|
+
except urllib.error.URLError as e:
|
|
39
|
+
raise EoslError("could not reach %s: %s" % (api_url, e.reason)) from e
|
|
40
|
+
except Exception as e: # noqa: BLE001 - surface the cause, never proceed on partial data
|
|
41
|
+
raise EoslError("failed fetching %s: %s" % (api_url, e)) from e
|
|
42
|
+
|
|
43
|
+
# SNIFF THE BYTES, DO NOT TRUST Content-Encoding. Some clients decompress transparently but leave
|
|
44
|
+
# the header on, so branching on the header gunzips already-plain JSON. The magic number
|
|
45
|
+
# describes what the bytes ARE, which is the only thing that matters. (This exact bug shipped in
|
|
46
|
+
# ansible-eosl and was caught only in CI.)
|
|
47
|
+
if raw[:2] == b"\x1f\x8b":
|
|
48
|
+
raw = gzip.GzipFile(fileobj=io.BytesIO(raw)).read()
|
|
49
|
+
|
|
50
|
+
try:
|
|
51
|
+
data = json.loads(raw.decode("utf-8"))
|
|
52
|
+
except (ValueError, UnicodeDecodeError) as e:
|
|
53
|
+
raise EoslError("response from %s was not valid JSON: %s" % (api_url, e)) from e
|
|
54
|
+
|
|
55
|
+
skus = data.get("skus") if isinstance(data, dict) else None
|
|
56
|
+
if not isinstance(skus, list) or not skus:
|
|
57
|
+
# A 200 with an empty or truncated body is the exact failure that silently deleted 124
|
|
58
|
+
# families from this database in July 2026. Treat it as an error, NEVER as "no results" —
|
|
59
|
+
# otherwise every model in the inventory reports as untracked and the run looks clean.
|
|
60
|
+
raise EoslError(
|
|
61
|
+
"response from %s carried no part numbers — refusing to report an empty payload "
|
|
62
|
+
"as 'nothing tracked'" % api_url
|
|
63
|
+
)
|
|
64
|
+
return skus
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def resolve_many(parts, vendor_of=None, api_url=DEFAULT_API_URL, timeout=30, skus=None):
|
|
68
|
+
"""Resolve an iterable of part numbers to normalised records.
|
|
69
|
+
|
|
70
|
+
`vendor_of` is an optional callable part -> vendor name, used only to gate vendor-specific SKU
|
|
71
|
+
aliases. Returns {part_as_supplied: record_or_None}.
|
|
72
|
+
"""
|
|
73
|
+
if skus is None:
|
|
74
|
+
skus = fetch_lookup(api_url=api_url, timeout=timeout)
|
|
75
|
+
exact, loose_index = matching.build_index(skus)
|
|
76
|
+
out = {}
|
|
77
|
+
for p in parts:
|
|
78
|
+
if p is None or str(p).strip() == "":
|
|
79
|
+
continue
|
|
80
|
+
key = str(p)
|
|
81
|
+
vendor = vendor_of(key) if vendor_of else None
|
|
82
|
+
out[key] = matching.normalise(matching.match(key, vendor, exact, loose_index))
|
|
83
|
+
return out
|
snipeit_eosl/matching.py
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""Pure part-number matching and record shaping — no Snipe-IT or network imports.
|
|
2
|
+
|
|
3
|
+
THIS IS A DELIBERATE PORT of netbox-eosl/netbox_eosl/matching.py and
|
|
4
|
+
ansible-eosl/plugins/module_utils/eosl_match.py. Three integrations resolving the same part number
|
|
5
|
+
differently would be one fact with three definitions — the failure mode that produced the 844-vs-845
|
|
6
|
+
homepage bug. If you change matching here, change it in both of the others.
|
|
7
|
+
|
|
8
|
+
That instruction has been given twice before and is only as good as the person reading it, so it is
|
|
9
|
+
now ENFORCED: `pipeline/matcher-parity-check.py` runs one battery of inputs through all three copies
|
|
10
|
+
and fails CI if any of them disagrees. Do not delete that check to make a change land.
|
|
11
|
+
|
|
12
|
+
Matching is deterministic and conservative: exact, then a punctuation/case-insensitive "loose" match,
|
|
13
|
+
then a *vendor-gated* SKU-abbreviation expansion. Never fuzzy, never substring — 'WS-C3850' must not
|
|
14
|
+
resolve to 'WS-C3850-24T-L', and an unknown part returns None rather than a near neighbour. A wrong
|
|
15
|
+
end-of-life date on the wrong device would defeat the point of a source-backed tool.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import datetime
|
|
19
|
+
import re
|
|
20
|
+
|
|
21
|
+
# Official Fortinet SKU-abbreviation -> product-line prefixes. EOSL.ai stores the long form
|
|
22
|
+
# ("FortiGate-60E"); inventories commonly carry the short SKU form ("FG-60E").
|
|
23
|
+
FORTINET_PREFIX = {
|
|
24
|
+
"FG": "FORTIGATE",
|
|
25
|
+
"FS": "FORTISWITCH",
|
|
26
|
+
"FAP": "FORTIAP",
|
|
27
|
+
"FAZ": "FORTIANALYZER",
|
|
28
|
+
"FMG": "FORTIMANAGER",
|
|
29
|
+
"FWB": "FORTIWEB",
|
|
30
|
+
"FAD": "FORTIADC",
|
|
31
|
+
"FML": "FORTIMAIL",
|
|
32
|
+
"FPX": "FORTIPROXY",
|
|
33
|
+
"FEX": "FORTIEXTENDER",
|
|
34
|
+
"FAC": "FORTIAUTHENTICATOR",
|
|
35
|
+
"FDD": "FORTIDDOS",
|
|
36
|
+
"FSA": "FORTISANDBOX",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
BASE_URL = "https://eosl.ai"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def loose(s):
|
|
43
|
+
"""Uppercase, strip every non-alphanumeric char. 'FortiGate-60E' -> 'FORTIGATE60E'."""
|
|
44
|
+
return re.sub(r"[^A-Z0-9]", "", (s or "").upper())
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def build_index(skus):
|
|
48
|
+
"""Return (exact, loose_index): UPPER(pid)->rec and loose(pid)->rec. First writer wins."""
|
|
49
|
+
exact, loose_index = {}, {}
|
|
50
|
+
for rec in skus:
|
|
51
|
+
pid = (rec.get("p") or "").strip().upper()
|
|
52
|
+
if not pid:
|
|
53
|
+
continue
|
|
54
|
+
exact.setdefault(pid, rec)
|
|
55
|
+
loose_index.setdefault(loose(pid), rec)
|
|
56
|
+
return exact, loose_index
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _is_fortinet(vendor):
|
|
60
|
+
return bool(vendor) and "FORTINET" in vendor.upper()
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def candidate_loose_keys(part, vendor=None):
|
|
64
|
+
"""Loose keys to try, most-specific first. Vendor-gated aliases only; deterministic, never fuzzy."""
|
|
65
|
+
keys, seen = [], set()
|
|
66
|
+
|
|
67
|
+
def add(raw):
|
|
68
|
+
k = loose(raw)
|
|
69
|
+
if k and k not in seen:
|
|
70
|
+
seen.add(k)
|
|
71
|
+
keys.append(k)
|
|
72
|
+
|
|
73
|
+
add(part)
|
|
74
|
+
if _is_fortinet(vendor):
|
|
75
|
+
lp = loose(part)
|
|
76
|
+
for ab, full in FORTINET_PREFIX.items():
|
|
77
|
+
if lp.startswith(ab) and len(lp) > len(ab) and not lp.startswith(full):
|
|
78
|
+
add(full + lp[len(ab):])
|
|
79
|
+
return keys
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def match(part, vendor, exact, loose_index):
|
|
83
|
+
"""Resolve a part number to a record, or None. Exact -> loose -> vendor-gated alias."""
|
|
84
|
+
if not part:
|
|
85
|
+
return None
|
|
86
|
+
u = part.strip().upper()
|
|
87
|
+
if u in exact:
|
|
88
|
+
return exact[u]
|
|
89
|
+
for k in candidate_loose_keys(part, vendor):
|
|
90
|
+
rec = loose_index.get(k)
|
|
91
|
+
if rec:
|
|
92
|
+
return rec
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def normalise(rec):
|
|
97
|
+
"""Expand a compact lookup record into documented, stable field names.
|
|
98
|
+
|
|
99
|
+
The wire format is abbreviated to keep the single-fetch payload small; users should never have to
|
|
100
|
+
know that 'xb' means the support-runway band.
|
|
101
|
+
"""
|
|
102
|
+
if rec is None:
|
|
103
|
+
return None
|
|
104
|
+
slug = rec.get("s")
|
|
105
|
+
out = {
|
|
106
|
+
"part_number": rec.get("p"),
|
|
107
|
+
"family": rec.get("f"),
|
|
108
|
+
"vendor": rec.get("v"),
|
|
109
|
+
"slug": slug,
|
|
110
|
+
"end_of_sale": rec.get("eos") or None,
|
|
111
|
+
"end_of_service_life": rec.get("eol") or None,
|
|
112
|
+
"active": bool(rec.get("a")),
|
|
113
|
+
"support_runway_score": rec.get("xs"),
|
|
114
|
+
"support_runway_band": rec.get("xb"),
|
|
115
|
+
"source_url": rec.get("src") or None,
|
|
116
|
+
"cisa_bod_26_02_scope": bool(rec.get("bd")),
|
|
117
|
+
"url": "%s/system/%s/" % (BASE_URL, slug) if slug else None,
|
|
118
|
+
}
|
|
119
|
+
out["status"] = status_of(out)
|
|
120
|
+
return out
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def status_of(item, today=None):
|
|
124
|
+
"""'active' | 'unsupported' | 'supported' | 'unknown' — from the dates alone, never guessed.
|
|
125
|
+
|
|
126
|
+
'active' means the manufacturer has announced no end of life. 'unknown' means this database holds
|
|
127
|
+
no end-of-service-life date for the part, which is NOT the same as "still supported" and must
|
|
128
|
+
never be rendered as though it were.
|
|
129
|
+
"""
|
|
130
|
+
if item is None:
|
|
131
|
+
return "unknown"
|
|
132
|
+
if item.get("active"):
|
|
133
|
+
return "active"
|
|
134
|
+
eol = item.get("end_of_service_life")
|
|
135
|
+
if not eol:
|
|
136
|
+
return "unknown"
|
|
137
|
+
today = today or datetime.date.today()
|
|
138
|
+
# Dates are 'YYYY-MM' precision in the lookup payload; compare on that precision only rather
|
|
139
|
+
# than inventing a day-of-month.
|
|
140
|
+
return "unsupported" if eol <= today.strftime("%Y-%m") else "supported"
|
snipeit_eosl/report.py
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"""Turn Snipe-IT models + EOSL.ai records into an audit report. Pure — no network, no I/O."""
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
|
|
5
|
+
from . import matching
|
|
6
|
+
|
|
7
|
+
# Order matters: this is the order rows are presented and the order a human should act in.
|
|
8
|
+
BUCKETS = ["unsupported", "supported", "active", "unknown"]
|
|
9
|
+
|
|
10
|
+
BUCKET_LABEL = {
|
|
11
|
+
"unsupported": "Past end of service life",
|
|
12
|
+
"supported": "Tracked, still supported",
|
|
13
|
+
# ASCII ONLY in anything printed: this is a CLI, and a Windows cp1252 console renders an
|
|
14
|
+
# em-dash as a replacement character. Guarded by test_text_output_is_ascii.
|
|
15
|
+
"active": "Current - no EOL announced",
|
|
16
|
+
"unknown": "Not tracked by EOSL.ai",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def plural(n, word):
|
|
21
|
+
"""'1 unit' / '2 units'. Trivial, but wrong grammar in a report reads as a careless tool."""
|
|
22
|
+
return word if n == 1 else word + "s"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _candidates(model):
|
|
26
|
+
"""Part-number candidates for a Snipe-IT model, most authoritative first.
|
|
27
|
+
|
|
28
|
+
`model_number` is the field Snipe-IT intends for this. `name` is tried second because a great
|
|
29
|
+
many real Snipe-IT installs leave model_number blank and put "WS-C3850-24T-L" in the name — but
|
|
30
|
+
it is a fallback, and which one matched is reported so the result stays auditable.
|
|
31
|
+
"""
|
|
32
|
+
out = []
|
|
33
|
+
for field in ("model_number", "name"):
|
|
34
|
+
v = (model.get(field) or "").strip()
|
|
35
|
+
if v:
|
|
36
|
+
out.append((field, v))
|
|
37
|
+
return out
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def build(models, skus, today=None):
|
|
41
|
+
"""Return {'rows': [...], 'summary': {...}}.
|
|
42
|
+
|
|
43
|
+
One row per Snipe-IT model. `matched_on` records which field resolved, and `status` is computed
|
|
44
|
+
by the shared matcher — never recomputed here.
|
|
45
|
+
"""
|
|
46
|
+
today = today or datetime.date.today()
|
|
47
|
+
exact, loose_index = matching.build_index(skus)
|
|
48
|
+
rows = []
|
|
49
|
+
|
|
50
|
+
for m in models:
|
|
51
|
+
rec, matched_on, tried = None, None, []
|
|
52
|
+
for field, value in _candidates(m):
|
|
53
|
+
tried.append(value)
|
|
54
|
+
hit = matching.match(value, m.get("manufacturer"), exact, loose_index)
|
|
55
|
+
if hit is not None:
|
|
56
|
+
rec, matched_on = matching.normalise(hit), field
|
|
57
|
+
break
|
|
58
|
+
|
|
59
|
+
status = matching.status_of(rec, today=today) if rec else "unknown"
|
|
60
|
+
rows.append(
|
|
61
|
+
{
|
|
62
|
+
"snipeit_model_id": m.get("id"),
|
|
63
|
+
"snipeit_model": m.get("name"),
|
|
64
|
+
"manufacturer": m.get("manufacturer"),
|
|
65
|
+
"category": m.get("category"),
|
|
66
|
+
"assets": m.get("assets_count") or 0,
|
|
67
|
+
"matched_on": matched_on,
|
|
68
|
+
"queried": tried,
|
|
69
|
+
"status": status,
|
|
70
|
+
"part_number": rec["part_number"] if rec else None,
|
|
71
|
+
"end_of_sale": rec["end_of_sale"] if rec else None,
|
|
72
|
+
"end_of_service_life": rec["end_of_service_life"] if rec else None,
|
|
73
|
+
"support_runway_band": rec["support_runway_band"] if rec else None,
|
|
74
|
+
"source_url": rec["source_url"] if rec else None,
|
|
75
|
+
"url": rec["url"] if rec else None,
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Sort: worst first, then by unit count — the biggest exposure at the top of the page.
|
|
80
|
+
rows.sort(key=lambda r: (BUCKETS.index(r["status"]), -(r["assets"] or 0), r["snipeit_model"] or ""))
|
|
81
|
+
|
|
82
|
+
summary = {b: {"models": 0, "assets": 0} for b in BUCKETS}
|
|
83
|
+
for r in rows:
|
|
84
|
+
s = summary[r["status"]]
|
|
85
|
+
s["models"] += 1
|
|
86
|
+
s["assets"] += r["assets"] or 0
|
|
87
|
+
summary["total_models"] = len(rows)
|
|
88
|
+
summary["total_assets"] = sum(r["assets"] or 0 for r in rows)
|
|
89
|
+
return {"rows": rows, "summary": summary}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def to_text(report, show_all=False):
|
|
93
|
+
"""Human-readable report. Returns a string."""
|
|
94
|
+
rows, summary = report["rows"], report["summary"]
|
|
95
|
+
out = []
|
|
96
|
+
out.append("EOSL.ai audit of Snipe-IT inventory")
|
|
97
|
+
out.append("=" * 62)
|
|
98
|
+
for b in BUCKETS:
|
|
99
|
+
s = summary[b]
|
|
100
|
+
if s["models"]:
|
|
101
|
+
out.append(" %-30s %4d %-6s %5d %s" % (BUCKET_LABEL[b], s["models"], plural(s["models"], "model"), s["assets"], plural(s["assets"], "unit")))
|
|
102
|
+
out.append(" %-30s %4d %-6s %5d %s" % ("TOTAL", summary["total_models"], plural(summary["total_models"], "model"), summary["total_assets"], plural(summary["total_assets"], "unit")))
|
|
103
|
+
out.append("")
|
|
104
|
+
|
|
105
|
+
shown = rows if show_all else [r for r in rows if r["status"] in ("unsupported", "supported")]
|
|
106
|
+
if not shown:
|
|
107
|
+
out.append("Nothing tracked matched this inventory.")
|
|
108
|
+
# Never let "we matched nothing" read as "you are fine".
|
|
109
|
+
if summary["unknown"]["models"]:
|
|
110
|
+
out.append(
|
|
111
|
+
"NOTE: %d models are not tracked by EOSL.ai. That is not the same as supported - "
|
|
112
|
+
"it means this database holds no date for them." % summary["unknown"]["models"]
|
|
113
|
+
)
|
|
114
|
+
return "\n".join(out)
|
|
115
|
+
|
|
116
|
+
for b in BUCKETS:
|
|
117
|
+
sub = [r for r in shown if r["status"] == b]
|
|
118
|
+
if not sub:
|
|
119
|
+
continue
|
|
120
|
+
out.append("%s (%d)" % (BUCKET_LABEL[b].upper(), len(sub)))
|
|
121
|
+
out.append("-" * 62)
|
|
122
|
+
for r in sub:
|
|
123
|
+
out.append(
|
|
124
|
+
" %-28s %4d unit%s EOS %-8s EOSL %-8s"
|
|
125
|
+
% (
|
|
126
|
+
(r["snipeit_model"] or "")[:28],
|
|
127
|
+
r["assets"],
|
|
128
|
+
" " if r["assets"] == 1 else "s",
|
|
129
|
+
r["end_of_sale"] or "-",
|
|
130
|
+
r["end_of_service_life"] or "-",
|
|
131
|
+
)
|
|
132
|
+
)
|
|
133
|
+
if r["source_url"]:
|
|
134
|
+
out.append(" source: %s" % r["source_url"])
|
|
135
|
+
out.append("")
|
|
136
|
+
|
|
137
|
+
if not show_all and summary["unknown"]["models"]:
|
|
138
|
+
out.append(
|
|
139
|
+
"%d model(s) are not tracked by EOSL.ai - not the same as supported. Use --all to list them."
|
|
140
|
+
% summary["unknown"]["models"]
|
|
141
|
+
)
|
|
142
|
+
return "\n".join(out)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def to_csv_rows(report):
|
|
146
|
+
"""Return [header, *rows] as lists of strings, for csv.writer."""
|
|
147
|
+
header = [
|
|
148
|
+
"snipeit_model", "manufacturer", "category", "assets", "status",
|
|
149
|
+
"part_number", "matched_on", "end_of_sale", "end_of_service_life",
|
|
150
|
+
"support_runway_band", "source_url", "eosl_ai_url",
|
|
151
|
+
]
|
|
152
|
+
out = [header]
|
|
153
|
+
for r in report["rows"]:
|
|
154
|
+
out.append([
|
|
155
|
+
r["snipeit_model"] or "", r["manufacturer"] or "", r["category"] or "",
|
|
156
|
+
str(r["assets"]), r["status"], r["part_number"] or "", r["matched_on"] or "",
|
|
157
|
+
r["end_of_sale"] or "", r["end_of_service_life"] or "",
|
|
158
|
+
r["support_runway_band"] or "", r["source_url"] or "", r["url"] or "",
|
|
159
|
+
])
|
|
160
|
+
return out
|
snipeit_eosl/snipeit.py
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"""Read-only Snipe-IT API client. Stdlib only.
|
|
2
|
+
|
|
3
|
+
WHY MODELS AND NOT ASSETS. Snipe-IT stores the part number on the *model* (`model_number`), and every
|
|
4
|
+
asset points at one. A 4,000-device estate is typically 40-200 models, so walking `/api/v1/models`
|
|
5
|
+
answers "what do I own that is end-of-life" in a handful of requests instead of paging thousands of
|
|
6
|
+
assets to read the same field over and over. `assets_count` on each model gives the unit counts for
|
|
7
|
+
free. If you need per-asset detail, `--assets` widens the walk deliberately.
|
|
8
|
+
|
|
9
|
+
THIS CLIENT NEVER WRITES. Snipe-IT is a system of record and a tool that silently edits one is a tool
|
|
10
|
+
nobody should run against production. Write-back to a custom field was considered and deliberately
|
|
11
|
+
left out — see README, "What this does not do".
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import json
|
|
15
|
+
import urllib.error
|
|
16
|
+
import urllib.parse
|
|
17
|
+
import urllib.request
|
|
18
|
+
|
|
19
|
+
USER_AGENT = "snipeit-eosl (+https://eosl.ai/)"
|
|
20
|
+
PAGE = 100
|
|
21
|
+
# A real Snipe-IT can hold a lot of models; this is a runaway-loop backstop, not a coverage limit.
|
|
22
|
+
MAX_PAGES = 500
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SnipeItError(Exception):
|
|
26
|
+
"""Raised for any failure to obtain or parse data from Snipe-IT."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class SnipeIt:
|
|
30
|
+
def __init__(self, base_url, token, timeout=30, insecure=False):
|
|
31
|
+
if not base_url:
|
|
32
|
+
raise SnipeItError("a Snipe-IT base URL is required")
|
|
33
|
+
if not token:
|
|
34
|
+
raise SnipeItError("a Snipe-IT API token is required")
|
|
35
|
+
self.base = base_url.rstrip("/")
|
|
36
|
+
self.token = token
|
|
37
|
+
self.timeout = timeout
|
|
38
|
+
self.insecure = insecure
|
|
39
|
+
|
|
40
|
+
def _get(self, path, params=None):
|
|
41
|
+
url = "%s/api/v1/%s" % (self.base, path.lstrip("/"))
|
|
42
|
+
if params:
|
|
43
|
+
url += "?" + urllib.parse.urlencode(params)
|
|
44
|
+
req = urllib.request.Request(
|
|
45
|
+
url,
|
|
46
|
+
headers={
|
|
47
|
+
"Authorization": "Bearer %s" % self.token,
|
|
48
|
+
"Accept": "application/json",
|
|
49
|
+
"User-Agent": USER_AGENT,
|
|
50
|
+
},
|
|
51
|
+
)
|
|
52
|
+
ctx = None
|
|
53
|
+
if self.insecure:
|
|
54
|
+
import ssl
|
|
55
|
+
|
|
56
|
+
ctx = ssl._create_unverified_context()
|
|
57
|
+
try:
|
|
58
|
+
with urllib.request.urlopen(req, timeout=self.timeout, context=ctx) as resp:
|
|
59
|
+
raw = resp.read()
|
|
60
|
+
except urllib.error.HTTPError as e:
|
|
61
|
+
hint = ""
|
|
62
|
+
if e.code in (401, 403):
|
|
63
|
+
hint = " — check the API token and that it has read access"
|
|
64
|
+
raise SnipeItError("HTTP %s from %s%s" % (e.code, url, hint)) from e
|
|
65
|
+
except urllib.error.URLError as e:
|
|
66
|
+
raise SnipeItError("could not reach %s: %s" % (url, e.reason)) from e
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
data = json.loads(raw.decode("utf-8"))
|
|
70
|
+
except (ValueError, UnicodeDecodeError) as e:
|
|
71
|
+
raise SnipeItError("response from %s was not valid JSON: %s" % (url, e)) from e
|
|
72
|
+
|
|
73
|
+
# Snipe-IT answers some auth and validation failures with HTTP 200 and a body of
|
|
74
|
+
# {"status":"error","messages":...}. Treating that as an empty result set is how a broken
|
|
75
|
+
# token turns into a clean-looking "no models found" report.
|
|
76
|
+
if isinstance(data, dict) and data.get("status") == "error":
|
|
77
|
+
raise SnipeItError("Snipe-IT returned an error for %s: %s" % (url, data.get("messages")))
|
|
78
|
+
return data
|
|
79
|
+
|
|
80
|
+
def _paged(self, path, params=None):
|
|
81
|
+
"""Walk a paginated Snipe-IT collection, yielding rows."""
|
|
82
|
+
offset, seen, total = 0, 0, None
|
|
83
|
+
for _ in range(MAX_PAGES):
|
|
84
|
+
p = dict(params or {})
|
|
85
|
+
p.update({"limit": PAGE, "offset": offset})
|
|
86
|
+
data = self._get(path, p)
|
|
87
|
+
rows = data.get("rows")
|
|
88
|
+
if rows is None:
|
|
89
|
+
raise SnipeItError("unexpected response shape from %s: no 'rows'" % path)
|
|
90
|
+
if total is None:
|
|
91
|
+
total = data.get("total")
|
|
92
|
+
for r in rows:
|
|
93
|
+
yield r
|
|
94
|
+
seen += len(rows)
|
|
95
|
+
if not rows or (total is not None and seen >= total):
|
|
96
|
+
break
|
|
97
|
+
# ADVANCE BY WHAT WAS RETURNED, NOT BY PAGE. Snipe-IT clamps `limit` server-side to its
|
|
98
|
+
# `max_results` setting (config/app.php, default 500 but admin-configurable via
|
|
99
|
+
# MAX_RESULTS). On an instance capped below PAGE, `offset += PAGE` would step straight
|
|
100
|
+
# over the rows the server withheld. Found by reading AssetModelsController rather than
|
|
101
|
+
# by testing, because the mock in the test suite answered with whatever it was told to.
|
|
102
|
+
offset += len(rows)
|
|
103
|
+
else:
|
|
104
|
+
raise SnipeItError("pagination did not terminate after %d pages of %s" % (MAX_PAGES, path))
|
|
105
|
+
|
|
106
|
+
# A truncated walk that reports success is the IBM failure in a different costume: every
|
|
107
|
+
# model we never saw would silently read as "not in your inventory".
|
|
108
|
+
if total is not None and seen < total:
|
|
109
|
+
raise SnipeItError(
|
|
110
|
+
"only retrieved %d of %d rows from %s — refusing to report a partial inventory"
|
|
111
|
+
% (seen, total, path)
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
def models(self):
|
|
115
|
+
"""Return [{id, name, model_number, manufacturer, category, assets_count}]."""
|
|
116
|
+
out = []
|
|
117
|
+
for r in self._paged("models"):
|
|
118
|
+
man = r.get("manufacturer") or {}
|
|
119
|
+
cat = r.get("category") or {}
|
|
120
|
+
out.append(
|
|
121
|
+
{
|
|
122
|
+
"id": r.get("id"),
|
|
123
|
+
"name": (r.get("name") or "").strip(),
|
|
124
|
+
"model_number": (r.get("model_number") or "").strip(),
|
|
125
|
+
"manufacturer": (man.get("name") or "").strip() if isinstance(man, dict) else "",
|
|
126
|
+
"category": (cat.get("name") or "").strip() if isinstance(cat, dict) else "",
|
|
127
|
+
"assets_count": r.get("assets_count") or 0,
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
return out
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: snipeit-eosl
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Audit a Snipe-IT inventory against the EOSL.ai hardware end-of-service-life database.
|
|
5
|
+
Author-email: "EOSL.ai" <hello@eosl.ai>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://eosl.ai
|
|
8
|
+
Project-URL: Source, https://github.com/EOSL-AI/snipeit-eosl
|
|
9
|
+
Project-URL: Issues, https://github.com/EOSL-AI/snipeit-eosl/issues
|
|
10
|
+
Project-URL: Dataset, https://eosl.ai/dataset/
|
|
11
|
+
Keywords: snipe-it,snipeit,itam,asset-management,eol,eosl,end-of-life,lifecycle
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Topic :: System :: Systems Administration
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# snipeit-eosl
|
|
24
|
+
|
|
25
|
+
Audit a [Snipe-IT](https://snipeitapp.com/) inventory against the
|
|
26
|
+
[EOSL.ai](https://eosl.ai) hardware end-of-service-life database.
|
|
27
|
+
|
|
28
|
+
Snipe-IT knows what hardware you own. It does not know when the manufacturer stops supporting it.
|
|
29
|
+
This tells you, and links the manufacturer's own bulletin for every date so you can check it.
|
|
30
|
+
|
|
31
|
+
**Read-only. Zero dependencies. One HTTP request to EOSL.ai regardless of inventory size.**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
$ snipeit-eosl --url https://snipe.example.com
|
|
35
|
+
|
|
36
|
+
EOSL.ai audit of Snipe-IT inventory
|
|
37
|
+
==============================================================
|
|
38
|
+
Past end of service life 3 models 129 units
|
|
39
|
+
Tracked, still supported 2 models 18 units
|
|
40
|
+
Not tracked by EOSL.ai 3 models 13 units
|
|
41
|
+
TOTAL 8 models 160 units
|
|
42
|
+
|
|
43
|
+
PAST END OF SERVICE LIFE (3)
|
|
44
|
+
--------------------------------------------------------------
|
|
45
|
+
Catalyst 3850 24-port 40 units EOS 2020-10 EOSL 2025-10
|
|
46
|
+
source: https://www.cisco.com/c/en/us/products/collateral/...
|
|
47
|
+
MR33-HW 85 units EOS 2021-05 EOSL 2026-07
|
|
48
|
+
source: https://documentation.meraki.com/...
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Install
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install snipeit-eosl
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Use
|
|
58
|
+
|
|
59
|
+
Generate an API token in Snipe-IT under **Account → API Keys**. A read-only user is enough.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
export SNIPEIT_URL=https://snipe.example.com
|
|
63
|
+
export SNIPEIT_TOKEN=eyJ0eXAi...
|
|
64
|
+
|
|
65
|
+
snipeit-eosl # human-readable summary
|
|
66
|
+
snipeit-eosl --all # include current and untracked models
|
|
67
|
+
snipeit-eosl --format csv -o eol-audit.csv
|
|
68
|
+
snipeit-eosl --format json | jq '.rows[] | select(.status=="unsupported")'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Exit codes:** `0` nothing past end of service life · `1` something is · `2` the audit could not run.
|
|
72
|
+
That third one matters: a failed audit must never be mistakable for a clean one. Use it in CI:
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
- run: snipeit-eosl # fails the job when EOL hardware appears in the inventory
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## How matching works
|
|
79
|
+
|
|
80
|
+
Deterministic and conservative, in this order:
|
|
81
|
+
|
|
82
|
+
1. **Exact** match on the part number.
|
|
83
|
+
2. **Loose** match ignoring case and punctuation — `ws c3850 24t l` finds `WS-C3850-24T-L`.
|
|
84
|
+
3. **Vendor-gated alias** — `FG-60E` finds `FortiGate-60E`, but *only* when the Snipe-IT manufacturer
|
|
85
|
+
is Fortinet, so one vendor's SKU can never land on another vendor's record.
|
|
86
|
+
|
|
87
|
+
**It never fuzzy- or substring-matches.** `WS-C3850` does not resolve to `WS-C3850-24T-L`. An unknown
|
|
88
|
+
part returns nothing rather than a plausible neighbour, because a confident wrong end-of-life date is
|
|
89
|
+
worse than no date.
|
|
90
|
+
|
|
91
|
+
It reads `model_number` first and falls back to the model `name`, since many real installs leave
|
|
92
|
+
`model_number` blank. Which field matched is reported in `matched_on`, so a result is always
|
|
93
|
+
traceable.
|
|
94
|
+
|
|
95
|
+
### Snipe-IT already has an "EOL" field. It does not mean this.
|
|
96
|
+
|
|
97
|
+
Snipe-IT models carry their own `eol` value, and its API returns it as a string like `"36 months"`.
|
|
98
|
+
That is a **depreciation-style estimate of useful life measured from purchase** — a number somebody
|
|
99
|
+
at your organisation typed in. It is not a manufacturer date and it has no source behind it.
|
|
100
|
+
|
|
101
|
+
This tool reports the **manufacturer's published end-of-service-life date**, with a link to the
|
|
102
|
+
bulletin it came from. The two answer different questions, and the built-in field is the one people
|
|
103
|
+
mistake for this. `snipeit-eosl` reads it never and writes it never.
|
|
104
|
+
|
|
105
|
+
### "Not tracked" is not "supported"
|
|
106
|
+
|
|
107
|
+
Models EOSL.ai has no record for are reported as **unknown**, never folded in with the healthy ones.
|
|
108
|
+
It means this database holds no date for that part — not that the part is fine. The tooling says so
|
|
109
|
+
in every output format on purpose.
|
|
110
|
+
|
|
111
|
+
## What this does not do
|
|
112
|
+
|
|
113
|
+
- **It never writes to Snipe-IT.** Snipe-IT is a system of record, and a tool that quietly edits one
|
|
114
|
+
is a tool nobody should point at production. Write-back into a custom field was considered and
|
|
115
|
+
deliberately left out.
|
|
116
|
+
- **It does not warrant the dates.** Every record links the manufacturer's bulletin. That bulletin
|
|
117
|
+
governs; this is a convenience layer over it.
|
|
118
|
+
- **It does not invent dates.** If a manufacturer has published nothing, nothing is shown.
|
|
119
|
+
|
|
120
|
+
## Related integrations
|
|
121
|
+
|
|
122
|
+
Same data, same matching logic, different place to stand:
|
|
123
|
+
|
|
124
|
+
- **[netbox-eosl](https://github.com/EOSL-AI/netbox-eosl)** — NetBox plugin
|
|
125
|
+
- **[ansible-eosl](https://github.com/EOSL-AI/ansible-eosl)** — `eosl.lifecycle` Ansible collection
|
|
126
|
+
- **[EOSL.ai API](https://eosl.ai/api/)** — public JSON API, MCP server, and CC BY dataset
|
|
127
|
+
|
|
128
|
+
## Licence
|
|
129
|
+
|
|
130
|
+
Apache-2.0. The underlying dataset is **CC BY 4.0** — free for commercial use with attribution.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
snipeit_eosl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
snipeit_eosl/cli.py,sha256=1Ve3oQMS4AC959jMfD63BOIkG83lkuSZ-LG6CO1Rg4Q,3607
|
|
3
|
+
snipeit_eosl/eosl.py,sha256=99EkNwbUl7_joP_2bne1CfnRnVzsNpaB0LPr_NpzYMA,3401
|
|
4
|
+
snipeit_eosl/matching.py,sha256=-k2qU0Rm4j0Ryjga-y_PcimzsAwNu3XrasS905ZSoWI,5003
|
|
5
|
+
snipeit_eosl/report.py,sha256=RV_GDuz_2eHK87_WohZruwSb_28PnkvuQcyTerqXjiM,6494
|
|
6
|
+
snipeit_eosl/snipeit.py,sha256=3Z8lCPdNTxeThL1gS_FR4vbYOjnWDIVqFc1awXKE6vY,5802
|
|
7
|
+
snipeit_eosl-1.0.0.dist-info/licenses/LICENSE,sha256=8MIt5rjpYpxzEFylDddz-WQ2oRwJsICB38D4rJZMTME,11337
|
|
8
|
+
snipeit_eosl-1.0.0.dist-info/METADATA,sha256=PMgiETlu7GUCf4MjJzXYn6a0RriEbutebW7RoVpmRxM,5685
|
|
9
|
+
snipeit_eosl-1.0.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
10
|
+
snipeit_eosl-1.0.0.dist-info/entry_points.txt,sha256=YONtX2Nt1tcSod70rN2eyKYAXmri79tEHdoaRf6hG6c,55
|
|
11
|
+
snipeit_eosl-1.0.0.dist-info/top_level.txt,sha256=BAG-bYhnB-ca_QSjJSA9C64GZTWh_e1PT9ye44Kstdk,13
|
|
12
|
+
snipeit_eosl-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and do
|
|
117
|
+
not modify the License. You may add Your own attribution notices
|
|
118
|
+
within Derivative Works that You distribute, alongside or as an
|
|
119
|
+
addendum to the NOTICE text from the Work, provided that such
|
|
120
|
+
additional attribution notices cannot be construed as modifying
|
|
121
|
+
the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions for
|
|
125
|
+
use, reproduction, or distribution of Your modifications, or for any
|
|
126
|
+
such Derivative Works as a whole, provided Your use, reproduction,
|
|
127
|
+
and distribution of the Work otherwise complies with the conditions
|
|
128
|
+
stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 EOSL.ai
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
snipeit_eosl
|