setVpPolicies
Set the checks applied to the presentation as a whole.
Where VC policies check individual credentials, these check the presentation as a whole, for example that it carries enough credentials (minimum-credentials).
Each policy is an object: { policy }, or { policy, args } for a parameterised one. An asset whose vp_policies mixed names and objects was not indexed by ocean-node 4.2.x, so nautilus writes objects only, as the enterprise market does. args is a string; the policy server parses it as JSON when it can ('1' reaches the verifier as 1), so pass structured arguments through JSON.stringify.
Usage
import { } from '@deltadao/nautilus'
.(., [
{ : 'signature' },
{ : 'minimum-credentials', : '1' }
]) minimum-credentials needs its argument: a bare { policy: 'minimum-credentials' } fails in
the walt.id verifier for every presentation.
Check the presentation's own signature with { policy: 'signature' } among the VP
policies. walt.id runs only the VP policies the session lists, so without it nothing checks
that the presentation was signed by the DID it names, unless the policy server's operator adds
it through DEFAULT_VP_POLICIES, which nautilus cannot see. Listed on the asset, the check
holds whatever that setting is; when the policy server adds it too, it simply runs twice. It
does not bind the credential to the presenter, which is holder-binding's job, and it does not
stop a presentation replayed from an earlier session: the verifier accepts it.
Returns
- Type:
AssetBuilder
The asset builder instance, to chain further calls with.