Skip to main content

deprecated-builtin

Summary: Constant condition

Category: Bugs

Avoid

package policy

import future.keywords.if

# call to deprecated `any` built-in function
allow if any([input.user.is_admin, input.user.is_root])

Prefer

package policy

import future.keywords.if

allow if input.user.is_admin
allow if input.user.is_root

Rationale

Calling deprecated built-in functions should always be avoided, and replacing them is usually trivial. Refer to the OPA docs on strict mode for more details on which built-in functions counts as deprecated.

Configuration Options

This linter rule provides the following configuration options:

rules:
bugs:
deprecated-builtin:
# one of "error", "warning", "ignore"
level: error

Community

If you think you've found a problem with this rule or its documentation, would like to suggest improvements, new rules, or just talk about Regal in general, please join us in the #regal channel in the Styra Community Slack!