wasmcloud-otp icon indicating copy to clipboard operation
wasmcloud-otp copied to clipboard

[BUG] Link definitions should reject requests to overwrite existing definitions

Open brooksmtownsend opened this issue 2 years ago • 0 comments

Describe the bug

Link definitions are keyed in the form of {actor, contract_id, link_name}, as actors are only allowed to have one link definition per-contract ID and link name. Because this is not based on provider IDs two separate link definitions for different providers that share a contract ID and link name will overwrite the linkdef in the host cache and be ignored by the capability provider.

Solution If we attempt to put a link definition and the key already exists, we should instead refuse to cache that link definition. This should return an error to the control interface client indicating a link already exists and that the user should instead delete the existing linkdef

brooksmtownsend avatar Mar 15 '22 19:03 brooksmtownsend