feat: api for credential injector http filter#27769
feat: api for credential injector http filter#27769adisuissa merged 21 commits intoenvoyproxy:mainfrom
Conversation
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
91faebe to
3a6f1fe
Compare
cb5ad8a to
3638f5e
Compare
api/envoy/extensions/filters/http/credential_injector/v3alpha/credential_injector.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/filters/http/credential_injector/v3alpha/credential_injector.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/filters/http/credential_injector/v3alpha/credential_injector.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/filters/http/credential_injector/v3alpha/credential_injector.proto
Outdated
Show resolved
Hide resolved
|
Need help here. Precheck protobuf failed but the log doesn't give explicit reasons. |
2b04b1b to
52ba2f7
Compare
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Outdated
Show resolved
Hide resolved
be739c8 to
e6edf1d
Compare
|
ping @lizan on api |
kyessenov
left a comment
There was a problem hiding this comment.
Looks fine to me. Need API reviewers feedback.
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Outdated
Show resolved
Hide resolved
lizan
left a comment
There was a problem hiding this comment.
This is in good direction, do you have a draft for the implementation so I can refer for those API?
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Outdated
Show resolved
Hide resolved
|
Yes, we do have a draft implementation internally, but the API is a bit different than this one and the functionality has not been fully finished yet. If it's needed, I can create another pr in draft. @lizan
…On Sat, Jun 17, 2023, 00:58 Lizan Zhou ***@***.***> wrote:
***@***.**** commented on this pull request.
This is in good direction, do you have a draft for the implementation so I
can refer for those API?
—
Reply to this email directly, view it on GitHub
<#27769 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKCWISORBCLCBRMLGLUKYLXLSGFDANCNFSM6AAAAAAYX76XOQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
A matcher might be useful but it's not blocking since even the credentials
are added to every outgoing requests, it won't be any problems.
…On Sat, Jun 17, 2023, 10:57 Vikas Choudhary (vikasc) < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
<#27769 (comment)>:
> +import "validate/validate.proto";
+
+option java_package = "io.envoyproxy.envoy.extensions.filters.http.credential_injector.v3";
+option java_outer_classname = "CredentialInjectorProto";
+option java_multiple_files = true;
+option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/credential_injector/v3;credential_injectorv3";
+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]
+
+// Filter config.
+message CredentialInjector {
Hi @zhaohuabing <https://github.com/zhaohuabing> , should we support
matcher as well so that filter can inject credentials only the matched
requests?
—
Reply to this email directly, view it on GitHub
<#27769 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKCWIVVZ6PYKCNKREGW6QLXLUMJRANCNFSM6AAAAAAYX76XOQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
@lizan I moved the shared code from those extensions into the common directory to reduce redundancy. Does this address your concern? |
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
|
I agree with @adisuissa's suggestion, this patch is huge and it would be better to split it to multiple different parts. Then we do more reasonable review. And compared to implementation, we should try to figure out a final conclusion of the API first. Seems the discussion about the API has not ended. |
|
/wait-any |
@wbpcode @adisuissa Thanks for your suggestion. We have already agreed on the APIs before I push implementations into this PR, please see the above discussion on the APIs. If this is too big for review, I can split this into multiple PRs. This one is just for APIs, and Filter and Extensions implementation will be in follow-up PRs. |
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
api/envoy/extensions/credentials/basic_auth/v3/basic_auth.proto
Outdated
Show resolved
Hide resolved
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
adisuissa
left a comment
There was a problem hiding this comment.
I think the directory name is confusing, as these are only credentials that are injected (not being fetched IIUC). Please change the directory name from api/envoy/extensions/credentials/ to api/envoy/extensions/injected_credentials/
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Outdated
Show resolved
Hide resolved
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Show resolved
Hide resolved
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
|
/docs |
|
Docs for this Pull Request will be rendered here: https://storage.googleapis.com/envoy-pr/27769/docs/index.html The docs are (re-)rendered each time the CI |
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
|
/wait-any |
adisuissa
left a comment
There was a problem hiding this comment.
Ok, LGTM API. We can reiterate over the details as these are WIP.
Thanks!
/lgtm api
|
Thank guys for reviewing the PR and the help on the API! Need your last help. How can I fix this to get this PR merged? I already added a new As you suggested, the implementation of the credential injector and the generic credential extension will be in a follow-up PR soo after this PR gets merged. |
api/envoy/extensions/filters/http/credential_injector/v3/credential_injector.proto
Outdated
Show resolved
Hide resolved
Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
API for the credential injector HTTP filter.
Note: based on feedback in the comments, the original PR has been split into multiple PRs, this one only contains APIs so it would be easier to review. The implementations of the Credential Injector Filter and Extensions will be in follow-up PRs.
Commit Message: add API for the credential injector HTTP filter.
Additional Description:
The credential injector HTTP filter serves the purpose of injecting credentials into outgoing HTTP requests. At present, the filter configuration is used to retrieve the credentials, or they can be requested through the OAuth2 client credential grant. Furthermore, it has the potential to support additional credential sources in the future, such as the OAuth2 resource owner password credentials grant , STS, etc. The credentials obtained are then injected into the Authorization header of the proxied HTTP requests, utilizing either the Basic or Bearer scheme.
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 workload). Please note that this filter does not handle end user authentication. Its purpose is solely to authenticate the workload itself.
Sponsor: @kyessenov kindly offered to be the sponsor of this new filter.
Risk Level: low
Testing: no, only APIs, testing will be in follow-up PRs with implementation.
Docs Changes: yes
Release Notes: no
Platform Specific Features: No
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]
generic, can be used to inject a custom credential in any specified header
basic auth, used to inject HTTP basic auth credential(username password)
bearer token, used to inject HTTP bearer token
oauth2, used to get token via oauth2 client credentials grant and inject it into the http header