{"record":{"id":"e0fbfefb1489da2c","repo":"jdx/mise","slug":"packslip-stampers-entry-spec-host-is-not","errorCode":null,"errorMessage":"packslip.stampers entry {spec:?}: {host:?} is not a host name","messagePattern":"packslip\\.stampers entry (.+?): (.+?) is not a host name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/packslip_stamps.rs","lineNumber":56,"sourceCode":"    pub(crate) host: String,\n    pin: Pin,\n}\n\nimpl Stamper {\n    /// `host=PIN`, where PIN is a minisign public key line, the path of a\n    /// `.pub` file, or an `https://` identity prefix for a keyless signer\n    /// on GitHub such as `https://github.com/org/registry/`.\n    pub(crate) fn parse(spec: &str) -> Result<Stamper> {\n        let spec = spec.trim();\n        let Some((host, pin)) = spec.split_once('=') else {\n            bail!(\n                \"packslip.stampers entry {spec:?} has no pin; write host=PUBKEY, host=path/to/key.pub, or host=https://github.com/org/repo/\"\n            );\n        };\n        let host = host.trim();\n        let pin = pin.trim();\n        if host.is_empty() || !host.contains('.') || host.contains('/') {\n            bail!(\"packslip.stampers entry {spec:?}: {host:?} is not a host name\");\n        }\n        let pin = if pin.starts_with(\"https://\") {\n            Pin::Identity(Policy {\n                issuer: Some(GITHUB_ISSUER.into()),\n                identity: None,\n                identity_prefix: Some(pin.to_string()),\n            })\n        } else {\n            let text = if std::path::Path::new(pin).is_file() {\n                file::read_to_string(pin)?\n            } else {\n                pin.to_string()\n            };\n            let key = packslip::minisign::PublicKey::parse(&text)\n                .map_err(|e| eyre!(\"packslip.stampers entry for {host}: pubkey: {e}\"))?;\n            Pin::Key(key)\n        };\n        Ok(Stamper {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/packslip_stamps.rs#L38-L74","documentation":"Raised by packslip_stamps::Stamper::parse when the host part of a `host=PIN` stamper entry is empty, contains no dot, or contains a slash — none of which constitute a valid host name. The host must look like a DNS name (e.g. \"github.com\") because it keys the per-host stamp state.","triggerScenarios":"Parsing a stampers entry whose part before '=' is empty (=key), a single label without a dot (localhost), or contains a slash (https://example.com=... or a path used as host).","commonSituations":"Putting a full URL on the left side of '=' instead of just the hostname; writing a bare key with an empty host (=MIIB...); using 'localhost' or an internal alias without a dot.","solutions":["Use a proper dotted host name before '=', e.g. \"example.com=PUBKEY\".","Remove any scheme/path from the host: write \"github.com=...\", not \"https://github.com/...=...\" (the https:// prefix belongs on the pin side for keyless signing).","If the key was meant to be the pin, ensure the format is host=PUBKEY with the host first."],"exampleFix":"// before (mise.toml)\nstampers = [\"https://github.com/org/repo/=MIIB...\"]\n// after\nstampers = [\"example.com=https://github.com/org/repo/\"]","handlingStrategy":"validation","validationCode":"// check the host part of a stamper entry before parsing\nfunction isValidStamperHost(spec) {\n  const [host] = spec.split(\"=\");\n  return Boolean(host && host.includes(\".\") && !host.includes(\"/\"));\n}","typeGuard":"function hasValidHost(spec) {\n  const host = (spec.split(\"=\")[0] || \"\").trim();\n  return host.length > 0 && /\\./.test(host) && !host.includes(\"/\");\n}","tryCatchPattern":"try {\n  parseStamper(spec);\n} catch (e) {\n  if (String(e).includes(\"is not a host name\")) {\n    throw new Error(`Use a bare dotted hostname before '=' in \"${spec}\" (no scheme, no path).`);\n  } else throw e;\n}","preventionTips":["Never put \"https://\" or a path in the host slot — that belongs on the pin side for keyless signers.","Use fully-qualified domain names (with a dot) as the host.","Keep a checked example entry in your config as a template."],"tags":["packslip","configuration","parsing","hostname"],"backgroundTag":"invalid-argument-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}