Skip to main content

Shared PFC client, payload models, and enforcement helpers for integration adapters

Project description

pfc-core

pfc-core provides the shared building blocks used by the adapter packages in this repository. It contains the PFC client, payload helpers, and enforcement primitives that power execution-boundary decisions.

What It Does

  • Sends execution-boundary evaluation requests to PFC
  • Builds consistent decision payloads for adapter packages
  • Raises a shared blocked exception when PFC denies execution

Install

From this monorepo:

pip install -e ./packages/pfc_core

Quick Start

from pfc_core.client import PFCClient
from pfc_core.models import build_payload
from pfc_core.middleware import enforce

client = PFCClient("pfc_test_key")
payload = build_payload("demo_tool", {"value": 1}, "policy-123", framework="custom")
decision = {"allow": True, "decision_id": "demo", "receipt_hash": "receipt"}

print(payload)
print(enforce(decision))

How It Works

  1. build_payload creates a normalized execution request structure.
  2. PFCClient sends that payload to the configured PFC API endpoint.
  3. enforce raises when a returned decision blocks execution.

Failure Behavior

  • PFCClient raises an exception if the API request fails or returns a non-200 response.
  • enforce raises PFCBlockedError when allow is falsey.

Limitations

  • This package is intentionally small and does not manage framework-specific wrappers.
  • It assumes the caller is responsible for constructing appropriate framework context.
  • It does not bundle retries, tracing, or policy authoring features.

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

pfc_core-0.1.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pfc_core-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file pfc_core-0.1.0.tar.gz.

File metadata

  • Download URL: pfc_core-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.14.3 Darwin/25.3.0

File hashes

Hashes for pfc_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c49bcf83a8f4b5b825a09944aa0dd0fb05070fc5daa1147c180ef548432f1fd
MD5 05c23c89bc4ffa97af4eae117e7a277d
BLAKE2b-256 590850c67453ccf91018ce38811b5d211df3812e31c6a87db73c318aa52ad289

See more details on using hashes here.

File details

Details for the file pfc_core-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pfc_core-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.14.3 Darwin/25.3.0

File hashes

Hashes for pfc_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fb79899bdb4fdf79eddb18fcf8d42ce033346f471652be0afbbd6e6229d172b
MD5 267ea2ab305496afd02d19d582e1e5a7
BLAKE2b-256 792630c0883330c39517757d276c269c250e82044dcbf40e522d99565a1ddc55

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