Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ProtoApiScrubber HTTP filter configuration proto #38155

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

sumitkmr2
Copy link

@sumitkmr2 sumitkmr2 commented Jan 23, 2025

Commit Message: Add ProtoApiScrubber HTTP filter configuration proto.
Additional Description: We are adding a new envoy filter for API filtering for the APIs which are backed by protobuf definitions. This is the first PR for the same which contains just the filter config. Subsequent PRs will include adding more fields to the filter config to support further usecases, filter runtime code, etc. The design doc for this filter is internally approved within Google.
Risk Level: NONE
Testing: NOT DONE. Will be done once the actual filter runtime code is added.
Docs Changes: NOT DONE.
Release Notes: NA. Will be added once the actual filter runtime code is added.
Platform Specific Features: NONE.
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Copy link

Hi @sumitkmr2, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #38155 was opened by sumitkmr2.

see: more, trace.

Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #38155 was opened by sumitkmr2.

see: more, trace.

Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @abeyad
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #38155 was opened by sumitkmr2.

see: more, trace.

Signed-off-by: Sumit Kumar <[email protected]>
Signed-off-by: Sumit Kumar <[email protected]>
Signed-off-by: Sumit Kumar <[email protected]>
@phlax
Copy link
Member

phlax commented Jan 23, 2025

/docs

Copy link

Docs for this Pull Request will be rendered here:

https://storage.googleapis.com/envoy-pr/38155/docs/index.html

The docs are (re-)rendered each time the CI envoy-presubmit (precheck docs) job completes.

🐱

Caused by: a #38155 (comment) was created by @phlax.

see: more, trace.

Signed-off-by: Sumit Kumar <[email protected]>
@sumitkmr2 sumitkmr2 marked this pull request as ready for review January 24, 2025 05:17
Signed-off-by: Sumit Kumar <[email protected]>
Signed-off-by: Sumit Kumar <[email protected]>
@dchakarwarti
Copy link
Contributor

Overall, Looks good to me.

Do you also plan to update the fields in commit message? I think it's safe to mention that the Design Document has been approved internally by the team at Google.

@sumitkmr2
Copy link
Author

Overall, Looks good to me.

Do you also plan to update the fields in commit message? I think it's safe to mention that the Design Document has been approved internally by the team at Google.

Thanks Divya! I have updated the commit message.

option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (xds.annotations.v3.file_status).work_in_progress = true;

// [#not-implemented-hide:]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sumitkmr2 i would like to review the docs here - i can see issues in the source - but kinda need it rendered

i think because of this its not currently rendering - could you temporarily disable it please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@phlax phlax self-assigned this Jan 24, 2025
@phlax
Copy link
Member

phlax commented Jan 24, 2025

docs build is failing with

Did you forget to add 'envoy.filters.http.proto_api_scrubber' to extensions_build_config.bzl, extensions_metadata.yaml, contrib_build_config.bzl, or contrib/extensions_metadata.yaml?

i think it needs to be setup correctly - wondering if there is an implementation - its not so common to add just an api without implementation

@sumitkmr2
Copy link
Author

docs build is failing with

Did you forget to add 'envoy.filters.http.proto_api_scrubber' to extensions_build_config.bzl, extensions_metadata.yaml, contrib_build_config.bzl, or contrib/extensions_metadata.yaml?

i think it needs to be setup correctly - wondering if there is an implementation - its not so common to add just an api without implementation

@phlax: Currently, we don't have the filter implementation ready however, it is planned to be completed in the coming ~2 months. This PR is to unblock other dependencies within Google which rely on the filter config proto. Please let me know if there are any concerns on that.

@phlax
Copy link
Member

phlax commented Jan 27, 2025

@sumitkmr2 i had a few concerns.

One is that the design doc has not been shared with Envoy maintainers - who are ultimately responsible for approving and then maintaining this.

The other concern is wrt docs - historically api docs that are added not-implemented-hide get landed without review, and then at a later date the switch gets flipped but the docs still dont get reviewed.

