What problem does it solve?
Securing HTTP endpoints in MoonBit Golem agents requires knowing the correct derive attributes and deployment configuration, and misconfiguration can leave endpoints unintentionally public or block legitimate access.
Core Features & Use Cases
- Mount-Level Authentication: Apply
#derive.mount_auth(true) on an agent struct to require authentication for all of its endpoints at once.
- Per-Endpoint Control: Use
#derive.endpoint_auth to enable or disable auth on individual endpoints, overriding the mount-level setting for cases like public health checks.
- Principal Injection: Add a
Principal parameter to constructors or endpoint methods to receive the authenticated caller's identity automatically.
- Use Case: You are building a MoonBit agent with a public
/health endpoint and private /data endpoints. This Skill shows how to require auth by default, exempt the health check, and configure the OIDC security scheme in golem.yaml.
Quick Start
Ask the AI to add authentication to the HTTP endpoints of your MoonBit Golem agent and configure the security scheme in golem.yaml.