{"record":{"id":"87eaa5261e908420","repo":"hasura/graphql-engine","slug":"authconfig-v1-is-deprecated-allowroleemulationby","errorCode":null,"errorMessage":"AuthConfig v1 is deprecated. `allowRoleEmulationBy` has been removed. Please consider upgrading to AuthConfig v4.","messagePattern":"AuthConfig v1 is deprecated\\. `allowRoleEmulationBy` has been removed\\. Please consider upgrading to AuthConfig v4\\.","errorType":"error_code","errorClass":"Warning","httpStatus":null,"severity":"warning","filePath":"v3/crates/auth/hasura-authn/src/lib.rs","lineNumber":262,"sourceCode":"                    \"mode\": {\n                      \"webhook\": {\n                        \"url\": \"http://auth_hook:3060/validate-request\",\n                        \"method\": \"Post\"\n                      }\n                    }\n                }\n            ),\n            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)","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/auth/hasura-authn/src/lib.rs#L244-L280","documentation":"A warning (not a hard failure unless warnings-as-errors is enabled) emitted during auth config generation: the metadata still uses AuthConfig v1, whose `allowRoleEmulationBy` capability has been removed. The build proceeds but v1 is deprecated and will break in a future release.","triggerScenarios":"Auth config generation encounters an AuthConfig of version 1 in the OpenDD metadata while building hasura-authn configuration.","commonSituations":"Upgrading the platform/engine to a version that no longer supports AuthConfig v1, or importing older metadata exports that still pin version 1.","solutions":["Migrate the auth config to v4 (drop `allowRoleEmulationBy`, which no longer exists)","If you relied on role emulation, redesign it using the v4 role/session-variable model","Re-run the build and confirm the warning disappears; enable warnings-as-errors to enforce it"],"exampleFix":"// before\nauthConfig: { version: 1, allowRoleEmulationBy: [\"admin\"] }\n// after\nauthConfig: { version: 4 }","handlingStrategy":"validation","validationCode":"if auth_config.version == 1 {\n    return Err(\"AuthConfig v1 is deprecated; migrate to v4 (allowRoleEmulationBy removed)\");\n}","typeGuard":"fn isSupportedAuthConfig(v: u32) -> bool { v == 4 }","tryCatchPattern":"match build_auth_config(&metadata) {\n    Err(e) if e.to_string().contains(\"AuthConfig v1 is deprecated\") => plan_migration(e),\n    r => r,\n}","preventionTips":["Run metadata migration tooling before upgrading the engine","Pin CI to reject auth config versions < 4","Track deprecation notices in release notes for each upgrade"],"tags":["auth","deprecation","auth-config","migration"],"backgroundTag":"deprecated-api-version","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}