Skip to content

[Extensions] Handle unknown extensions #81

@msirringhaus

Description

@msirringhaus

Extensions unknown to the client should be passed through as CBOR. Maybe the trait itself could expose the expected input key, and if no extension is found, the extension data can be passed as-is?

  trait ClientExtensionParsing<G, C> where G: TryFrom<cbor::Map>, C: TryFrom<cbor::Map> {
    const MAKE_INPUT_KEY: &str;
    const GET_INPUT_KEY: &str;
  }
  trait ClientExtension<G, C>: ClientExtensionProcessing<G, C> + ClientExtensionParsing<G, C>

Ideally, if we fail to parse input for an extension, we should ignore the individual extension - but continue with the rest of the request. Maybe the trait for each extension could be generic over its input type, and perform parsing, with a Result so the caller can handle these errors appropriately?

Originally posted by @AlfioEmanueleFresta in #77 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions