Plugin for Caddy that automatically injects an HSP IAM service
identity access token as request header.
Useful when running Caddy as a reverse proxy for a HSP service in a microservice architecture.
{
order service_token first
}
:8080 {
service_token {
region "<region>"
environment "<environment>"
service_id "<service_id>"
service_key "<service_key>"
}
reverse_proxy <hsp_service> {
header_up Host {upstream_hostport}
}
}Populate all variables marked with <variable>.
Install xcaddy:
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latestRun the plugin locally:
xcaddy runBuild caddy with this plugin:
xcaddy build --with github.com/Laugslander/service-caddy-tokenFor more information, see Extending Caddy.
License is Apache 2.0