capactio / capact

Simple way to manage applications and infrastructure.
https://capact.io
Apache License 2.0
80 stars 19 forks source link

Validate TypeInstance input during TypeInstance creation #544

Closed lukaszo closed 2 years ago

lukaszo commented 2 years ago

Description

I've created cap.type.database.object.aws.s3.config with a typo in accesskey and TypeInstance was created without any problems.

Support:

Make sure all manifests are valid (that TypeInstance upload always succeeds as the data is valid)

Expected behavior

I've should get an error about missing accesskey key.

Actual behavior

No error was returned.

Steps to reproduce

Define TypeInstance:

typeInstances:
  - alias: aws-s3
    attributes:
      - path: cap.attribute.cloud.provider.aws
        revision: 0.1.0
    typeRef:
      path: cap.type.database.object.aws.s3.config
      revision: 0.1.0
    value:
      accessKey: aaaaa
      endpoint: https://s3.amazonaws.com

There is typo in accessKey it should be accesskey. Also, secretkey is missing.

mszostok commented 2 years ago

It will be also good to validate that during the upload TypeInstance step in our workflows.

We already had such situation when uploaded TypeInstance was wrongly formatted.