Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit policy behavior #60

Open
flavio opened this issue Jan 9, 2025 · 0 comments
Open

Revisit policy behavior #60

flavio opened this issue Jan 9, 2025 · 0 comments
Labels
kind/enhancement New feature or request
Milestone

Comments

@flavio
Copy link
Member

flavio commented Jan 9, 2025

As discussed with the other maintainers, this policy is a bit confusing. We're going to change drastically its behavior to make things more obvious to our end users.

Renaming actions

anyIn -> containsAnyOf

Given these setting: [a, b]

input outcome
a true
b true
a,b true
a,b,c true
c false
a, c true
b, c true
empty false

anyNotIn -> doesNotContainAnyOf

Given these setting: [a, b]

input outcome
a false
b false
a,b false
a,b,c false
c true
a, c false
b, c false
empty true

allAreUsed -> containsAllOf

Given these setting: [a, b]

input outcome
a false
b false
a,b true
a,b,c true
c false
a, c false
b, c false
empty false

notAllAreUsed -> doesNotContainAllOf

Given these setting: [a, b]

input outcome
a true
b true
a,b false
a,b,c false
c true
a, c true
b, c true
empty true

true means the request is valid

Looking at the truth tables above:

  • true: the request is accepted because it's valid
  • false: the request is rejected because it's not valid

Env variable value is no longer relevant

The policy is not going to look at the value of an environment variable. It focuses only of the name of the environment variable.

New settings syntax

The settings of the policy are changed to be like that:

settings:
  # only one directive can be set
  # for more complex logic you can use a Policy Group and
  # combine multiple instances of this policy using the logical
  # operators of your choice

  # containsAnyOf: []
  # doesNotContainAnyOf: []
  # doesNotContainAllOf: []

  containsAllOf:
  - MARIADB_USER
  - MARIADB_PASSWORD 
@flavio flavio added this to Kubewarden Jan 9, 2025
@flavio flavio added this to the 1.21 milestone Jan 9, 2025
@flavio flavio added the kind/enhancement New feature or request label Jan 9, 2025
@kkaempf kkaempf modified the milestones: 1.21, 1.22 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants