Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize blob and container names in the providers #4408

Closed
2 tasks
hikalkan opened this issue Jun 18, 2020 · 3 comments · Fixed by #4471
Closed
2 tasks

Normalize blob and container names in the providers #4408

hikalkan opened this issue Jun 18, 2020 · 3 comments · Fixed by #4471

Comments

@hikalkan
Copy link
Member

  • File system provider can normalize (clear illegal chars from) file/container names before saving or getting the file.
  • Azure provider can normalize the container name (you know, it only allows lower case chars... etc.) before using it.

@maliming what do you think?

@maliming
Copy link
Member

When developers use the file provider, they should understand these limitations, such as the difference between the file system in Linux and Windows, the special characters allowed in the file name, the maximum length of the path, etc. Azure provider is the same.

We should not normalize it, and normalization should be a process that is not perceptible to developers. Just like BlobStoring supports multi-tenancy.

@hikalkan If you think this is necessary, I can implement the above function.

@hikalkan
Copy link
Member Author

I partially agree. Yes, if developer knows the underlying storage provider, she/he is responsible to follow the rules, no problem about that.

The problem is when we are developing a reusable module and can not know the provider that will be used. Our module should be compatible to all providers, right? What if someone creates another provider that we don't know and this provider has another naming limitation. How can we name objects that fits to all possible providers? It is best the provider intergration package knows the limitation and adapt (tolerate) it if possible.

What do you think?

@hemiaoio
Copy link

I have some ideas about whether it is allowed to register and use multiple storage providers in the same file service at the same time. If different tenants may use different storage providers, I have designed a file table, which identifies which storage provider this file uses. When the file need download, I can get the blob container of the corresponding storage provider through this identifier in the file table. At present, only one provider type can be set for containers. Can we provide an AddProvider() function for TypedList? What do you think? Some code example of AspnetBoilerplate version :

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants