Cybersecurity-Projects/PROJECTS/intermediate/credential-rotation-enforcer/spec/unit/policy
CarterPerez-dev 538395ebcc feat(policy): Crystal Policy as Code DSL with macros + compile-time enum autocast
- Policy struct: matcher Proc, max_age, warn_at, enforce_action, notify_channels, triggers
- Builder validates all required fields at .build, raises BuilderError with the policy name
- DSL exposes top-level 'policy' method via 'with builder yield' so all
  builder methods (description, match, max_age, enforce, notify_via, etc.)
  are receiver-less inside the block
- Symbol literals autocast to Action/Channel/Trigger enums on direct calls;
  Symbol overload for splat parameters (notify_via :telegram, :email)
- Evaluator subscribes to bus, fires PolicyViolation + RotationScheduled
  (rotate_immediately) or AlertRaised (notify_only/quarantine) when overdue
- 15 unit specs cover Policy.matches?/overdue?/in_warning_window?,
  Builder validation, DSL syntax with closures, evaluator action dispatch
2026-04-29 00:56:29 -04:00
..
.gitkeep feat(cre): source tree skeleton with empty module dirs and CI workflow 2026-04-28 23:54:59 -04:00
builder_spec.cr feat(policy): Crystal Policy as Code DSL with macros + compile-time enum autocast 2026-04-29 00:56:29 -04:00
dsl_spec.cr feat(policy): Crystal Policy as Code DSL with macros + compile-time enum autocast 2026-04-29 00:56:29 -04:00
evaluator_spec.cr feat(policy): Crystal Policy as Code DSL with macros + compile-time enum autocast 2026-04-29 00:56:29 -04:00
policy_spec.cr feat(policy): Crystal Policy as Code DSL with macros + compile-time enum autocast 2026-04-29 00:56:29 -04:00