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

Extending Route configuration #651

Open
nurhat opened this issue Oct 3, 2018 · 7 comments · May be fixed by #1183
Open

Extending Route configuration #651

nurhat opened this issue Oct 3, 2018 · 7 comments · May be fixed by #1183
Assignees
Labels
accepted Bug or feature would be accepted as a PR or is being worked on Configuration Ocelot feature: Configuration feature A new feature

Comments

@nurhat
Copy link

nurhat commented Oct 3, 2018

New Feature

We need a way to access the custom properties defined for Routes when using Ocelot configuration merge option.

Motivation for New Feature

When having multiple ocelot configuration files and using Ocelot configuration merge option, custom configurations defined for Routes are lost in the merged ocelot.json.

Steps to Reproduce the Problem

  1. Create a ocelot.xservices.json file
{
  "Routes": [ 
    {
      "DownstreamPathTemplate": "/xservice.svc/serviceMethodA/byNumber/{number}",
      "UpstreamPathTemplate": "/gw/serviceMethodA/byNumber/{number}",
      "UpstreamHttpMethod": [
        "Get",
        "Post"
      ],
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        {
          "Host": "host",
          "Port": 80
        }
      ],
      "CustomStrategyProperty": {
        "GET": [
          "SomeCustomStrategyMethodA" 
        ],
      "POST": [ 
          "SomeCustomeStrategyMethodB"
        ]
      }
    },
  ]
}
  1. Create a ocelot.yservices.json file
  2. Use AddOcelot to merge configurations and create ocelot.json config file
  3. The merged file created at the root directory, and ocelot.json does not contain custom property (e.g. "CustomerStrategyProperty") added to any Route item.

Specifications

  • Version: 12.0.1 - 19.0.2, latest
@TomPallister
Copy link
Member

@nurhat this isn't something I intend to change at the moment, however happy to accept a PR :)

I will keep the issue open!

@TomPallister TomPallister added feature A new feature help wanted Not actively being worked on. If you plan to contribute, please drop a note. medium effort Likely a few days of development effort labels Oct 7, 2018
jlukawska added a commit to jlukawska/Ocelot that referenced this issue Apr 1, 2020
jlukawska added a commit to jlukawska/Ocelot that referenced this issue Apr 7, 2020
jlukawska added a commit to jlukawska/Ocelot that referenced this issue Apr 7, 2020
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Jul 26, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Jul 26, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Jul 26, 2023
@raman-m raman-m changed the title Extending ReRoute Configuration Extending Route configuration Jul 26, 2023
@raman-m raman-m added accepted Bug or feature would be accepted as a PR or is being worked on and removed help wanted Not actively being worked on. If you plan to contribute, please drop a note. medium effort Likely a few days of development effort labels Jul 26, 2023
@raman-m
Copy link
Member

raman-m commented Jul 26, 2023

@nurhat Congratulations! 🎉
Your issue has been accepted due to the creation of a great PR #1183 by @jlukawska 😺

@raman-m
Copy link
Member

raman-m commented Jul 26, 2023

@TomPallister commented on Oct 7, 2018:

@nurhat this isn't something I intend to change at the moment, however happy to accept a PR :)
I will keep the issue open!

It is accepted twice! 😉
God blesses you, because you have been keeping the issue open these 5 years! 🤣
We have some progress nowadays in 2023... 😊

@raman-m
Copy link
Member

raman-m commented Aug 3, 2023

@nurhat commented on Oct 3, 2018:

The merged file created at the root directory, and ocelot.json does not contain custom property (e.g. "CustomerStrategyProperty") added to any Route item.

🆗 Imagine you have this property in some route.
What's next? How are you going to reuse this custom property in current implementations?

I see one possible user scenario, when you would like to create custom solution by custom concreate implementations of current interfaces, and add these concrete objects to DI-container and then reuse these concrete objects in your custom classes.
Am I right?

But, I'm still curious... Could you show your user scenario?
Could you write an example when you will use custom JSON-property of a route object?

That will be very interesting challenge! 😉
Good luck!

raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Oct 12, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Oct 12, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Oct 12, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Oct 28, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Oct 28, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Oct 28, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 1, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 1, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 1, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 2, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 2, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 2, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 4, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 4, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 4, 2023
@raman-m raman-m self-assigned this Nov 10, 2023
@raman-m raman-m added the Oct'23 label Nov 10, 2023
@raman-m
Copy link
Member

raman-m commented Nov 11, 2023

Hey @nurhat !
Are you still with Ocelot?

@raman-m raman-m added this to the October'23 milestone Nov 18, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 22, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 22, 2023
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 22, 2023
@raman-m raman-m added Nov'23 November 2023 release and removed Oct'23 labels Nov 24, 2023
@raman-m raman-m modified the milestones: October'23, November'23 Nov 24, 2023
@raman-m raman-m added 2023 Annual 2023 release and removed Nov'23 November 2023 release labels Dec 14, 2023
@raman-m raman-m modified the milestones: November'23, December'23 Dec 14, 2023
@raman-m raman-m removed the 2023 Annual 2023 release label Mar 5, 2024
@raman-m raman-m removed this from the Annual 2023 milestone Mar 5, 2024
@raman-m
Copy link
Member

raman-m commented Nov 11, 2024

Hi @guerinsylvain!
Are you @nurhat ? 🤣
Do you know @nurhat? 😄

@raman-m
Copy link
Member

raman-m commented Nov 11, 2024

Dear @nurhat,
The functionality you requested is already in place as the Metadata feature, introduced by PR #1843 (refer to commit 573a9d9) and included in release 23.3.0. However, we utilize a different concept inspired by MS Reverse Proxy metadata.
The same, in Ocelot all extended properties are stored within the Metadata property →

public IDictionary<string, string> Metadata { get; set; }

Your feature request is somewhat unique, and in light of the ongoing PR #1183, we aim to accommodate it.

@raman-m raman-m added the Configuration Ocelot feature: Configuration label Nov 11, 2024
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 11, 2024
raman-m pushed a commit to jlukawska/Ocelot that referenced this issue Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Bug or feature would be accepted as a PR or is being worked on Configuration Ocelot feature: Configuration feature A new feature
Projects
None yet
3 participants