$schema: http://json-schema.org/draft-07/schema#
type: object
definitions:
  ipAddressCidr:
    type: string
    pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$
  ip6AddressCidr:
    type: string
    pattern: ^([0-9a-f]{0,4}:){2,7}[0-9a-f]{0,4}/[0-9]{1,3}$
  ip46AddressCidr:
    oneOf:
    - $ref: "#/definitions/ipAddressCidr"
    - $ref: "#/definitions/ip6AddressCidr"
  isoDate:
    type: string
    pattern: "^[0-9]{4}-[01][0-9]-[0-3][0-9]([T| ][0-2][0-9](:[0-5][0-9]){1,2})?$"
properties:
  include:
    type: array
    items:
      type: string
      pattern: "^.*.yaml$"
  vars:
    type: object
    patternProperties:
      ^[a-zA-Z0-9\-\._~]+$:
        type: string
      additionalProperties: false
  image:
    type: string
    pattern: "^[1-9][0-9]*.[0-9]+.[0-9]+$"
  netconfig:
    $ref: https://support.onway.ch/onway-router/schemas/carlos/latest/rumpl/netconfig.yaml
  telemetry:
    $ref: https://support.onway.ch/onway-router/schemas/carlos/latest/rumpl/telemetry.yaml
  bundle:
    $ref: https://support.onway.ch/onway-router/schemas/carlos/latest/rumpl/bundle.yaml
  vpn:
    $ref: https://support.onway.ch/onway-router/schemas/vpnconf/latest/vpnconf.yaml
  certs:
    type: array
    items:
      type: object
      required:
      - ca
      - common-name
      - not-after
      additionalProperties: false
      properties:
        ca:
          type: string
          pattern: ^[^[\]?*]+$
        common-name:
          type: string
        not-before:
          $ref: "#/definitions/isoDate"
        not-after:
          $ref: "#/definitions/isoDate"
        blocks:
          type: array
          items:
            $ref: "#/definitions/ip46AddressCidr"
        subject-altnames:
          type: array
          items:
            type: string
additionalProperties: false
