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

Authpolicy/v1beta3 #924

Merged
merged 10 commits into from
Oct 22, 2024
Merged

Authpolicy/v1beta3 #924

merged 10 commits into from
Oct 22, 2024

Conversation

Boomatang
Copy link
Contributor

@Boomatang Boomatang commented Oct 9, 2024

Closes: #809

This change introduces the AuthPolicy v1beta3.

The RouteSelector has being removed from the API. There is still work required to bring in the Section Name to the API.

In the Docs only the reference to the RouteSelector has being removed from the reference sections. The guides have not being updated to use v1betat3. I expect this to happen with or shortly after the adding of the Section Name.

A number of integration test have been removed which depend on or directly tested the behavior around the RouteSelector.

@Boomatang Boomatang added size/large area/api Changes user facing APIs labels Oct 9, 2024
@Boomatang Boomatang self-assigned this Oct 9, 2024
@Boomatang Boomatang force-pushed the authpolicy/v1beta3 branch 2 times, most recently from 8517495 to 14e4762 Compare October 9, 2024 14:32
Copy link
Contributor

@guicassolato guicassolato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also delete api/v1beta2/route_selectors.go?

// GetRulesHostnames
// in v1beta2 this returned the list of route selectors
// in v1beta3 this should work with section name, once implemented.
func (ap *AuthPolicy) GetRulesHostnames() []string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything left that still depends on this? Maybe it's required to fully implement some interface by the actual method is no longer being used? (I didn't check.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to dig a bit more into this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be there to implement an interface

Copy link
Contributor

@KevFan KevFan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good generally but I think there's some changes missing 🧑‍💻

Can we also update the api version of the guides where an AuthPolicy is used as it's now using the wrong api version?

Can we rename and update the authpolicy v1beta2 sample to v1beta3 so that the example is still shown in the generated csv?

@Boomatang
Copy link
Contributor Author

@KevFan The sample authpolicy that I can update no problem.

I don't feel updating the guides right now is the best thing to do right now. These guides will need to be again updated when the section name is introduced. I had the intentional decision not to update guides till we had the section name in place.

@Boomatang
Copy link
Contributor Author

Can we also delete api/v1beta2/route_selectors.go?

@guicassolato yes, I had it remove and reintroduced it when trying to fix test. I most have forgotten to remove it afterwards. It was never meant to make it into this PR.

@Boomatang Boomatang force-pushed the authpolicy/v1beta3 branch 3 times, most recently from 01d0322 to 1ac1104 Compare October 18, 2024 12:49
Copy link
Contributor

@KevFan KevFan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall 👍 Left 2 comments 🧑‍💻

controllers/orphaned_dnsrecord_reconciler.go Outdated Show resolved Hide resolved
@@ -57,24 +54,10 @@ type AuthSchemeSpec struct {
// Callback functions.
// Authorino sends callbacks at the end of the auth pipeline to the endpoints specified in this config.
// +optional
// +kubebuilder:validation:MaxProperties=10
Callbacks map[string]CallbackSpec `json:"callbacks,omitempty"`
}

type CommonAuthRuleSpec struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we remove this type too maybe? If we do, then types such as AuthenticationSpec, MetadataSpec, etc, can all go away, and get back to using directly their Authorino counterparts.

If you say too much would break in the current controllers and/or tests, never mind then. Rather, let's leave as-is. It won't matter too much anyway, since soon the entire reconciliation of AuthPolicies v1beta3 is about to be refactored (and the policy type itself by extension). I only mentioned in case it can help make the refactor cleaner later on, but it's your call.

@guicassolato
Copy link
Contributor

The guides have not being updated to use v1betat3. I expect this to happen with or shortly after the adding of the Section Name.

Maybe I'm being naive here, but with this PR (unlike #875), we should be able to "just" sed s/v1beta2/v1beta3/g across all md files and docs would be done, no? Personally, I wouldn't wait for sectionName thing to do that if it turns out to be indeed that easy. This way, we have functioning docs from day 1, and section name can be only about adding stuff.

First pass at adding v1beta3.
This is not expected to compile.

Signed-off-by: Jim Fitzpatrick <[email protected]>
Signed-off-by: Jim Fitzpatrick <[email protected]>
Remove the reference to the RouteSelector from the reference docs.

Signed-off-by: Jim Fitzpatrick <[email protected]>
Signed-off-by: Jim Fitzpatrick <[email protected]>
Signed-off-by: Jim Fitzpatrick <[email protected]>
Signed-off-by: Jim Fitzpatrick <[email protected]>
Signed-off-by: Jim Fitzpatrick <[email protected]>
Signed-off-by: Jim Fitzpatrick <[email protected]>
@Boomatang
Copy link
Contributor Author

@guicassolato using sed would be the fastest way to do this, but there is reference to the route selectors in the guides. So it is not just a matter of doing a find and replace. I will work on that refactor now. That said I think we can merge the current changes without the docs update.

Copy link
Contributor

@KevFan KevFan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@guicassolato
Copy link
Contributor

@guicassolato using sed would be the fastest way to do this, but there is reference to the route selectors in the guides. So it is not just a matter of doing a find and replace. I will work on that refactor now. That said I think we can merge the current changes without the docs update.

No problem, @Boomatang. If you prefer this way, I'm OK with it.

Let's just make sure we don't cut a release of the Operator before fixing those references in the docs. Especially if the route selectors are mentioned, then IMO it's imperative that we remove them as soon as possible.

cc @maleck13

@Boomatang Boomatang merged commit d981b16 into Kuadrant:main Oct 22, 2024
24 checks passed
@Boomatang Boomatang deleted the authpolicy/v1beta3 branch October 22, 2024 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Changes user facing APIs size/large
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

AuthPolicy v1beta3
3 participants