{"record":{"id":"c8ca086924dd8267","repo":"influxdata/influxdb","slug":"missing-resource-name-0","errorCode":null,"errorMessage":"missing resource name {0}","messagePattern":"missing resource name (.+?)","errorType":"error_code","errorClass":"ResourceMappingError","httpStatus":null,"severity":"error","filePath":"influxdb3_authz/src/permissions.rs","lineNumber":38,"sourceCode":"\npub const AUTHZ_DELETE_ROW_ACTION: &str = \"delete\";\n\npub const AUTHZ_CREATE_CRUD_ACTION: &str = \"create\";\npub const AUTHZ_READ_CRUD_ACTION: &str = \"read\";\npub const AUTHZ_UPDATE_CRUD_ACTION: &str = \"update\";\npub const AUTHZ_DELETE_CRUD_ACTION: &str = \"delete\";\n\npub const AUTHZ_WILDCARD: &str = \"*\";\n\n#[derive(Debug, Error)]\npub enum ResourceMappingError {\n    #[error(\"resource type not supported {0}\")]\n    ResourceTypeNotSupported(String),\n    #[error(\"invalid resource name {0}\")]\n    InvalidResourceName(String),\n    #[error(\"mixed wildcard (*) and resource name\")]\n    MixedWildcardAndRegularResourceName,\n    #[error(\"missing resource name {0}\")]\n    MissingResourceName(String),\n    #[error(\"action not supported, {0}\")]\n    ActionNotSupported(String),\n    #[error(\"missing resource id {0}\")]\n    MissingResourceId(String),\n}\n\npub trait ResourceNameToIdProvider {\n    fn resource_name_to_id(\n        &self,\n        resource_type: ResourceType,\n        names: &[String],\n    ) -> Result<ResourceIdentifier, ResourceMappingError>;\n}\n\npub trait ResourceIdToNameProvider {\n    fn resource_id_to_name(\n        &self,","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_authz/src/permissions.rs#L20-L56","documentation":"ResourceMappingError::MissingResourceName is thrown when a resource entry that should carry a name has none — the name string is empty or absent during resource mapping. The mapping layer requires every non-wildcard resource entry to identify itself by name.","triggerScenarios":"Passing an empty string or a record with a missing name field into the resource-name-to-id mapping when building token permissions.","commonSituations":"Deserialized permission JSON with a null/empty \"name\"; config templating that left a placeholder unsubstituted; programmatic construction skipping the name field.","solutions":["Ensure every non-wildcard resource entry has a non-empty name before calling the mapping API.","Validate permission definitions at load time and reject entries with empty names.","Fix the template/config that produced an empty name value."],"exampleFix":"// before\nlet names = vec![\"\"]; // missing\n// after\nlet names = vec![\"my_db\"];","handlingStrategy":"validation","validationCode":"fn require_name(entry: &PermissionEntry) -> Result<&str, String> {\n    entry.name.as_deref().filter(|n| !n.trim().is_empty()).ok_or_else(|| \"missing resource name\".to_string())\n}","typeGuard":null,"tryCatchPattern":"let name = require_name(&entry).map_err(ResourceMappingError::MissingResourceName)?;","preventionTips":["Validate permission JSON schema (required non-empty name) at deserialization time","Check for unsubstituted template placeholders in config","Fail fast when a name lookup returns empty rather than propagating it"],"tags":["authz","permissions","validation"],"backgroundTag":"empty-required-field","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}