{"record":{"id":"0b950c04498a90d9","repo":"Hmbown/CodeWhale","slug":"provider-auth-source-secret-must-include-secret-id","errorCode":null,"errorMessage":"provider auth source secret must include secret_id","messagePattern":"provider auth source secret must include secret_id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/config/src/auth_source.rs","lineNumber":41,"sourceCode":"\nimpl ProviderAuthSourceToml {\n    pub fn validate(&self) -> Result<()> {\n        match self.source {\n            AuthSourceKind::Command => {\n                if self.command.is_empty() || self.command.iter().all(|part| part.trim().is_empty())\n                {\n                    bail!(\n                        \"provider auth source command must include at least one non-empty argv item\"\n                    );\n                }\n            }\n            AuthSourceKind::Secret => {\n                if self\n                    .secret_id\n                    .as_deref()\n                    .is_none_or(|secret_id| secret_id.trim().is_empty())\n                {\n                    bail!(\"provider auth source secret must include secret_id\");\n                }\n            }\n        }\n        Ok(())\n    }\n\n    #[must_use]\n    pub fn source_class(&self) -> &'static str {\n        match self.source {\n            AuthSourceKind::Command => \"command\",\n            AuthSourceKind::Secret => \"secret\",\n        }\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":56,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/config/src/auth_source.rs#L23-L56","documentation":"Validation error from ProviderAuthSourceToml::validate for secret-based auth sources. When source = \"secret\", a non-empty secret_id is mandatory because it names the stored secret used to fetch credentials; missing or whitespace-only secret_id fails config load.","triggerScenarios":"A provider auth source in TOML is declared as kind Secret with secret_id absent, null, or set to \"\" / whitespace.","commonSituations":"Copying a command-based auth block and switching source to Secret without adding secret_id; renaming the secret and leaving the field empty; template expansion that dropped the value.","solutions":["Add a non-empty secret_id, e.g. secret_id = \"codewhale/api-key\".","Verify the referenced secret actually exists in the secret store.","If you meant to run a command, switch source back to Command and populate command.","Re-validate the config after editing."],"exampleFix":"// before\n[providers.auth_source]\nsource = \"secret\"\n// after\n[providers.auth_source]\nsource = \"secret\"\nsecret_id = \"codewhale/api-key\"","handlingStrategy":"validation","validationCode":"if auth_source.source == \"secret\"\n    && auth_source.secret_id.as_deref().map_or(true, |s| s.trim().is_empty()) {\n    return Err(\"providers.auth_source.secret_id is required for source = \\\"secret\\\"\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair source = \"secret\" with a non-empty secret_id.","Keep secret IDs in sync with your secret store; rename both together.","Validate the config after edits and before deployment.","When copying auth blocks between providers, update all fields, not just the source kind."],"tags":["config","validation","auth","secrets"],"backgroundTag":"missing-required-config-field","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}