Repository navigation
[Share 2.0] register providers - #21552
Conversation
50b44f3 to
9369a25
Compare
|
Will there ever be the need to have multiple providers of the same type? If not we can move this to pure config as we did this with the commants manager Would result in less code - and less to test .... |
|
@DeepDiver1975 no I don't think so. Because if there are multiple providers for the same type how will we know which once to use. We will need multiple providers. And multiple types per provider. Moving to config is also fine with me... @schiesbn opinion? |
|
I don't think we need mutliple providers for the same share type. From my POV this is beyond the current concept to have 10 implementations of public link sharing running at the same time. |
|
@DeepDiver1975 yeah I'm agreeing with you :P |
|
I don't think we need to support multiple providers for the same share type. I would only allow to register one provider for one share type. Even if, at some point in time, we have two share provider which do some kind of link sharing they should have two different share types. For example "linkShare" and "SuperLinkShareNG". The share type should the unique identifier which connects a share to a share provider. |
|
so - reading the classname from the config is much easier from my pov |
|
Ok let me look into that then :) |
|
Ok so after looking into it. I think it having this into config.php makes sense. Since it requires explicit action from the admin to setup the different share providers. Which I think is a good thing here. But since we will have 2 share providers at least (default and federated) I'm thinking how to represent this. And how not to complecate the setup to much. Because we need to know for which share types. So in short the code needs to stay I think. But it reduces stuff in the public name space. |
I'd leave this to the factory - the factory is the class which is defined in the config. The factory method will return the provider for the asked share type. |
|
@DeepDiver1975 you mean that we list in general 2 provider factories there. I can see that working :) |
|
One factory to rule them all. |
But if people want to deploy their own sharae provider it is likely they only want to do the 'main' share provider. But keep the federated sharing for example. Would they then need to create their own factory to create their own provider and the federated provider? |
fc038d0 to
b6dc216
Compare
|
Now using the factory apporoach. Everything still works as expected. |
There was a problem hiding this comment.
should this be public?
There was a problem hiding this comment.
yes, eventually. But I want to move that over once I also move the other interfaces to OCP
5384b26 to
761c060
Compare
|
Ok now we call the factory only in the manager. There might be more room for optimization there. But I'd like to move forward with this PR. |
332b62a to
10f1adb
Compare
There was a problem hiding this comment.
$share === null
and then drop the found
10f1adb to
4681ca9
Compare
There was a problem hiding this comment.
I'd simply forward this call to the factory - no need to build the array.
We need a provider -> ask the factory to build one and we use it.
94fe470 to
69165a5
Compare
|
Warg... this PR got bigger than intented again :( Now:
One more look please: @DeepDiver1975 @nickvergessen @schiesbn @LukasReschke |
There was a problem hiding this comment.
I will fix this in a future PR... doing it here will make it to big.
There was a problem hiding this comment.
Mind to create an issue for this? - We all know what happens to FIXMEs in the code 😉
|
move it in 👍 any chance in squashing some of these commits? |
* Properly register the default share provider
* Add providers * Add share manager to server container * Use share manager from server container * Properly get the share manager
Now that we support multiple managers we communicate shares to the outside as 'providerId:shareId'. This makes sures that id's are unique when references from the OCS API. However, since we do not want to break the OCS API v1 we need to somewhat hack around this. When we switch to OCS API v2 (which we should when we support more custom providers). We will change the id to always be the fullShareId.
* Updated unit tests (bit cleaner now)
c3e8dd7 to
5f5951c
Compare
Done! |
|
🙏 👍 |
|
nice |
[Share 2.0] register providers
For #19331
Allow registering of providers.
Lets see what CI has to say.