In this case I can see several ~nit issues - i can feedback some of those now - but its hard without seeing the page actually rendered.

There is also some higher level feedback - eg explanations of how the filter works (and examples) generally dont want to be in the API docs - we have a config reference section in the docs for that, so better to add docs there and link from here - another is to use yaml for end-user examples - this type of review is especially hard without rendering

I am reviewing our process with adding not-implemented-hide to see if i can figure a way to ensure docs can be reviewed as they are added

I am happy to land this but i think we need to ensure these points are followed up on - so probably we should add a ticket to track

@phlax
Copy link
Member

phlax commented Jan 27, 2025

cc @adisuissa

// }
// }
//
// Note that the fields `debug_info` and `book.debug_info` are filtered out from
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Note that the fields `debug_info` and `book.debug_info` are filtered out from
// Note that the fields ``debug_info`` and ``book.debug_info`` are filtered out from

// }
//
// Note that the fields `debug_info` and `book.debug_info` are filtered out from
// the response since the request entitlement of type "USER_TYPE" is PROD while
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// the response since the request entitlement of type "USER_TYPE" is PROD while
// the response since the request entitlement of type ``USER_TYPE`` is ``PROD`` while

//
// Note that the fields `debug_info` and `book.debug_info` are filtered out from
// the response since the request entitlement of type "USER_TYPE" is PROD while
// the restrictions on the fields `debug_info` and `book.debug_info` is DEV.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// the restrictions on the fields `debug_info` and `book.debug_info` is DEV.
// the restrictions on the fields ``debug_info`` and ``book.debug_info`` is ``DEV``.

// embedded in the ``Datasource.inline_bytes``.
config.core.v3.DataSource data_source = 1;

// Unimplemented, the key of proto descriptor TypedMetadata.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Unimplemented, the key of proto descriptor TypedMetadata.
// Unimplemented, the key of proto descriptor ``TypedMetadata``.

// Data sources for the request entitlements.
// Entitlements are matched with restrictions of the same name at runtime.
// Make sure that the entitlement source is present for each of the
// corresponding restrictions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// corresponding restrictions.
// corresponding restrictions:

Comment on lines +233 to +234
// Key - entitlement name
// Value - entitlement source
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Key - entitlement name
// Value - entitlement source
// - Key - entitlement name
// - Value - entitlement source

not sure if any/all of Key/Value/name/source are "literals" - if so they should be double backticked - im guessing its just name and source that are literals

Comment on lines +267 to +270
// Key - Fully qualified method name.
// - ``${package}.${Service}.${Method}``, like
// - ``endpoints.examples.bookstore.BookStore.GetShelf``
// Value - Method restrictions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not clear how this will render - but almost certainly not how you want/expect

Comment on lines +284 to +287
// Restrictions that apply to request fields of the method.
// Key - field mask like path of the field eg, foo.bar.baz
// Value - Restrictions map containing the mapping from restriction type to
// the restriction values.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Restrictions that apply to request fields of the method.
// Key - field mask like path of the field eg, foo.bar.baz
// Value - Restrictions map containing the mapping from restriction type to
// the restriction values.
// Restrictions that apply to request fields of the method:
// - Key - field mask like path of the field eg, ``foo.bar.baz``
// - Value - Restrictions map containing the mapping from restriction type to
// the restriction values.

with these - not sure if we want a list but currently this would all just render on one line

map<string, RestrictionMap> request_field_restrictions = 1;

// Restrictions that apply to response fields of the method.
// Key - field mask like path of the field eg, foo.bar.baz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@abeyad
Copy link
Contributor

abeyad commented Jan 27, 2025

@sumitkmr2 If the filter is only useful for a Google use case, does it make sense to implement it as a Google filter extension in the Google source repository instead of in open-source?

@alyssawilk
Copy link
Contributor

looks like this is waiting on PR author
/wait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants