Valkyrian Labs

Installation

Install forti-api from the APT repository, vendor it, or build it from source.

Installation

forti-api is header-only. nlohmann/json 3.12.0 ships with it (installed under forti_api/third_party, so it never conflicts with a system nlohmann-json); libcurl is the only system dependency.

Requirements

A C++23 compiler is required; forti-api is tested with GCC 13 and 14 and with Apple Clang. Link libcurl.

Install forti-api

Pick the method that fits your project: the APT package (Debian and Ubuntu), the Homebrew formula (macOS and Linux), vendored headers, or a build from source.

libforti-api-dev is published to the ValkyrianLabs APT repository:

1sudo install -d -m 0755 /etc/apt/keyrings2sudo curl -fsSL https://apt.valkyrianlabs.com/pubkey.gpg \3  -o /etc/apt/keyrings/valkyrianlabs.gpg4sudo chmod 0644 /etc/apt/keyrings/valkyrianlabs.gpg5 6echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/valkyrianlabs.gpg] https://apt.valkyrianlabs.com stable main" | \7  sudo tee /etc/apt/sources.list.d/valkyrianlabs.list > /dev/null8 9sudo apt update10sudo apt install -y libforti-api-dev

The packages depend on valkyrianlabs-archive-keyring, which installs the repository key at /usr/share/keyrings/valkyrianlabs.gpg and keeps it current through normal upgrades (for example when its expiry changes). When the key downloaded above is unmodified, the package replaces it with a symlink to the packaged key, so the source line above keeps working and you never need to download the key again. Removing the package turns the symlink back into a plain copy. Signing key fingerprint: 494D 71A1 EEDD F87B D48E 5048 6D64 CB7B DFC3 0EC6.

The package installs the headers to /usr/include/forti_api and a pkg-config file:

1c++ -std=c++23 app.cpp $(pkg-config --cflags --libs forti-api)

With Meson, dependency('forti-api') finds it through pkg-config.

Install locations

Method Headers pkg-config file
APT /usr/include/forti_api installed; pkg-config forti-api
Homebrew the Homebrew prefix forti-api.pc in the Homebrew prefix
Vendoring wherever you copy include/ and third_party/nlohmann/include/ none
Meson subproject not installed not installed
From source <prefix>/include/forti_api <prefix>/share/pkgconfig/forti-api.pc

Next steps

Quick start

Connect to a FortiGate and read, change and create objects.

Configuration

Environment variables and fortiapi::Config fields.