{"record":{"id":"440b89b0540c2f6f","repo":"juspay/hyperswitch","slug":"moneris-requires-signaturekey-auth-type","errorCode":null,"errorMessage":"Moneris requires SignatureKey auth type","messagePattern":"Moneris requires SignatureKey auth type","errorType":"exception","errorClass":"ApiErrorResponse","httpStatus":500,"severity":"error","filePath":"crates/router/src/core/unified_connector_service/connector_config.rs","lineNumber":1395,"sourceCode":"                    api_secret,\n                } => Ok(Self::Iatapay {\n                    client_id: api_key.clone(),\n                    merchant_id: key1.clone(),\n                    client_secret: api_secret.clone(),\n                }),\n                _ => Err(err(\"Iatapay requires SignatureKey auth type\")),\n            },\n            Connector::Moneris => match auth {\n                ConnectorAuthType::SignatureKey {\n                    api_key,\n                    key1,\n                    api_secret,\n                } => Ok(Self::Moneris {\n                    client_secret: api_key.clone(),\n                    client_id: key1.clone(),\n                    merchant_id: api_secret.clone(),\n                }),\n                _ => Err(err(\"Moneris requires SignatureKey auth type\")),\n            },\n            Connector::Noon => match auth {\n                ConnectorAuthType::SignatureKey {\n                    api_key,\n                    key1,\n                    api_secret,\n                } => Ok(Self::Noon {\n                    api_key: api_key.clone(),\n                    business_identifier: key1.clone(),\n                    application_identifier: api_secret.clone(),\n                }),\n                _ => Err(err(\"Noon requires SignatureKey auth type\")),\n            },\n            Connector::Novalnet => match auth {\n                ConnectorAuthType::SignatureKey {\n                    api_key,\n                    key1,\n                    api_secret,","sourceCodeStart":1377,"sourceCodeEnd":1413,"githubUrl":"https://github.com/juspay/hyperswitch/blob/3093f22cc46b46415cca152ea0b234277b251ecd/crates/router/src/core/unified_connector_service/connector_config.rs#L1377-L1413","documentation":"Thrown in ConnectorSpecificConfig::foreign_try_from while building the X_CONNECTOR_CONFIG header for the Moneris connector (via build_connector_config_header, connector_config.rs:1876). Moneris only accepts the SignatureKey variant (api_key, key1, api_secret), and note the non-obvious mapping: api_key becomes client_secret, key1 becomes client_id, and api_secret becomes merchant_id. Any other ConnectorAuthType variant reaches the wildcard arm and returns this error before the UCS call is made.","triggerScenarios":"A merchant connector account for connector_name = \"moneris\" has auth_type != SignatureKey (e.g. HeaderKey with just an api_key, or NoKey because auth was omitted and defaulted), and any UCS-path operation calls build_connector_config_header for Moneris. Because the field mapping is inverted (api_key→client_secret), accounts configured by pasting credentials in the intuitive order often also pass the variant check but fail auth at Moneris — the variant error itself only fires on the wrong auth_type shape.","commonSituations":"Creating a Moneris account with a single store API token (HeaderKey) instead of the full three-part SignatureKey set; dashboards that map Moneris store id/api token/checkout id to a different auth variant; migrating from legacy per-connector auth headers to the unified connector service, where the SignatureKey requirement became a hard error; omitting auth_type in the create payload so it defaults to NoKey.","solutions":["Update the Moneris connector account to auth_type = SignatureKey with Moneris's inverted mapping: api_key = client_secret, key1 = client_id, api_secret = merchant_id.","Double-check the credential order after switching — the swap of api_key/client_secret naming is a frequent silent misconfiguration.","Ensure the create/update payload includes auth_type explicitly; the enum defaults to NoKey which always fails this match.","Validate the variant before payment-time by test-building the header (see defense) so misconfiguration is caught at account setup."],"exampleFix":"// before — connector account auth for Moneris\n\"auth_type\": { \"auth_type\": \"HeaderKey\", \"api_key\": \"moneris_api_token\" }\n\n// after — note inverted mapping: api_key=client_secret, key1=client_id, api_secret=merchant_id\n\"auth_type\": {\n  \"auth_type\": \"SignatureKey\",\n  \"api_key\": \"<client_secret>\",\n  \"key1\": \"<client_id>\",\n  \"api_secret\": \"<merchant_id>\"\n}","handlingStrategy":"type-guard","validationCode":"// Before creating/updating a Moneris connector account\nlet auth_ok = matches!(&payload.auth_type, ConnectorAuthType::SignatureKey { .. });\nassert!(\n    auth_ok,\n    \"Moneris requires SignatureKey (api_key=client_secret, key1=client_id, api_secret=merchant_id)\"\n);","typeGuard":"fn is_moneris_compatible(auth: &ConnectorAuthType) -> bool {\n    matches!(auth, ConnectorAuthType::SignatureKey { .. })\n}","tryCatchPattern":"// Rust: catch at header build, classify as configuration failure (do not retry — it is deterministic)\nlet header = build_connector_config_header(Connector::Moneris, &auth, metadata).map_err(|e| {\n    if e.current_context().message.contains(\"Moneris requires\") {\n        classify_as(Errored::ConnectorMisconfigured { connector: \"moneris\", hint: \"set auth_type=SignatureKey\" })\n    } else {\n        classify_as(Errored::Unexpected(e))\n    }\n})?;","preventionTips":["Document Moneris's inverted mapping (api_key holds client_secret, api_secret holds merchant_id) next to the onboarding form.","Require SignatureKey for Moneris accounts at create time; also verify all three secrets are non-empty.","Dry-run build_connector_config_header after every connector account update and alert on Err before live payments depend on it.","Because this error is deterministic, mark the connector disabled-for-misconfiguration rather than retrying when it fires."],"tags":["moneris","connector-auth","signature-key","auth-type-mismatch","hyperswitch","connector-config"],"backgroundTag":"auth-type-mismatch","analyzedSha":"3093f22cc46b46415cca152ea0b234277b251ecd","analyzedAt":"2026-08-23T00:36:32.882Z","contentChangedAt":"2026-08-23T00:36:32.882Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}