eventum-project / eventum-plugins

Plugins for Eventum
Apache License 2.0
0 stars 0 forks source link

Implement `when` clause in main configuration for template for Jinja event plugin #5

Open rnv812 opened 1 month ago

rnv812 commented 1 month ago

when option is intended to be used for filtering which templates are rendered after picking them using specified mode.

Suboptions to implement:

Logic:

Checks:

Examples usage:

templates:
  - logon:
      template: "logon_events.json.jinja"
      when:
        and:
          - in:
              tags: ["basic"]
          - in:
              locals.my_mapping: "some key"
rnv812 commented 1 week ago

Final model of feature implementation

  mode: fsm

  templates:
    - normal:
        template_group:
          - "event_1.json.jinja"
          - "event_2.json.jinja"
        transition:
          to: suspicious
          when:
            in:
              locals.logged_on_users: "Hacker"
    - suspicious:
        template: "suspicious_event.json.jinja"
        transition:
          to: normal
          when:
            in:
              locals.logged_out_users: "Hacker"