Announcing two tiny plugins (argsort and cookieflag)

Hi there,

I’ve made two tiny plugins that I find useful for me.

The first plugin is named argsort. With it, you are able to optionally lowercase and then sort the query arguments.
I found this very useful for multi faceted apis, where you don’t have any control on how it is being consumed. See more info here: Argsort Module.

The second plugin is named cookieflag. With it, you are able to add or remove flags from all the Set-Cookie response headers. Currently it can only add / remove the Secure and HttpOnly flags, but I plan to also add a matcher and more flags / properties (Path, Domain, etc).
I found this useful to quickly patch a backend app to make it more secure and look good on the audit reports. Yes, I know you could kinda do it with fancy header_down. I don’t want to. See more info here: Cookieflag Module.

Thank you @matt, @francislavoie and @darkweak for their continuous help and guidance on all issues I’ve encountered so far [mis|ab]using caddy.

If you have nothing better to do, you might take a look at those plugins. All feedback would be greatly appreciated.

3 Likes

You can avoid needing the order cookieflag line in config by adding httpcaddyfile.RegisterDirectiveOrder, a new feature added in v2.8.0. We’ll update the docs soon to mention this, we’re behind on docs updates for this release unfortunately. I’d recommend making it apply either before or after header by default, probably makes the most sense.

3 Likes

Wow, that’s really nice!

Wait, what? 2.8.4 already? Ok, will try it.

2 Likes

Alright, changed and tested, works great!
Thank you, @francislavoie !

3 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.