Module: Textus::Manifest::Schema

Defined in:
lib/textus/manifest/schema.rb,
lib/textus/manifest/schema/keys.rb,
lib/textus/manifest/schema/contract.rb,
lib/textus/manifest/schema/semantics.rb,
lib/textus/manifest/schema/validator.rb,
lib/textus/manifest/schema/vocabulary.rb

Overview

The manifest schema. Its data is split across Schema::Vocabulary (the coordination vocabulary) and Schema::Keys (key whitelists + FIELD_REGISTRY) as of ADR 0109; the validation walk lives in Schema::Validator (ADR 0107). The constants are re-exported here so callers keep saying ‘Schema::LANES`.

Defined Under Namespace

Modules: Keys, Semantics, Validator, Vocabulary

Constant Summary collapse

LANES =

Re-export the vocabulary.

Vocabulary::LANES
LANE_KINDS =
Vocabulary::LANE_KINDS
CAPABILITIES =
Vocabulary::CAPABILITIES
KIND_REQUIRES_VERB =
Vocabulary::KIND_REQUIRES_VERB
ROOT_KEYS =

Re-export the keys + registry.

Keys::ROOT_KEYS
ROLE_KEYS =
Keys::ROLE_KEYS
LANE_KEYS =
Keys::LANE_KEYS
ENTRY_KEYS =
Keys::ENTRY_KEYS
PUBLISH_KEYS =
Keys::PUBLISH_KEYS
SOURCE_KEYS =
Keys::SOURCE_KEYS
RETENTION_KEYS =
Keys::RETENTION_KEYS
AUDIT_KEYS =
Keys::AUDIT_KEYS
FIELD_REGISTRY =
Keys::FIELD_REGISTRY
RULE_KEYS =
Keys::RULE_KEYS
OWNER_SUBJECT_PATTERN =
Keys::OWNER_SUBJECT_PATTERN
Contract =

rubocop:disable Metrics/BlockLength

Dry::Schema.JSON do
  required(:lanes).value(:array).each do
    hash do
      required(:name).value(:string)
      required(:kind).value(included_in?: Vocabulary::LANE_KINDS)
      optional(:owner).value(:string)
      optional(:desc).value(:string)
    end
  end

  optional(:roles).value(:array).each do
    hash do
      required(:name).value(:string)
      optional(:can).value(:array).each(:string)
    end
  end

  optional(:entries).value(:array).each do
    hash do
      required(:key).value(:string)
      required(:lane).value(:string)
      optional(:path).value(:string)
      optional(:owner).value(:string)
      optional(:format).value(:string)
      optional(:schema).maybe(:string)
      optional(:kind).value(:string)
      optional(:nested).value(:bool)
      optional(:tracked).value(:bool)
      optional(:ignore)
      optional(:source)
      optional(:publish).value(:array)
    end
  end

  optional(:rules).value(:array).each do
    hash do
      optional(:match).value(:string)
      optional(:guard)
      optional(:retention)
      optional(:react)
    end
  end

  optional(:audit).hash do
    optional(:max_size).value(:integer)
    optional(:keep).value(:integer)
  end
  optional(:version).value(:string)
end

Class Method Summary collapse

Class Method Details

.validate!(raw) ⇒ Object

Public entry point — the validation walk lives in Schema::Validator (ADR 0107).



27
# File 'lib/textus/manifest/schema.rb', line 27

def self.validate!(raw) = Validator.validate!(raw)