stalwartlabs/stalwart · error · ScimError

Not Implemented

Error message

Not Implemented

What it means

A SCIM Error with HTTP status 501 ("Not Implemented"), built by `Error::not_implemented()`. The library throws it when the server does not implement the requested SCIM capability — for example bulk operations, PATCH, or a filtering feature that is disabled or absent.

Source

Thrown at crates/scim-proto/src/message/error.rs:199

    pub fn max_operations_exceeded(max_operations: usize) -> Self {
        Error::new(413).with_detail(format!(
            "The number of operations in the bulk request exceeds the maxOperations ({max_operations})."
        ))
    }

    pub fn max_payload_size_exceeded(max_payload_size: usize) -> Self {
        Error::new(413).with_detail(format!(
            "The size of the bulk operation exceeds the maxPayloadSize ({max_payload_size})."
        ))
    }

    pub fn internal_error() -> Self {
        Error::new(500)
    }

    pub fn not_implemented() -> Self {
        Error::new(501)
    }

    pub fn is_client_error(&self) -> bool {
        (400..500).contains(&self.status)
    }
}

impl Serialize for Error {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: Serializer,
    {
        let mut map = serializer.serialize_map(None)?;
        map.serialize_entry("schemas", &[MESSAGE_ERROR])?;
        if let Some(scim_type) = &self.scim_type {
            map.serialize_entry("scimType", scim_type.as_str())?;
        }
        if let Some(detail) = &self.detail {

View on GitHub (pinned to e962003857)

Solutions

  1. Check /ServiceProviderConfig for the features you need (bulk, filter, patch, etag) before using them.
  2. Fall back to supported operations — e.g. use PUT instead of PATCH, or individual requests instead of Bulk.
  3. Enable or upgrade the server component that implements the missing feature.

Example fix

// before
client.patch_user(id, ops).await?;
// after
if server_config.patch.supported {
    client.patch_user(id, ops).await?;
} else {
    client.put_user(id, full_resource).await?;
}
Defensive patterns

Strategy: type-guard

Validate before calling

let cfg = client.service_provider_config().await?;
let patch_supported = cfg.patch.as_ref().map(|p| p.supported).unwrap_or(false);
let bulk_supported = cfg.bulk.is_some();

Type guard

fn supports_bulk(cfg: &ServiceProviderConfig) -> bool {
    cfg.bulk.as_ref().map(|b| b.supported).unwrap_or(false)
}

Prevention

When it happens

Trigger: Sending a request for an optional SCIM feature (e.g. POST /Bulk, PATCH /Users/{id}, or an advanced filter) that the server has not implemented, so the handler constructs `Error::not_implemented()`.

Common situations: Clients assume RFC 7644 optional features are always available; connecting to a minimal/trimmed SCIM server build; a provider disabled bulk or PATCH support in a newer version.

Related errors


AI-assisted analysis of stalwartlabs/stalwart@e962003857 (2026-09-06). Data as JSON: /api/errors/6bb16f81afe82eef. Report an issue: GitHub.