Skip to content

Customizable Error Filtering for js-rpc through User-Defined toError/fromError Functions #10

@addievo

Description

@addievo

Description

Enable user-defined error serialization and deserialization through toError and fromError functions in js-rpc. Add optional replacer and reviver parameters to further customize the (de)serialization process, thereby enhancing security by allowing application-specific rules for sensitive data filtering.

Requirements

  1. User-Driven: User should be able to define toError and fromError functions.
  2. Optional Parameters: Introduce replacer and reviver for added customization.
  3. Application-Specific: Allow injectable rules for data filtering.
  4. PK Conformance: Compatibility with existing Polykey workflows.

Tasks

  • Parameterize toError and fromError: Accept user-defined implementations.
  • Constructor Implementation: Include toError, fromError, replacer, and reviver in the constructor.
  • Unit Testing: Create tests for the new features.
  • Documentation: Update js-rpc documentation.

Acceptance Criteria

  • User-defined toError and fromError functions can be successfully implemented.
  • Optional replacer and reviver parameters function as expected.
  • The system supports application-specific data filtering rules.
  • Documentation is updated.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions