一键导入
golem-add-http-auth-rust
Enabling authentication on Rust HTTP endpoints. Use when the user asks to add auth, require authentication, or protect HTTP endpoints.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Enabling authentication on Rust HTTP endpoints. Use when the user asks to add auth, require authentication, or protect HTTP endpoints.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Invoking a Rust Golem agent method from the CLI. Use when asked to call, invoke, or run a method on a deployed agent using golem agent invoke.
Defining environment variables for Golem agents. Use when configuring env vars in golem.yaml at the component template, component, agent type, or preset level, passing env vars to individual agent instances via CLI, or using template substitution and merge modes.
Exposing a Rust Golem agent over HTTP. Use when the user asks to add HTTP endpoints, mount an agent to a URL path, or expose agent methods as a REST API.
Adding secrets to Rust Golem agents. Use when the user needs to store sensitive configuration such as API keys, passwords, or tokens that should not be checked into source control.
Calling Golem agents from external Rust applications using generated bridge SDKs. Use when the user wants to invoke agents from outside the Golem platform, from a Rust CLI, server, or any native Rust application.
Setting up a Golem Cloud account from scratch. Use when creating a Golem Cloud account, authenticating with Golem Cloud via the CLI, setting up a cloud profile, or deploying to Golem Cloud for the first time.
| name | golem-add-http-auth-rust |
| description | Enabling authentication on Rust HTTP endpoints. Use when the user asks to add auth, require authentication, or protect HTTP endpoints. |
Golem supports authentication on HTTP endpoints via OIDC providers. Authentication is enabled in the agent code and configured via security schemes in golem.yaml. Load the golem-configure-api-domain skill for details on setting up security schemes and domain deployments.
Set auth = true on #[agent_definition] to require authentication for all endpoints:
#[agent_definition(mount = "/secure/{name}", auth = true)]
pub trait SecureAgent {
fn new(name: String) -> Self;
// All endpoints require authentication
}
Set auth = true on specific #[endpoint] attributes:
#[agent_definition(mount = "/api/{name}")]
pub trait ApiAgent {
fn new(name: String) -> Self;
#[endpoint(get = "/public")]
fn public_data(&self) -> String;
#[endpoint(get = "/private", auth = true)]
fn private_data(&self) -> String;
}
Per-endpoint auth overrides the mount-level setting:
#[agent_definition(mount = "/api/{name}", auth = true)]
pub trait MostlySecureAgent {
fn new(name: String) -> Self;
#[endpoint(get = "/health", auth = false)]
fn health(&self) -> String; // No auth required
#[endpoint(get = "/data")]
fn get_data(&self) -> Data; // Auth required (inherited)
}
After enabling auth = true in code, you must configure a security scheme in golem.yaml. Load the golem-configure-api-domain skill for the full details. Quick reference:
httpApi:
deployments:
local:
- domain: my-app.localhost:9006
agents:
SecureAgent:
securityScheme: my-oidc # For production OIDC
# or for development:
# SecureAgent:
# testSessionHeaderName: X-Test-Auth