synadia-labs / natster

Natster - A peer-to-multipeer media sharing application built with nothing but NATS
https://docs.natster.io
Apache License 2.0
39 stars 6 forks source link

Prevent duplicate catalog imports #39

Closed autodidaddict closed 9 months ago

autodidaddict commented 9 months ago

While we don't enforce global uniqueness for catalog names, we do need to make sure that we don't let people import the same catalog name from two different accounts because that would create a subject conflict. Doing this today probably results in a bad request with Synadia Cloud API rejecting the call because of this.

  1. We should tell them the catalog name is not unique among the imports and reject the attempt.
  2. We should do a check against the list of all previously shared catalogs when someone does a catalog new, and warn them that it won't be sharable because of the name.
  3. When someone attempts to share a catalog, reject it if it has already been shared previously