Skip to content

Validating error codes on incoming PUT /error requests #964

Description

@elnyry-sam-k

Goal:

As a Hub Operator
I want to _validate error codes on /error requests _
so that only error codes defined in the Specification and Scheme are allowed

Tasks:

  • Confirm where the validation needs to happen (ml-api-adapter? prepare-handler?)
  • Implement validation with regex giving room for Scheme custom errors - will reuse existing validateFSPIOPErrorCode()
  • Create validateFspioperrorCodeByCategory hapi plugin at central-services-error-handling at onPreHandler during request lifecycle to validate payload. Leverage existing validateFSPIOPErrorCode() at factory.js. If validation fails call response.takeover()
  • Apply validateFspioperrorCodeByCategory hapi plugin at central-services-error-handling at ml-api-adapter only at the error callback route

Acceptance Criteria:

  • On /error PUT calls into the Switch, only error codes that are defined in the Specification or by a Scheme are allowed and those that are not, are rejected
  • Designs are up-to date
  • Unit Tests pass
  • Integration Tests pass
  • Code Style & Coverage meets standards
  • [ ] Changes made to config (default.json) are broadcast to team and follow-up tasks added to update helm charts and other deployment config.

Pull Requests:

Follow-up:

For documentation purposes, these are the valid incoming error codes:

  • Generic communication errors:
    • 1000, 10001
  • Generic server errors:
    • 2000, 2001, 2002, 2003, 2004, 2005
  • Generic client errors:
    • 3000, 3001, 3002, 3003
  • Client validation errors
    • 3100, 3101, 3102, 3103, 3104, 3105, 3106, 3107
  • Identifier errors
    • 3200, 3201, 3202, 3203, 3204, 3205, 3206, 3207, 3208, 3209, 3210
  • Expired errors:
    • 3300, 3301, 3302, 3303
  • Payer errors:
    • 4000, 4001, 4100, 4101, 4102, 4103, 4200, 4300, 4400
  • Payee errors:
    • 5000, 5001, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 5200, 5300, 5400

Dependencies:

Accountability:

  • Owner: TBC
  • QA/Review: TBC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions