golemcloud/golem/golem-add-http-auth-go
- community
Checking that the SKILL.md file is still in the repository.
Requiring authentication on a Go agent's HTTP endpoints. Use when the user asks to add auth, require authentication, or protect HTTP endpoints in a Go Golem project.
Install
npx vskill@latest install golemcloud/golem/golem-add-http-auth-goSKILL.md
Requiring Authentication on Go HTTP Endpoints
Overview
Golem authenticates HTTP endpoints via OIDC providers. Auth is declared on the agent definition — mount-wide with Mount.Auth, or per route with golem.EndpointAuth — and then wired to a security scheme in the manifest's (golem.yaml) httpApi deployment. Declaring auth in code without a matching deployment configuration only advertises the requirement; serving it needs the deployment.
Steps
- Require auth at the mount (
Mount{Auth: true}) or per endpoint (golem.EndpointAuth(true)). - Override where needed — a per-endpoint
golem.EndpointAuth(...)beats the mount default. - Configure a security scheme in
golem.yamlunder thehttpApideployment.
Auth on all endpoints (mount level)
Set Auth: true on the Mount to require authentication for every endpoint of the agent:
Auth on individual endpoints
With no mount-level default, require auth on a specific route with golem.EndpointAuth(true):
Overriding the mount default
A per-endpoint golem.EndpointAuth overrides the mount's Auth. Use false to open a single route on an otherwise-protected agent:
Receiving the principal
Read who is calling from a golem.Principal field of the method's input struct. The host fills it for every invocation (an OidcPrincipal for an authenticated user), so it is never mapped from the path, query, headers or body, and callers leave it nil. ctx.Principal() is the principal the agent was initialized with:
The principal is one of golem.OidcPrincipal, golem.AgentPrincipal (another agent over RPC), golem.GolemUserPrincipal (a Golem account, e.g. the CLI) and golem.AnonymousPrincipal.
Deployment configuration
After declaring auth in code, configure a security scheme in golem.yaml under the httpApi deployment (this is where subdomain versus domain is chosen). Quick reference:
Key Constraints
Mount.Authis a plainbool;golem.EndpointAuth(required bool)takes an explicit value (trueto require,falseto open).- Setting
golem.EndpointAuthmore than once on one endpoint is a definition error, not a silent overwrite — set it exactly once per route. - An endpoint with no
golem.EndpointAuthinherits the mount'sAuth. - A
golem.Principalfield cannot be bound to a{var}, query parameter or header; that is a definition error. - Declaring auth requires an
httpApideployment with a security scheme to actually enforce it — mounting alone only advertises the requirement.
Related Skills
| Skill | When to Load | |
|---|---|---|
golem-add-http-endpoint-go | Set up the mount and endpoints before adding auth | |
golem-add-cors-go | Allow cross-origin requests to the endpoints | |
golem-http-params-go | Bind request path/query/header/body to method inputs |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinggolem-skills/skills/go/golem-add-http-auth-go/SKILL.md
Popularity
- Repository stars
- 1,514
- Repository forks
- 210
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/golemcloud/golem/golem-add-http-auth-go)