I didn't test, but should be possible with forward_auth (https://caddyserver.com/docs/caddyfile/directives/forward_auth)
Unfortunately I don't have any resource for you, but I love the idea. Is there any way to follow your progress?
I didn't test, but should be possible with forward_auth (https://caddyserver.com/docs/caddyfile/directives/forward_auth)