Detalhes do pacote

@ucanto/validator

web3-storage22.9k(Apache-2.0 AND MIT)10.0.0

UCAN RPC validators

UCAN, ed25519, did, issuer

readme (leia-me)

@ucanto/validator

@ucanto/validator provides validation mechanisms for UCAN-based capabilities, ensuring that invocations comply with defined rules and security policies.

What It Provides

  • Capability Validation: Ensures UCANs are properly formatted and authorized.
  • Invocation Verification: Checks that invocations conform to defined constraints.
  • Security Enforcement: Applies validation policies to prevent unauthorized actions.

How It Fits with Other Modules

For an overview and detailed usage information, refer to the main ucanto README.

Installation

npm install @ucanto/validator

Example Usage

import { capability, URI } from '@ucanto/core';
import { validate } from '@ucanto/validator';

const readFile = capability({
  can: 'file/read',
  with: URI.match({ protocol: 'file:' })
});

const isValid = validate({
  capability: readFile,
  proof: someProof,
  with: 'file://example.txt'
});

if (isValid) {
  console.log('Capability is valid');
} else {
  console.error('Invalid capability');
}

For more details, see the ucanto documentation.

changelog (log de mudanças)

Changelog

0.1.0-beta (2022-05-03)

Features

  • improve http transport configuration (#10) (c99be08)

0.0.3-beta (2022-05-02)

Bug Fixes

0.0.2-beta (2022-04-24)

Bug Fixes

0.0.1-beta (2022-04-24)

Features

Bug Fixes

Miscellaneous Chores