From 84ff1eeecb056333d04b838fa10df7efd894c23b Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 23:14:55 +0000 Subject: [PATCH] HTTP Basic Auth filter (#30079) Signed-off-by: Huabing Zhao Mirrored from https://github.com/envoyproxy/envoy @ 72a247090789f6a3b131d8cb6a93949449f2a3e3 --- BUILD | 1 + .../filters/http/basic_auth/v3/BUILD | 12 +++++++ .../http/basic_auth/v3/basic_auth.proto | 36 +++++++++++++++++++ versioning/BUILD | 1 + 4 files changed, 50 insertions(+) create mode 100644 envoy/extensions/filters/http/basic_auth/v3/BUILD create mode 100644 envoy/extensions/filters/http/basic_auth/v3/basic_auth.proto diff --git a/BUILD b/BUILD index 78b712f8..9ce02ee5 100644 --- a/BUILD +++ b/BUILD @@ -163,6 +163,7 @@ proto_library( "//envoy/extensions/filters/http/aws_lambda/v3:pkg", "//envoy/extensions/filters/http/aws_request_signing/v3:pkg", "//envoy/extensions/filters/http/bandwidth_limit/v3:pkg", + "//envoy/extensions/filters/http/basic_auth/v3:pkg", "//envoy/extensions/filters/http/buffer/v3:pkg", "//envoy/extensions/filters/http/cache/v3:pkg", "//envoy/extensions/filters/http/cdn_loop/v3:pkg", diff --git a/envoy/extensions/filters/http/basic_auth/v3/BUILD b/envoy/extensions/filters/http/basic_auth/v3/BUILD new file mode 100644 index 00000000..1c1a6f6b --- /dev/null +++ b/envoy/extensions/filters/http/basic_auth/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/core/v3:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/envoy/extensions/filters/http/basic_auth/v3/basic_auth.proto b/envoy/extensions/filters/http/basic_auth/v3/basic_auth.proto new file mode 100644 index 00000000..df23868a --- /dev/null +++ b/envoy/extensions/filters/http/basic_auth/v3/basic_auth.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package envoy.extensions.filters.http.basic_auth.v3; + +import "envoy/config/core/v3/base.proto"; + +import "udpa/annotations/sensitive.proto"; +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.filters.http.basic_auth.v3"; +option java_outer_classname = "BasicAuthProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/basic_auth/v3;basic_authv3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Basic Auth] +// Basic Auth :ref:`configuration overview `. +// [#extension: envoy.filters.http.basic_auth] + +// Basic HTTP authentication. +// +// Example: +// +// .. code-block:: yaml +// +// users: +// inline_string: |- +// user1:{SHA}hashed_user1_password +// user2:{SHA}hashed_user2_password +// +message BasicAuth { + // Username-password pairs used to verify user credentials in the "Authorization" header. + // The value needs to be the htpasswd format. + // Reference to https://httpd.apache.org/docs/2.4/programs/htpasswd.html + config.core.v3.DataSource users = 1 [(udpa.annotations.sensitive) = true]; +} diff --git a/versioning/BUILD b/versioning/BUILD index 4e89b020..fe64655d 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -101,6 +101,7 @@ proto_library( "//envoy/extensions/filters/http/aws_lambda/v3:pkg", "//envoy/extensions/filters/http/aws_request_signing/v3:pkg", "//envoy/extensions/filters/http/bandwidth_limit/v3:pkg", + "//envoy/extensions/filters/http/basic_auth/v3:pkg", "//envoy/extensions/filters/http/buffer/v3:pkg", "//envoy/extensions/filters/http/cache/v3:pkg", "//envoy/extensions/filters/http/cdn_loop/v3:pkg",