sonatype-nexus-community / nexus-blobstore-google-cloud

Nexus Repository Manager Blobstore backed by Google Cloud Storage
https://help.sonatype.com/en/configuring-blob-stores.html#google-cloud-blob-store
Eclipse Public License 1.0
39 stars 16 forks source link

WIP. Uses a UUID to normalize namespace name based on prefix and blob… #52

Closed mattjohnson closed 4 years ago

mattjohnson commented 4 years ago

…store name.

Namespaces used within some of GCPs services have a strict character set such as [0-9A-Za-z\._\-]{0,100}. This change continues to use the same value but encoded using UUID type 3.

This pull request makes the following changes:

It relates to the following issue #s:

This PR does not address any migration that might be required for existing blob stores that would now have a changed namespace. Options could be to only use UUID format if the prefix+blob store name does not conform to the namespace regex.

nblair commented 4 years ago

@goloxxly I'd like to get your opinion on this. This change means that whitespace in the blobstore name won't be an obstacle any more for the integration with Datastore/Firestore. The downside is that in the GCP console, you won't be able to map the namespace of data stored in Datastore/Firestore back to the specific Google Cloud Blobstore(s) in your NXRM deployment. Is that a reasonable trade-off?

nblair commented 4 years ago

Options could be to only use UUID format if the prefix+blob store name does not conform to the namespace regex.

👍

nblair commented 4 years ago

Snapshot of what Datastore console looks like with two blobstores, one with a space, and one without:

Screen Shot 2019-11-21 at 12 13 40 PM

@mattjohnson I think we should put the same blobstore- prefix in front of the UUID. Aside from that change, the rest has my 👍

mattjohnson commented 4 years ago

@nblair Moved the prefixes out of UUID.

goloxxly commented 4 years ago

@goloxxly I'd like to get your opinion on this. This change means that whitespace in the blobstore name won't be an obstacle any more for the integration with Datastore/Firestore. The downside is that in the GCP console, you won't be able to map the namespace of data stored in Datastore/Firestore back to the specific Google Cloud Blobstore(s) in your NXRM deployment. Is that a reasonable trade-off?

As an end user of this plug-in I'm not interested in what's stored in Datastore. It's not a problem for me if I can't bind Datastore entries to Nexus blob stores. Although the "blobstore-" prefix mentioned in another comment makes me understand the purpose of the namespace in Datastore whenever I would have to deal with Datastore entries. So I think that's a good idea.