|
|
|
@ -17,7 +17,6 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; |
|
|
|
|
option (xds.annotations.v3.file_status).work_in_progress = true; |
|
|
|
|
|
|
|
|
|
// [#protodoc-title: Credential Injector] |
|
|
|
|
// [#not-implemented-hide:] |
|
|
|
|
// Credential Injector :ref:`configuration overview <config_http_filters_credential_injector>`. |
|
|
|
|
// [#extension: envoy.filters.http.credential_injector] |
|
|
|
|
|
|
|
|
@ -25,7 +24,8 @@ option (xds.annotations.v3.file_status).work_in_progress = true; |
|
|
|
|
// they can be requested through the OAuth2 client credential grant. The credentials obtained are then injected into the Authorization header |
|
|
|
|
// of the proxied HTTP requests, utilizing either the Basic or Bearer scheme. |
|
|
|
|
// |
|
|
|
|
// If the credential is not present, the request will fail with 401 Unauthorized if fail_if_not_present is set to true. |
|
|
|
|
// If the credential is not present or there was a failure injecting the credential, the request will fail with ``401 Unauthorized`` unless |
|
|
|
|
// ``allow_request_without_credential`` is set to ``true``. |
|
|
|
|
// |
|
|
|
|
// Notice: This filter is intended to be used for workload authentication, which means that the identity associated with the inserted credential |
|
|
|
|
// is considered as the identity of the workload behind the envoy proxy(in this case, envoy is typically deployed as a sidecar alongside that |
|
|
|
@ -33,14 +33,13 @@ option (xds.annotations.v3.file_status).work_in_progress = true; |
|
|
|
|
// |
|
|
|
|
// Here is an example of CredentialInjector configuration with Generic credential, which injects an HTTP Basic Auth credential into the proxied requests. |
|
|
|
|
// |
|
|
|
|
// .. code-block:: yaml |
|
|
|
|
// .. code-block:: yaml |
|
|
|
|
// |
|
|
|
|
// overwrite: true |
|
|
|
|
// fail_if_not_present: true |
|
|
|
|
// credential: |
|
|
|
|
// name: generic_credential |
|
|
|
|
// typed_config: |
|
|
|
|
// "@type": type.googleapis.com/envoy.extensions.injected_credentials.generic.v3.Generic |
|
|
|
|
// "@type": type.googleapis.com/envoy.extensions.http.injected_credentials.generic.v3.Generic |
|
|
|
|
// credential: |
|
|
|
|
// name: credential |
|
|
|
|
// sds_config: |
|
|
|
@ -49,7 +48,8 @@ option (xds.annotations.v3.file_status).work_in_progress = true; |
|
|
|
|
// header: Authorization |
|
|
|
|
// |
|
|
|
|
// credential.yaml for Basic Auth: |
|
|
|
|
// .. code-block:: yaml |
|
|
|
|
// |
|
|
|
|
// .. code-block:: yaml |
|
|
|
|
// |
|
|
|
|
// resources: |
|
|
|
|
// - "@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.Secret" |
|
|
|
@ -59,8 +59,10 @@ option (xds.annotations.v3.file_status).work_in_progress = true; |
|
|
|
|
// inline_string: "Basic base64EncodedUsernamePassword" |
|
|
|
|
// |
|
|
|
|
// It can also be configured to inject a Bearer token into the proxied requests. |
|
|
|
|
// |
|
|
|
|
// credential.yaml for Bearer Token: |
|
|
|
|
// .. code-block:: yaml |
|
|
|
|
// |
|
|
|
|
// .. code-block:: yaml |
|
|
|
|
// |
|
|
|
|
// resources: |
|
|
|
|
// - "@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.Secret" |
|
|
|
@ -74,12 +76,15 @@ message CredentialInjector { |
|
|
|
|
// Value defaults to false. |
|
|
|
|
bool overwrite = 1; |
|
|
|
|
|
|
|
|
|
// Whether to fail the request if the credential is not present. |
|
|
|
|
// Value defaults to false. |
|
|
|
|
// If set to true, the request will fail with 401 Unauthorized if the credential is not present. |
|
|
|
|
bool fail_if_not_present = 2; |
|
|
|
|
// Whether to send the request to upstream if the credential is not present or if the credential injection |
|
|
|
|
// to the request fails. |
|
|
|
|
// |
|
|
|
|
// By default, a request will fail with ``401 Unauthorized`` if the |
|
|
|
|
// credential is not present or the injection of the credential to the request fails. |
|
|
|
|
// If set to true, the request will be sent to upstream without the credential. |
|
|
|
|
bool allow_request_without_credential = 2; |
|
|
|
|
|
|
|
|
|
// The credential to inject into the proxied requests |
|
|
|
|
// TODO add extension-category |
|
|
|
|
// [#extension-category: envoy.http.injected_credentials] |
|
|
|
|
config.core.v3.TypedExtensionConfig credential = 3 [(validate.rules).message = {required: true}]; |
|
|
|
|
} |
|
|
|
|