Skip to content

Rate Limit Configuration: Header value match action#526

Merged
ccaraman merged 10 commits intomasterfrom
header-value-action
Mar 3, 2017
Merged

Rate Limit Configuration: Header value match action#526
ccaraman merged 10 commits intomasterfrom
header-value-action

Conversation

@ccaraman
Copy link
Contributor

@ccaraman ccaraman commented Mar 2, 2017

  • Move ConfigUtility into its own config_utility.h/cc.
  • Add Header Value Match Action that allows for a rate limit descriptor to be sent if a request matches a set of header values specified in the config.
  • Create base class Json::JsonValidator for classes to inherit from when they want to validate a config schema prior to initializing member variables.

@ccaraman
Copy link
Contributor Author

ccaraman commented Mar 2, 2017

@lyft/network-team

* ("header_match", "<descriptor_value>")


.. _config_http_conn_man_route_table_rate_limit_headers:
Copy link
Member

Choose a reason for hiding this comment

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

I think we now have this text in potentially 3 places in the docs. Can we de-dup this and just link to it from all 3 places?

"enum" : ["header_value_match"]
},
"descriptor_value" : {"type" : "string"},
"headers" : {
Copy link
Member

Choose a reason for hiding this comment

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

This is also duplicated several times now. Can we de-dup and do a sub-schema check in the ConfigUtility code?

@@ -0,0 +1,40 @@
#include "config_utility.h"
Copy link
Member

Choose a reason for hiding this comment

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

Did you change any code in config_utility or is it just copy/paste to a new file without any changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy Paste

Copy link
Member

Choose a reason for hiding this comment

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

OK not a big deal but in the future I would do a separate code move PR, just easier to review.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

looks good other than small de-dup comments


class JsonValidator {
public:
/*
Copy link
Member

Choose a reason for hiding this comment

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

nit: move this comment to class level, you are also missing a '*' in the comment opening.

HeaderData(const Http::LowerCaseString& name, const std::string& value, const bool is_regex)
: name_(name), value_(value), regex_pattern_(value_, std::regex::optimize),
is_regex_(is_regex) {}
struct HeaderData : public Json::JsonValidator {
Copy link
Member

Choose a reason for hiding this comment

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

nit: public inheritance not needed


descriptor_value
*(required, string)* The value to use in the descriptor entry.
:ref:`headers<config_http_conn_man_route_table_route_headers>`
Copy link
Member

Choose a reason for hiding this comment

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

nit: newline before this line

@ccaraman ccaraman merged commit 5e5c7ff into master Mar 3, 2017
@ccaraman ccaraman deleted the header-value-action branch March 3, 2017 21:37
tschroed pushed a commit to tschroed/envoy that referenced this pull request Apr 10, 2017
lizan pushed a commit to lizan/envoy that referenced this pull request Jun 4, 2020
Signed-off-by: John Plevyak <jplevyak@gmail.com>
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Description: when the server pointer was moved from being captured in the post init callback to outside of it https://github.com/lyft/envoy-mobile/pull/498/files#diff-b5c0c85b8d3df6960fe582b70fe1c122L112 to https://github.com/lyft/envoy-mobile/pull/498/files#diff-79839c4e6bee0a2fa78e0f8215db7433R64 we introduced the possibility that the captured pointer pointer to an invalid memory address. This PR returns the server capture to inside the callback.
Risk Level: med - moving pointer captures from synchronous to inside the event loop

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Description: when the server pointer was moved from being captured in the post init callback to outside of it https://github.com/lyft/envoy-mobile/pull/498/files#diff-b5c0c85b8d3df6960fe582b70fe1c122L112 to https://github.com/lyft/envoy-mobile/pull/498/files#diff-79839c4e6bee0a2fa78e0f8215db7433R64 we introduced the possibility that the captured pointer pointer to an invalid memory address. This PR returns the server capture to inside the callback.
Risk Level: med - moving pointer captures from synchronous to inside the event loop

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
mathetake added a commit that referenced this pull request Mar 3, 2026
**Commit Message**

This adds a basic documentation about `aigw` CLi recently implemented
merged.

**Related Issues/PRs (if applicable)**

Closes #412

---------

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants