Core Library | Development Tools | Fluid Attacks Help

Core Library

Purpose

This library was created to be used as a dependency by other Fluid Attacks’ components.

It contains common utilities that can be reused in other projects.

Installation

You can install this library via Pypi.
  1. Make any changes you want to the library.
  2. Run the Python linter:
  3. m . /common/fluidattacks-core
  4. Upgrade the library version in pyproject.toml  pyproje. Make sure to do this as it is required for your changes to be published.
  5. Push your changes using the common\ pipeline.
  6. Once you reach production, the new version of the library should become available.

Modules

Below you will find all relevant modules within the library.

git

You can import it via

from fluidattacks_core.git import (
      ...

)

http

This module wraps aiohttp, providing functions to perform HTTP requests, with additional security checks.

It is especially recommended for use cases where the URL comes from user input, as it helps prevent DNS rebinding attacks by default.
Warning
Caution
When dns_rebind_protection is True (by default), this library won’t follow redirects, but will instead return the response with a 3XX status code.
Usage example: 

import asyncio
from fluidattacks_core.git import (
      request

)

async def example() -> None:
      response = await request("https://fluidattacks.com/", method="GET")
      print(response)

asyncio.run(example())
Idea
Tip
Have an idea to simplify our architecture or noticed docs that could use some love? Don't hesitate to open an issue or submit improvements.