Update context var/metadata values from config_data

Hi Folks,

I wanted to know if there is any possibility to append context variables or metadata using config_data via go plugin pre block.

Use case: There will be one api def having config_data e.g.

{
“dev”:{“target”:“abc”},
“stg”:{“target”:“xyz”}
}

And in api def I will use tyk context / tyk metadata variables from endpoint designer and other dev section

Best Regards,
Shebby

I don’t think it’s possible, since the context variables or meta data aren’t populated in the pre plugin middleware. You have a better chance of using policy metadata or adding them as temporary headers

What’s the goal? I see target, would that be target_url?

Are you using a URL rewrite middleware?

I see there is external KV for Target but, I wanted to know for config_data where I can use it as in middleware or in virtual endpoint I can use hardcoded json init then what is the use case for config_data.

Thanks,
Shebby

Well that docs related to secrets and config data isn’t one of the options available.

Off the top of my head, I can’t think of one where config data is used. There is a todo in URL middleware souce but it hasn’t been implemented

Within a plugin is is a typical implemtation stage of where config data is being used.

It’s extra configuration data that you want your APIs to have or hold.