istio-ecosystem / authservice

Move OIDC token acquisition out of your app code and into the Istio mesh
Apache License 2.0
217 stars 63 forks source link

Add a new filter type: "mock" #139

Closed ipuustin closed 3 years ago

ipuustin commented 3 years ago

Add a "mock" filter type. The filter approves or denies requests based on configuration value. The benefit of this is twofold:

  1. Allow AuthService to run without OIDC providers. This can be needed if the AuthService configuration is dynamically constructed and may sometimes be without any OIDC chains.
  2. Allow testing of external authorization logic in the cluster without having to introduce and configure OIDC providers.

Also, this helps to keep the filter abstraction in working shape by preventing configuration validation etc. getting tied to OIDC.

istio-testing commented 3 years ago

@Shikugawa: changing LGTM is restricted to collaborators

In response to [this](https://github.com/istio-ecosystem/authservice/pull/139#pullrequestreview-619832510): >Thanks! It generally LGTM but `simple` name is ambiguous a bit. Could you rename it? I think `mock` should be better. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
ipuustin commented 3 years ago

@Shikugawa thanks for the review! I implemented the changes you requested.

Shikugawa commented 3 years ago

@ipuustin LGTM. Could you rewrite PR title and description into Add a new filter type: "mock"?

Shikugawa commented 3 years ago

/approve

Shikugawa commented 3 years ago

ping @lizan

istio-testing commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ipuustin, lizan, Shikugawa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/istio-ecosystem/authservice/blob/master/OWNERS)~~ [lizan] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment