Skip to content

General validation for objects received via the external interfaces #620

@krucod3

Description

@krucod3

Description

With #313 we add a JSON Schema to Ankaios that can be checked by entities reading Ankaios manifests.

The validation of the objects received by Ankaios (be it the server, the agent or the cli) is currently done manually using verification methods. Sometimes even different methods are used in different executables.

To provide a consistent verification the following is required:

  • validation annotations in the JSON schema
  • checking of the schema in the server and the cli when loading a manifest
  • validation possibilities (at best generated) in the rust code (via annotations)
  • checking the validity when receiving protobuf objects

There are multiple possibilities to properly achieve the requirements:

  1. use prost-validate to generate both validate methods for rust and schemars annotations
    Good alternative with probably minimal effort, but we must conder the risks for using this crate
  2. write our own prost plugin that adds the annotations
  3. manually add annotations to the JSON schema and implement (keep) manually written Rust code

In all cases it would be good if we have some validation added to the JSON schema before releasing Ankaios v1

Goals

Have a consistent, easy to maintain validation of the objects received on the external interfaces

Final result

Summary

To be filled when the final solution is sketched.

Tasks

  • Task 1
  • Task 2
  • ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request. Issue will appear in the change log "Features"

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions