-
Notifications
You must be signed in to change notification settings - Fork 20
Added more resilience on update policies. #672
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexander Cristurean <[email protected]>
Signed-off-by: Alexander Cristurean <[email protected]>
Signed-off-by: Alexander Cristurean <[email protected]>
Signed-off-by: Alexander Cristurean <[email protected]>
import pytest | ||
|
||
pytestmark = [pytest.mark.authorino] | ||
|
||
logger = logging.getLogger(__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the logging for here?
authorization.identity.add_anonymous("anonymous") | ||
authorization.wait_for_ready() | ||
authorization.wait_until(has_observed_generation(generation + 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still need the wait_for_ready
as just waiting for Authorino to pick up the the AuthPolicy is not enough. The observedGeneration can be incremented but the Policy can be in status "Not Enforced". wait_for_ready
makes sure the Policy is also "Enforced"
authorization.identity.add_anonymous("anonymous") | ||
authorization.wait_for_ready() | ||
authorization.wait_until(has_observed_generation(generation + 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put the wait for generation == observedGeneration
inside wait_for_ready
in class Policy
as it conceptually fits there.
Added check function that will assert the generation has been incremented before confirming it the policy enforcement.