Skip to content

JSON Schema: HTTP Filter schemas#405

Merged
ccaraman merged 9 commits intomasterfrom
http-filter-schemas
Feb 1, 2017
Merged

JSON Schema: HTTP Filter schemas#405
ccaraman merged 9 commits intomasterfrom
http-filter-schemas

Conversation

@ccaraman
Copy link
Copy Markdown
Contributor

@ccaraman ccaraman commented Feb 1, 2017

-Breaks http configs into h/cc
-Increases tests coverage for http configs by adding server/config/http/config_test.cc
-Adds schema validation for applicable HTTP filters.
-Updates Fault Filter documentation to specify at least abort or delay must be specified in the config. The implementation has been updated to reflect expected behaviour.
-Added empty() method on JSON Objects.

@ccaraman
Copy link
Copy Markdown
Contributor Author

ccaraman commented Feb 1, 2017

@lyft/network-team @rshriram

@ccaraman ccaraman force-pushed the http-filter-schemas branch from 4049585 to 35dc4a4 Compare February 1, 2017 20:25
Copy link
Copy Markdown
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.

so awesome, just a small comment.

const Json::ObjectPtr& abort = json_config.getObject("abort");
json_config.validateSchema(Json::Schema::FAULT_HTTP_FILTER_SCHEMA);

const Json::ObjectPtr& abort = json_config.getObject("abort", true);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no reference here and next line (you are storing reference to temporary).

const std::string& stats_prefix,
Server::Instance& server) {
if (type != HttpFilterType::Decoder || name != "buffer") {
return nullptr;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

silly question: is the name check necessary here? Is there a possibility that the code that instantiates filters calls this factory method without matching the name?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If so, shouldn't every filter be checking the name?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

actually, I take it back.. Everything is checking for the name.

const std::string& stat_prefix,
Server::Instance& server) {
if (type != HttpFilterType::Both || name != "http_dynamo_filter") {
return nullptr;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this pattern is needed, then I think fault and rate limit are missing the name checks.

Copy link
Copy Markdown
Contributor Author

@ccaraman ccaraman Feb 1, 2017

Choose a reason for hiding this comment

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

They are checked in config/http/(fault.cc/ratelimit.cc)

@ccaraman ccaraman merged commit 62b3edd into master Feb 1, 2017
@ccaraman ccaraman deleted the http-filter-schemas branch February 1, 2017 22:01
PiotrSikora pushed a commit to PiotrSikora/envoy that referenced this pull request Feb 24, 2020
envoyproxy#405)

non-reentrant).

Signed-off-by: John Plevyak <jplevyak@gmail.com>
PiotrSikora pushed a commit to istio/envoy that referenced this pull request Feb 24, 2020
envoyproxy#405)

non-reentrant).

Signed-off-by: John Plevyak <jplevyak@gmail.com>
bianpengyuan pushed a commit to istio/envoy that referenced this pull request Feb 24, 2020
* Move proxy_on_delete() call out of proxy_done() call from the VM (make (envoyproxy#405)

non-reentrant).

Signed-off-by: John Plevyak <jplevyak@gmail.com>

* Simplify Wasm shutdown. (envoyproxy#410)

Signed-off-by: John Plevyak <jplevyak@gmail.com>

Co-authored-by: John Plevyak <jplevyak@gmail.com>
wolfguoliang pushed a commit to wolfguoliang/envoy that referenced this pull request Jan 23, 2021
…ward_proxy_filter.rst (envoyproxy#405)

* feat(dynamic_forward_proxy_filter): first draft

* fix(dynamic_forward_proxy_filter): revision

* fix(dynamic_forward_proxy_filter): compile problem

* fix(dynamic_forward_proxy_filter): compile problem

* fix(dynamic_forward_proxy_filter): improve coherence

Co-authored-by: 李景炤 <kinso@lijingzhaos-MacBook-Pro.local>
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Description: previously onError was not delivering the callback all the way to the platform. This PR wires functionality all the way and also converts envoy_error to EnvoyError.
Risk Level: med - implementing core functionality
Testing: built locally

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: previously onError was not delivering the callback all the way to the platform. This PR wires functionality all the way and also converts envoy_error to EnvoyError.
Risk Level: med - implementing core functionality
Testing: built locally

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
mathetake pushed a commit that referenced this pull request Mar 3, 2026
**Commit Message**
This fixes the OpenAI chat completion response choices conversion, there
could only be one choice as AWS Bedrock does not support N choices. The
previous code translated multiple content blocks to multiple choices
which was wrong and for converse response there could be only one text
block, however there can be multiple content blocks for text and
toolUse.

**Related Issues/PRs (if applicable)**
Fixes #405 

**Special notes for reviewers (if applicable)**

Tested with the real AWS Bedrock with converse response including both
text and toolUse content blocks.
This is an example of converse response and the previous code made wrong
assumption that it is in the same content block:
```json
{
  "message": {
    "role": "assistant",
    "content": [
      {
        "text": "To get the weather information for Queens, NY, I'll need to use the get_weather function. Let me fetch that information for you."
      },
      {
        "toolUse": {
          "toolUseId": "tooluse_qYVb7Vo1QpWkmbgCm1VTZg",
          "name": "get_weather",
          "input": {
            "city": "Queens",
            "state": "NY"
          }
        }
      }
    ]
  }
}
```

---------

Signed-off-by: Dan Sun <dsun20@bloomberg.net>
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.

3 participants