{"record":{"id":"202a51ef01e63e71","repo":"hasura/graphql-engine","slug":"header-0-used-in-the-auth-config-is-not-a-va","errorCode":null,"errorMessage":"Header '{0}', used in the auth config, is not a valid header name","messagePattern":"Header '(.+?)', used in the auth config, is not a valid header name","errorType":"error_code","errorClass":"Warning","httpStatus":null,"severity":"warning","filePath":"v3/crates/auth/hasura-authn/src/lib.rs","lineNumber":270,"sourceCode":"            jsonpath::JSONPath::new(),\n        )\n        .unwrap()\n    }\n}\n\n/// Warnings for the user raised during auth config generation\n/// These are things that don't break the build, but may do so in future\n#[derive(Debug, PartialEq, thiserror::Error)]\npub enum Warning {\n    #[error(\n        \"AuthConfig v1 is deprecated. `allowRoleEmulationBy` has been removed. Please consider upgrading to AuthConfig v4.\"\n    )]\n    PleaseUpgradeV1ToV4,\n    #[error(\"AuthConfig v2 is deprecated. Please consider upgrading to AuthConfig v4.\")]\n    PleaseUpgradeV2ToV4,\n    #[error(\"AuthConfig v3 is deprecated. Please consider upgrading to AuthConfig v4.\")]\n    PleaseUpgradeV3ToV4,\n    #[error(\"Header '{0}', used in the auth config, is not a valid header name\")]\n    InvalidHeaderName(String),\n    #[error(\"Header value '{0}' is not a valid header value for header '{1}' in the auth config\")]\n    InvalidHeaderValue(String, String),\n}\n\nimpl Warning {\n    pub fn should_be_an_error(&self, flags: &open_dds::flags::OpenDdFlags) -> bool {\n        match self {\n            Warning::InvalidHeaderName(_) | Warning::InvalidHeaderValue(_, _) => {\n                flags.contains(open_dds::flags::Flag::DisallowInvalidHeadersInAuthConfig)\n            }\n            _ => false,\n        }\n    }\n}\n\n#[derive(Debug, thiserror::Error, PartialEq)]\npub enum Error {","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/auth/hasura-authn/src/lib.rs#L252-L288","documentation":"A warning raised during auth config generation: a header name referenced in the auth configuration (e.g. for session-variable extraction from headers) is not a syntactically valid HTTP header name. Depending on flags this warning can be promoted to a hard error.","triggerScenarios":"An auth config entry maps a session variable to a header whose name contains invalid characters or is otherwise rejected by header-name parsing (e.g. spaces, non-ASCII, empty string).","commonSituations":"Typos in header names, copying curl-style header names with unusual characters, or templating bugs that inject whitespace into header names in the auth config.","solutions":["Correct the header name to a valid HTTP token (alphanumerics and -_~ etc., no spaces/non-ASCII)","Check the `should_be_an_error` flag mapping — with strict flags this fails the build outright","If the header isn't needed, remove the mapping from the auth config"],"exampleFix":"// before\nsessionVariables: { - header: \"X Hasura-Role \" }\n// after\nsessionVariables: { - header: \"X-Hasura-Role\" }","handlingStrategy":"validation","validationCode":"use http::HeaderName;\nfor name in auth_config.header_names() {\n    HeaderName::from_bytes(name.as_bytes())\n        .map_err(|_| format!(\"invalid header name: {name}\"))?;\n}","typeGuard":"fn isValidHeaderName(s: &str) -> bool {\n    !s.is_empty() && s.bytes().all(|b| b.is_ascii_alphanumeric() || b\"-_!#$%&'*+.^`|~\".contains(&b))\n}","tryCatchPattern":null,"preventionTips":["Lint header names in the auth config with a standard parser","Avoid templating that can inject spaces into header names","Enable strict flags so bad header names fail builds early"],"tags":["auth","headers","config-validation","http"],"backgroundTag":"invalid-header-name","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}