{"record":{"id":"532ddcda2039902f","repo":"dbt-labs/dbt-core","slug":"generic-backend-authentication","errorCode":null,"errorMessage":"generic backend authentication","messagePattern":"generic backend authentication","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/dbt-auth/src/lib.rs","lineNumber":90,"sourceCode":"    warning_printer: Box<dyn AuthWarningPrinter>,\n) -> Box<dyn Auth> {\n    match backend {\n        Backend::Snowflake => Box::new(snowflake::SnowflakeAuth::new(warning_printer)),\n        Backend::Postgres => Box::new(postgres::PostgresAuth::new(warning_printer)),\n        Backend::BigQuery => Box::new(bigquery::BigqueryAuth::new(warning_printer)),\n        Backend::Databricks => Box::new(databricks::DatabricksAuth::new(warning_printer)),\n        Backend::Redshift => Box::new(redshift::RedshiftAuth::new(warning_printer)),\n        Backend::Salesforce => Box::new(salesforce::SalesforceAuth::new(warning_printer)),\n        Backend::Spark => Box::new(spark::SparkAuth::new(warning_printer)),\n        Backend::DuckDB | Backend::DuckDBExtended => {\n            Box::new(duckdb::DuckDbAuth::new(backend, warning_printer))\n        }\n        Backend::LakeCompute => Box::new(lake_compute::LakeComputeAuth::new(warning_printer)),\n        Backend::SQLServer => Box::new(sqlserver::SQLServerAuth::new(warning_printer)),\n        Backend::ClickHouse => Box::new(clickhouse::ClickHouseAuth::new(warning_printer)),\n        Backend::Athena => Box::new(athena::AthenaAuth::new(warning_printer)),\n        Backend::Exasol => Box::new(exasol::ExasolAuth::new(warning_printer)),\n        Backend::Generic { .. } => unimplemented!(\"generic backend authentication\"),\n    }\n}\n\n/// Error type for [dbt_auth].\n///\n/// For display purposes, it must be converted into an [AdapterError] first, outside of this crate.\n#[derive(Debug)]\npub enum AuthError {\n    /// Error from the [adbc_core] crate\n    Adbc(adbc_core::error::Error),\n    /// A generic configuration error\n    Config(String),\n    /// An error from the [serde_json] crate\n    JSON(serde_json::Error),\n    /// An error from the [dbt_yaml] crate\n    YAML(dbt_yaml::Error),\n    /// I/O error\n    Io(io::Error),","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-auth/src/lib.rs#L72-L108","documentation":"dbt-auth dispatches backend-specific authentication implementations via `auth_for_backend_with_warnings`, which matches on the requested `Backend` enum and constructs the corresponding auth object. The `Generic` backend variant has no authentication implementation, so the code panics with `unimplemented!` when it is requested. This is a deliberate placeholder marking an intentionally unimplemented feature, not a runtime condition the caller can recover from.","triggerScenarios":"Calling `dbt_auth::auth_for_backend` (or `auth_for_backend_with_warnings`) with `Backend::Generic { .. }`. There is no configuration fix; any request resolving to the Generic backend variant reaches this match arm and panics.","commonSituations":"A profile or adapter configuration resolves to a generic backend (e.g., an adapter that declares itself generic rather than naming a concrete backend like Postgres, Snowflake, etc.), so auth selection falls through to the Generic arm. Developers wiring new adapters or testing backend dispatch may also hit it accidentally.","solutions":["Do not use `Backend::Generic`; configure a concrete backend variant that has an auth implementation (e.g., Postgres, SQLServer, ClickHouse, Athena, etc.).","If you need generic auth behavior, implement a `GenericAuth` type and add a match arm in `auth_for_backend_with_warnings` instead of relying on the `unimplemented!` placeholder.","Check upstream/downstream adapter code to see why the backend resolved to `Generic` and fix the mapping so a supported backend is selected."],"exampleFix":"// before\nlet backend = Backend::Generic { ... };\nlet auth = dbt_auth::auth_for_backend(backend, &printer)?; // panics\n// after\nlet backend = Backend::SQLServer; // or another supported backend\nlet auth = dbt_auth::auth_for_backend(backend, &printer)?;","handlingStrategy":"type-guard","validationCode":"fn assert_supported_backend(b: &Backend) -> Result<(), String> {\n    match b {\n        Backend::Generic { .. } => Err(\"Backend::Generic has no auth implementation; use a concrete backend\".to_string()),\n        _ => Ok(()),\n    }\n}","typeGuard":"fn is_supported_backend(b: &Backend) -> bool {\n    !matches!(b, Backend::Generic { .. })\n}","tryCatchPattern":"// Rust panics are not catchable in normal flow; guard before calling:\nif matches!(backend, Backend::Generic { .. }) {\n    return Err(AuthError::config(\"generic backend authentication is not supported\"));\n}\nlet auth = auth_for_backend(backend, printer)?;","preventionTips":["Never configure profiles that resolve to Backend::Generic when authentication is required.","Before calling auth_for_backend, match on the Backend variant and reject Generic explicitly with a friendly error.","Track upstream support and add a GenericAuth implementation before enabling generic backends."],"tags":["panic","unimplemented","authentication","backend-dispatch"],"backgroundTag":"method-not-implemented","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}