Skip to content

Commit

Permalink
new: [Search] Added simple search command. And added push status to V…
Browse files Browse the repository at this point in the history
…ulnerability Lookup parameter to the Stream command.
  • Loading branch information
cedricbonhomme committed Nov 8, 2024
1 parent 7dba5f9 commit 38a85bd
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ You only have to execute it once.

### Streaming

#### Usage

```bash
usage: FediVuln-Stream [-h] [--user] [--public] [--push-sighting] [--push-status]

Allows access to the streaming API.

options:
-h, --help show this help message and exit
--user Streams events that are relevant to the authorized user, i.e. home timeline and notifications.
--public Streams public events.
--push-sighting Push the sightings to Vulnerability Lookup.
--push-status Push the status to Vulnerability Lookup.
```

#### Examples

Streams events that are relevant to the authorized user, i.e. home timeline and notifications:

```bash
Expand All @@ -51,7 +68,6 @@ If you want to get the stream of public events (local server + connected servers
$ FediVuln-Stream --public --push-sighting
```


Using the ``--push-sighting`` argument, detected vulnerability IDs will be recorded in
[Vulnerability Lookup](https://github.com/cve-search/vulnerability-lookup) as
[sightings](https://vulnerability-lookup.readthedocs.io/en/latest/sightings.html).
Expand All @@ -60,6 +76,21 @@ With ``--push-status`` argument, the full JSON status object will be sent to the
Vulnerability Lookup instance and stored in the kvrocks database.


### Search

#### Usage

```bash
usage: FediVuln-Search [-h] --query QUERY

Allows you to search for users, tags and, when enabled, full text, by default within your own posts and those you have interacted with.

options:
-h, --help show this help message and exit
--query QUERY Query of the search.
```


### Publishing

WIP.
Expand Down
4 changes: 3 additions & 1 deletion fedivuln/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ def push_status_to_vulnerability_lookup(status, vulnerability_ids):


def main():
parser = argparse.ArgumentParser(prog="FediVuln-Stream")
parser = argparse.ArgumentParser(
prog="FediVuln-Stream", description="Allows access to the streaming API."
)
parser.add_argument(
"--user",
action="store_true",
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ include = [
[tool.poetry.scripts]
FediVuln-Register = "fedivuln.register:main"
FediVuln-Stream = "fedivuln.stream:main"
FediVuln-Search = "fedivuln.search:main"
FediVuln-Publish = "fedivuln.publish:main"


Expand Down

0 comments on commit 38a85bd

Please sign in to comment.