- Parmana and its own Postgres running on your machine.
- The shipped
customer-refundpolicy approved by two people, the way production requires. - A refund request refused by that policy, with a signed Refusal Record you can verify.
Before you start
Run every command from the root of the repository.
Each
docker compose run command first prints two lines such as Container parmana-setup-run-4031dfc35ccf Creating and ... Created. They go to standard error and are not part of the output shown on this page.
Step 1: Start Parmana
./parmana-local. What each part does is in Configuration reference.
Check:
Step 2: Read your API key
The first start made one API key, for the caller IDlocal-operator, allowed to use the capability paytm:refund. Print it:
pk_local_. That line is the key. Keep it in a variable for the rest of this page:
Step 3: Add the two people who approve policies
In production a policy decides nothing until two different people have approved it: a proposer, and an approver who confirms with a signature from a key only they hold. Until then every request under that policy is refused with403 POLICY_DENIED and the reason “has no PolicyChangeApprovalRecord”. This page calls them alice (proposer) and bob (approver). Use your own names.
3a. The approver makes a step up key pair, on their own machine. The private key never leaves that machine.
step-up.public.pem to whoever runs Parmana. In this quickstart both are you, on one machine.
3b. Add both API keys. Each command prints the new key once, on the line that starts with pk_local_. It cannot be shown again. Give each person their own key.
-T is required for that:
Step 4: Approve the customer-refund policy
4a. Alice proposes the policy exactly as it ships in policies/customer-refund/1.0.0/policy.json:
99527ea9-16dd-468d-bcc7-88d51daa1779. If it prints nothing, proposed.json holds the error.
4b. Bob signs his approval, on his own machine. This needs a clone of the repository with npm install run once. The signature is valid for 120 seconds and for this one change only, so do 4c right after.
"status":"APPROVED".
Parmana refuses the approval if Alice sends it (403 SAME_ACTOR_CANNOT_APPROVE_OWN_CHANGE), if the signature is reused, expired or made with another key (STEP_UP_AUTHORIZATION_INVALID), or if the key is not a verified human (NON_HUMAN_CALLER_DENIED).
Step 5: Get your first decision
Build a request for a refund of 50,000, which is over the policy’s limit of 10,000:Step 6: Verify the Refusal Record
Fetch it by the request’sbusinessTransactionId:
What you have now
- Parmana running on your machine with its own Postgres, signing keys and API keys. Nothing is sent to Parmana or anywhere else.
- A policy approved by two people, recorded and signed.
- A refused request with a signed Refusal Record.
503 CONNECTOR_NOT_REGISTERED and nothing is executed. To see the full authorized path, including a Trust Record verified with only the public keys, run the offline check. To connect your own system, see Connectors.
Clean up
The files this page created on your machine:approver/, proposal.json, proposed.json, signed.txt, approved.json, refund.json, refusal.json and tampered.json. Delete them when you are done. Keep approver/step-up.private.pem if Bob will approve again.
To stop Parmana and keep everything: docker compose down. To delete the database too: docker compose down -v. Deleting ./parmana-local deletes your signing keys and API keys.