Skip to main content

No project description provided

Project description

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.

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

Project details


Download files

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

Source Distribution

mmisp_api-0.10.0.tar.gz (73.4 kB view details)

Uploaded Source

File details

Details for the file mmisp_api-0.10.0.tar.gz.

File metadata

  • Download URL: mmisp_api-0.10.0.tar.gz
  • Upload date:
  • Size: 73.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for mmisp_api-0.10.0.tar.gz
Algorithm Hash digest
SHA256 f4ab4be1cad01d4b9490806ae44390d93a35163e079470226172623f05390795
MD5 29471170b96c0411620cbdfd81fed6d9
BLAKE2b-256 78497ecd763111789dc302f60f89d52572f0442c8ee431c3f1b715dab8d98f0e

See more details on using hashes here.

Supported by

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