Back to Opa

internal-entrypoint

docs/projects/regal/rules/bugs/internal-entrypoint.md

1.16.11.4 KB
Original Source

internal-entrypoint

Summary: Entrypoint can't be marked internal

Category: Bugs

Avoid

rego
package policy

# METADATA
# entrypoint: true
_authorized if {
    # some conditions
}

Prefer

rego
package policy

# METADATA
# entrypoint: true
allow if _authorized

_authorized if {
    # some conditions
}

Rationale

Rules marked as internal using the underscore prefix convention cannot be used as entrypoints, as entrypoints by definition are public. Either rename the rule to mark it as public, or use another public rule as an entrypoint, which may reference the internal rule.

Configuration Options

This linter rule provides the following configuration options:

yaml
rules:
  bugs:
    internal-entrypoint:
      # one of "error", "warning", "ignore"
      level: error