Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to
### Changed

- Updated l9format requirement from =1.3.2 to =1.4.0 ([ae676d9])
- Updated l9format requirement from =1.4.0 to =2.0.0 ([df916e5], [#68])

### Removed

- Removed dependency on serde (unmaintained), replaced with dataclasses
and l9format.l9format.Model ([df916e5], [#68])

### Infrastructure

Expand Down Expand Up @@ -54,6 +60,7 @@ and this project adheres to
[0.1.9]: https://github.com/LeakIX/LeakIXClient-Python/releases/tag/v0.1.9

<!-- Commit links -->
[df916e5]: https://github.com/LeakIX/LeakIXClient-Python/commit/df916e5
[14bc55e]: https://github.com/LeakIX/LeakIXClient-Python/commit/14bc55e
[a652654]: https://github.com/LeakIX/LeakIXClient-Python/commit/a652654
[3967e42]: https://github.com/LeakIX/LeakIXClient-Python/commit/3967e42
Expand All @@ -70,3 +77,4 @@ and this project adheres to
[#66]: https://github.com/LeakIX/LeakIXClient-Python/pull/66
[#65]: https://github.com/LeakIX/LeakIXClient-Python/issues/65
[#67]: https://github.com/LeakIX/LeakIXClient-Python/issues/67
[#68]: https://github.com/LeakIX/LeakIXClient-Python/pull/68
8 changes: 5 additions & 3 deletions leakix/client.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import dataclasses
import json
from enum import Enum
from importlib.metadata import version
from typing import Any

import requests
from l9format import l9format
from serde import Model, fields
from l9format.l9format import Model

from leakix.domain import L9Subdomain
from leakix.plugin import APIResult
Expand All @@ -23,9 +24,10 @@ class Scope(Enum):
LEAK = "leak"


@dataclasses.dataclass
class HostResult(Model):
Services: fields.Optional(fields.List(fields.Nested(l9format.L9Event)))
Leaks: fields.Optional(fields.List(fields.Nested(l9format.L9Event)))
Services: list[l9format.L9Event] | None = None
Leaks: list[l9format.L9Event] | None = None


DEFAULT_URL = "https://leakix.net"
Expand Down
12 changes: 8 additions & 4 deletions leakix/domain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from serde import Model, fields
import dataclasses
from datetime import datetime

from l9format.l9format import Model


@dataclasses.dataclass
class L9Subdomain(Model):
subdomain: fields.Str()
distinct_ips: fields.Int()
last_seen: fields.DateTime()
subdomain: str = ""
distinct_ips: int = 0
last_seen: datetime | None = None
8 changes: 5 additions & 3 deletions leakix/plugin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import dataclasses
from enum import Enum

from serde import Model, fields
from l9format.l9format import Model


@dataclasses.dataclass
class APIResult(Model):
name: fields.Str()
description: fields.Str()
name: str = ""
description: str = ""


class Plugin(Enum):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [{ name = "Danny Willems", email = "danny@leakix.net" }]
requires-python = ">=3.13"
dependencies = [
"requests",
"l9format==1.4.0",
"l9format==2.0.0",
"fire>=0.5,<0.8",
]

Expand Down
Loading