Skip to content

TokenReview.authentication.k8s.io resource helpers for Wehbook Server #1436

Closed
@christopherhein

Description

@christopherhein

Would Controller Runtime be interested in being able to support non-AdmissionReview based HTTP handlers in the Webhook server package. I'm thinking of resources like authentication.k8s.io.TokenReview imagepolicy.k8s.io.ImageReview.

EG if I could use:

mgr.GetWebhookServer().Register("/tokenreview", &authentication.Webhook{Handler: &wh.TokenReview{}})

And it would then have something like:

import "k8s.io/api/authentication/v1"
// ...
type Request struct {
  v1.TokenReview
}

and my Handler func could be:

func (a *TokenReview) Handle(ctx context.Context, req authentication.Request) authentication.Response {
  // ... implement authentication request
  return authentication.Response{}
}

This would help to standardize the building of ImageReviews and TokenReviews for code bases like https://sigs.k8s.io/aws-iam-authenticator where it's currently just a normal go HTTP server implementation and where you need to add controllers (when we did) we just used client-go directly and we could have used CR easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions