# yaml-language-server: $schema=https://api.cerbos.dev/latest/cerbos/policy/v1/TestSuite.schema.json
---
resources:
  hfa_track:
    id: hfa_track
    kind: track

name: HfaTrackTestSuite
description: Tests for the track resource policy and machine principal policy for HFA actions
tests:
  - name: lambda-populate-hfa-pending-request can view:hfa on track resources
    input:
      principals:
        - lambda-populate-hfa-pending-request
        - some_hacker
      resources:
        - hfa_track
      actions:
        - view:hfa
    expected:
      - principal: lambda-populate-hfa-pending-request
        resource: hfa_track
        actions:
          view:hfa: EFFECT_ALLOW
      - principal: some_hacker
        resource: hfa_track
        actions:
          view:hfa: EFFECT_DENY

  - name: ows-product-integration-test can view:hfa on track resources
    input:
      principals:
        - ows-product-integration-test
        - some_hacker
      resources:
        - hfa_track
      actions:
        - view:hfa
    expected:
      - principal: ows-product-integration-test
        resource: hfa_track
        actions:
          view:hfa: EFFECT_ALLOW
      - principal: some_hacker
        resource: hfa_track
        actions:
          view:hfa: EFFECT_DENY
