Global Headers

Feature Request
Ability to have global headers sent in every request inside a workspace.
Example: I know all endpoints to a certain host require a couple headers, e.g. a bypass-bot-protection flag or an API key. I'd like those to be automatically sent instead of needing to add to every request.
Values can be like other request fields - text or Environment variable.
Seconded on this one. Being able to set this at a global level is pretty important for my workflow.
I’d love to attempt building a plugin for this, but I have so much on my plate.
and i haven’t seen any documentation on what Yaak values are exposed to us for a plugin .
However Global Headers are a total must
I’m curious how others are finding Yaak feasible to use without this feature. Is there something I’m missing? Even our small API has a couple dozen endpoints so far, and setting auth headers on each one is not something I’m going to tell my colleagues to do, as much as I’d love to recommend Yaak.
I was able to make a (very rough) proof of concept of plugin for this. Unfortunately it’s unrealistic to talk about publishing it, because the current state of plugins API just doesn’t have everything needed to at least achieve feature parity with corresponding plugin for Insomnia. Things that API is currently missing:
A more general plugin type for enriching/altering the request. In my PoC I use the `AuthenticationPlugin` type. It’s the only type which allows to alter request headers, but it wasn’t really designed for this, therefore some restrictions apply:
You have to specifically select “Global headers“ as the Auth mode. Moreover it has to be done per request
As a consequence of a previous bullet, you can’t combine Global headers with any other Auth mode.
There is no way to obtain the current workspace and/or its environment. Because of this, in the PoC I’ve just hardcoded the headers list
It’s pretty hard to debug the code. console.log doesn’t print anything in the inspector, `debugger;` statement doesn’t break – it seems like the process executing the plugin code is pretty well isolated
yaakcli codegen is lagging behind with dependencies, installing API typings of v0.2.x while the current version is 0.4.1
It works though. I may return to make a better version if/when the API has everything needed.
Leaving it here in case somebody wants to play:
If you want to run it:
generate a plugin with yaakcli generate,
update @yaakapp/api to at least v0.4.1
edit the registry variable
build it with yaakcli build (or yaakcli dev)
import the plugin to yaak
select “Global headers“ auth mode for your request and select a section (or leave the default one)