Skip to main content

Modern MISP - API

Ruff Conventional Commits

Requirements

Getting Started

Clone the project and install Python version 3.11.0. It is recommended to install Python using pyenv. Then install all dependencies by typing make setup into your terminal and start your local database container using make up.

Create a file called .env and copy the contents of .env.example into it. Finally, start the development server using make dev.

You should now be able to access the api on localhost:4000.

To use the commandline tool run python .\src\mmisp\commandline_tool\main.py --h from the base directory to view all commands. For detailed information of all commands: python .\src\mmisp\commandline_tool\main.py --help. For setting up the DB use the commandline tool option for setup and then create your user account. In case you have not created a new organisation yet, please add your account to the setup basic organisation: ghost_org.

Run tests using make test (local database container required running) or make test/lite.

Setting up your IDE

Be sure to use the newly created virtual env as your interpreter (./venv/bin/python). Also install the Ruff extension for your IDE and set Ruff as your default code formatter. It is recommended to activate formatting your code on every save.

Best Practices

General Guidelines

The following are some guidelines for writing code, in no particular order:

  • Try to write clean code
  • Use the "early return" pattern, do you really need that else block?
  • Add correct types wherever possible, reduce Any occurrences as much as possible
  • Reduce database calls
  • Be consistent within your code, and within the rest of the codebase
  • Use whitespace generously, to group and separate lines of code
  • Be explicit, magic is great until it is not

Endpoint Ordering

Try to order endpoints using CRUD so that the following order is achieved:

  • Create a {resource}
  • Read / Get a {resource}
  • Update a {resource}
  • Delete a {resource}
  • Get all {resource}s
  • More niche endpoints
  • Deprecated endpoints

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mmisp_lib-0.14.0.tar.gz (130.9 kB view details)

Uploaded Source

File details

Details for the file mmisp_lib-0.14.0.tar.gz.

File metadata

  • Download URL: mmisp_lib-0.14.0.tar.gz
  • Upload date:
  • Size: 130.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for mmisp_lib-0.14.0.tar.gz
Algorithm Hash digest
SHA256 e4de65b498bbc32076ae1839f52f9c6fd479d3202e0523a720dd45736fb6e1b0
MD5 8167f1cb913794750496d08d9687c986
BLAKE2b-256 5c527067512fcd2d44946ef849e12a0f70cce53b227a9f1fa3cb39df68af5e7c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.14.0 This release

1 file

0.13.0

1 file

0.12.0

1 file

0.11.3

1 file

0.11.2

1 file

0.11.1

1 file

0.11.0

1 file

0.10.1

1 file

0.10.0

1 file

0.9.0

1 file

0.8.4

1 file

0.8.3

1 file

0.8.2

1 file

0.8.1

1 file

0.8.0

1 file

0.7.5

1 file

0.7.4

1 file

0.7.3

1 file

0.7.2

1 file

0.7.1

1 file

0.7.0

1 file

0.6.4

1 file

0.6.3

1 file

0.6.2

1 file

0.6.1

1 file

0.6.0

1 file

0.5.0

1 file

0.4.0

1 file

0.3.0

1 file

0.2.0

1 file

0.1.11

1 file

0.1.10

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page