Production integration
An agent identity is not permission. The receiving organisation decides which agent may access its published integration profile.
Node.js partner package · 0.2.0
Independent server application, Node.js 20+, no dependencies. Includes A’s registration/issuance/revocation client, B’s protected profile service, signed request client, configuration, README and automated tests. It calls the real RFA verification API; there are no built-in production credentials or automatic organisation approvals.
Download partner packagetar -xzf rfa-production-partner-0.2.0.tar.gz
cd production-partner
npm test
# Configure B's actual profile, action allowlist and HTTPS audience first.
node server.mjsA → B → revocation
- A applies in the integrator dashboard. After manual approval, A creates a live key and keeps it on its own server.
- A registers a dedicated agent, proves control of its Ed25519 key and issues a production credential using
issue-agent.mjs. - B configures its own non-sensitive published profile and allows that exact agent subject to perform
read-integration-profile. An empty allowlist denies everyone. - A requests B’s one-use, 60-second challenge and signs it locally. B verifies live credential status, trusted issuer, bound public key, signature, service/operation binding and its own permission before returning the profile.
- With B’s consent, A revokes only the dedicated acceptance credential. A’s next request gets a new challenge and is rejected. B never caches positive verification.
Sandbox, expired, revoked, untrusted or unverifiable credentials are denied. An unavailable RFA service returns a temporary error without opening the operation.
Acceptance status
Internal automated tests cover acceptance, next-request revocation, sandbox rejection, expired credentials, untrusted issuer, missing key binding, replay, wrong signing key, permission denial and service failure.
Independent production integration: not completed.
No separately controlled approved organisation A or authorised partner B environment has been supplied for a production acceptance/revocation run. This RFA-maintained reference is not counted as an external customer.
Installation and acceptance README
# RFA production partner reference 0.2.0
Node.js 20+, no dependencies to install. The existing RFA JavaScript SDK 0.1.0 is bundled as `sdk.mjs` from `packages/rfa-id-sdk-js/src/index.ts`; A's client uses its registration, key proof, issuance and revocation methods. An external Node HTTP service calls the **real** RFA public credential verifier before every protected operation. This reference is not an independent customer or a completed production adoption. Automated production-shaped responses live only in `test/`, never in the running service.
## Organisation A: register, prove, issue
1. Apply at https://republicoffreeai.com/developers/dashboard. Wait for an administrator to approve the organisation; no automatic production approval. Create a `rfa_live_` key. Keep it on A's server, never in a URL, browser, logs or analytics. Renew/revoke keys in the same dashboard. Renewal immediately disables the previous key.
2. On A's Node.js server, securely set `RFA_API_KEY` to that live key. Export configuration from `.env.example` (this package does not automatically load `.env`). Default `RFA_ENVIRONMENT=live`, `RFA_BASE_URL=https://republicoffreeai.com`.
3. In a **new dedicated acceptance directory**, run:
```sh
node issue-agent.mjs register
node issue-agent.mjs issue
```
The first command saves an Ed25519 private PEM and registers only its public JWK. The second signs the RFA single-use challenge and issues a credential to A's own proven agent using existing endpoints. Local secret files use mode 0600. They are not printed. Record the public `urn:rfa:agent:<UUID>` returned by registration. Never use an operational credential for the revocation acceptance test. Keep A's PEM secret on A's server; do not send it to B.
For internal sandbox checks only, set `RFA_ENVIRONMENT=test` with a `rfa_test_` key. B deliberately refuses these credentials.
## Organisation B: explicit permission and published profile
Copy `partner.config.example.json` to `partner.config.json`. Replace the profile with a genuine, non-sensitive integration profile B agrees to publish. The empty default allowlist denies everyone. Add A's exact agent subject only when B authorises the operation:
```json
{
"allowlist": {
"urn:rfa:agent:<A's registered UUID>": ["read-integration-profile"]
},
"profile": { "name": "B's published profile", "operations": ["read-integration-profile"] }
}
```
Only the real UUID goes in the installed configuration. This example is not a registered partner. Valid identity alone grants no access. Permissions live on B's server, not in the caller's request. B needs **no** RFA API key or issuer/private agent key.
```sh
export PARTNER_AUDIENCE=http://127.0.0.1:8787
export PARTNER_CONFIG=./partner.config.json
node server.mjs
```
In production set `PARTNER_AUDIENCE` to B's exact HTTPS origin and place this loopback service behind B's TLS reverse proxy. Set the same origin on A. Do not expose plain HTTP outside loopback. Use a single Node process: the bounded in-process challenge store is one-use, 60 seconds; restart invalidates outstanding challenges. Multi-instance deployment requires an atomic shared challenge store before use. The reference rate-limits per direct socket address; configure B's proxy limits appropriately. No CORS/browser access or token query parameters are supported.
## A → B: protected operation
On A, with `PARTNER_AUDIENCE` set to B's origin, the credential and its original private PEM:
```sh
node request-profile.mjs
```
A POSTs its credential to B's `/challenge`. B returns a random, one-use challenge bound to its own configured audience, the credential SHA-256, `POST /integration-profile`, operation and expiry. A checks those fields and signs the **exact UTF-8 message** with its local Ed25519 key. A POSTs credential, challengeId and signature to `/integration-profile`.
B consumes the challenge before any asynchronous check; calls `POST https://republicoffreeai.com/api/v1/identity/verify-credential`; requires signature-valid, active, unexpired, trusted RFA issuer, authoritative `live` status and matching signed `production` claim; matches `agent_binding` to the signed subject/key; requires its own action allowlist; verifies A's signature using only that bound key; then returns its published profile. Request-supplied public keys are ignored. Missing key binding fails closed, including an older RFA deployment without the new field.
Every protected request rechecks RFA: **no positive caching**. Rejected credentials/proofs return 401, missing permission 403, RFA connection/timeout/bad response 503, oversized/invalid input 400, rate limiting 429. CLI exit codes: 0 accepted, 1 rejected, 2 service/connection failure. CLI logs status and, on success, only B's published profile; never JWTs or keys. B logs neither requests nor credentials; configure proxy/analytics to exclude request bodies and authorisation headers.
## Dedicated acceptance: revoke → next request rejected
Only with B's permission and a separate acceptance credential belonging to the approved A organisation:
```sh
node request-profile.mjs # must be HTTP 200
CONFIRM_ACCEPTANCE_REVOCATION=yes node issue-agent.mjs revoke
node request-profile.mjs # new challenge, must be HTTP 401
```
Keep the same credential file for the second request. The client obtains a new challenge, so the rejection tests revocation rather than replay. Do not revoke the shared RFA sandbox example.
## Tests and scope
```sh
npm test
```
Tests run B plus a **separate test-only HTTP verification server**, with Ed25519 signatures and explicit synthetic fixtures: valid, revoked on next request, sandbox, expired, wrong issuer, missing binding, replay/concurrent replay, wrong signing key, credential substitution, unlisted/action-forbidden agent, expired challenge and unavailable RFA. They are not external production evidence. For real verification, run the service unchanged: its default upstream is RFA, not a stub.
Independent production acceptance is incomplete until an approved external A and a separately controlled, authorised B environment demonstrate acceptance and revocation. No partner credentials/access were provided to RFA for that check. The public verification UI is https://republicoffreeai.com/verify and API contract is https://republicoffreeai.com/openapi/rfa-id-v1.yaml.