Contributing
Architecture
MCP backend --import--> af_credentials.verifier.BrokerTokenVerifier --HTTPS--> AF broker JWKS
\-> af_credentials.proxy.ProxyClient --HTTPS--> AF broker (x509 redeem)
\-> af_credentials.mcp.mcp_token_verifier (optional, requires the `mcp` extra)
af-credentials is a thin client library with no dependency on af_mcp_broker,
FastAPI, or Kubernetes: BrokerTokenVerifier verifies AF Broker Identity Tokens
against a broker's published JWKS, ProxyClient redeems brokered x509/VOMS
proxies, and af_credentials.mcp optionally adapts the verifier to the mcp
SDK's TokenVerifier protocol.
Development setup
git clone https://github.com/maniaclab/af-credentials
cd af-credentials
pixi install
pixi run pre-commit-install
Build and test commands
pixi run test # run tests
pixi run lint # pre-commit + pylint
pixi run build # build sdist + wheel
pixi run docs-serve # build and serve docs locally
Tests
tests/test_verifier.py—BrokerTokenVerifier, including JWKS caching and key-rotation refetch behaviortests/test_proxy.py—ProxyClient, mocking the broker's redeem endpoint viahttpx2.MockTransporttests/test_mcp.py— the optionalmcpSDK adapter; requires themcppackage to be installed (it is, in everypixi run -e pyXXX testenvironment) or the module is skipped viapytest.importorskip("mcp")
tests/conftest.py mints RSA-signed test tokens shaped exactly like
af_mcp_broker.credentials.broker_issued.BrokerTokenIssuer.mint() produces, so
BrokerTokenVerifier is exercised against realistic tokens without any
dependency on the broker itself.