Hi Mark,
On 03/07/2013 15:14, Mark Ryan wrote:
Hi Ludo,
In general it looks good to me. I have a few comments, inline
On 06/27/2013 06:32 PM, Ludovic Ferrandis wrote:
> Following email about context filtering in GUPnP, see message
> <
https://mail.gnome.org/archives/gupnp-list/2013-June/msg00011.html>
>
> What would be the impacts on dLeyna?
> There will be more development for this component.
> First, there will be a white list by servers using GUPnP, that means one
> for dleyna-server and one for dleyna-renderer.
> That implies all applications using the same dLeyna component (server or
> renderer) will share the same white list.
>
> We need to provide APIs, so applications could manage their own white
> list.
> We need also to provide a signal, so applications using the same dLeyna
> component, will be warned when another application is making change to
> the white list.
>
>
> How to manage the white list?
>
> dLeyna won't store any white list. It will just provide APIs, so
> applications are going to be able to manage their own white list.
> dLeyna won't provide a default white list, nor store a default white
> list in its preferences.
>
Actually, I was thinking that the dLeyna components should store the
whitelist. As there is only really one whitelist per dLeyna service it
doesn't really make sense to require applications to manage these lists
as they don't have much control over them. I think this will lead to
confusion, e.g., the act of launching application A modifies the
security settings of the already running application B.
There are pro & cons to each solution.
It depends where you want to manage this list of entries.
In your solution, the list should be managed (to be user friendly) by a
dleyna settings application, that doesn't exist for instance.
That means also, no API to modify the list of entries. Only dLeyna is
authorized to modify it.
It could be done this way. It simplifies applications, but add more
complexity to dLeyna.
So, my feeling was the dLeyna services would store the whitelists
and
that the the APIs below would be used by a single settings application
and not by individual dLeyna applications. This way there will be no
confusion. The same settings application could provide the
corresponding settings for the DMS and the DMR, so all your DLNA
security settings would be localised in a single place.
As I explain in my first email, there are 2 solutions to store the
whitelist.
The first one, is to use the existing settings files, the second one is
to manage another settings file for whitelist.
In the first solution, the main advantage is that we already monitor the
settings file. We just need to add a new entry in the file.
The main inconvenience, is that potentially, we won't have the same
settings for the DMS & DMR.
Is it really a problem?
Another good point, the dLeyna Settings application will manage only 2
files.
The second solution is to manage another settings file only for the
whitelist.
We could have a common settings for server & renderer or a separate one.
The main inconvenience is that we should monitors 2 settings files. (But
we already have the code for that.)
>
> dLeyna dbus API:
>
> interface: com.intel.dLeynaServer.Manager
>
> Methods:
>
> WhiteListEnable(b enable) -> void
> WhiteListAddInterface(s interface) -> b
> WhiteListRemoveInterface(s interface) -> b
> WhiteListGetInterface() -> as
> WhiteListResetInterface() -> void
>
At this point, I should mention that API should be renamed to follow
GUPnP naming, and replace 'interface' by 'entry'.
It's more accurate, as 'entry' could be an interface (eth,..), a SSID,
an IP address, etc...
And it's less confusing.
From the point of view of a settings dialog, it's probably
easier if
there is a method that allows the whitelist to be replaced in one go,
e.g., WhiteListSet(as interfaces).
2 points:
- There won't be dLeyna interface to modify the whitelist. It's an entry
in a settings file. To update the settings, the application will use
GLib API.
- If we manage the WL in dLeyna, there won't be any public API (except
the one discussed below), as dLeyna will call GUPnP API, but application
have nothing to do.
Also, what happens if WhiteListEnable(True) has been called and then
we
call this WhiteListResetInterface? Does it mean we can't see any UPnP
devices?
It's the contrary. We will see ALL UPnP devices. A white list enabled
without any entry is the same as no WL. This is for compatibility issue.
Calling this method followed by WhiteListAddInterface might
not be very efficient as it might result in us losing contexts and then
regaining them, i.e., DMSs might disappear and then re-appear.
More or less. If enabled = true at each call to WhiteListAddInterface,
potentially one or more servers could disappear.
if enabled = false, at each call to WhiteListAddInterface, nothing
happen. When changing enabled to true, you will receive all
notifications at this time.
Depending on the actions provided on the white list, we could not have
any overhead.
But if we move WL in dLeyna, all these API won't exist (except the one
discussed below)
So having said all this, my feeling is that something like
WhiteListSet(as interfaces) -> void
would be better than
> WhiteListAddInterface(s interface) -> b
> WhiteListRemoveInterface(s interface) -> b
> WhiteListResetInterface() -> void
Internally, dLeyna can translate WhiteListSet into the appropriate
whitelist_add and remove calls.
No more needed, as application doesn't have the right to manage the
whitelist directly. No need for API.
And for the dLeyna Settings App, GLib provide API for managing settings
file.
> WhiteListGetInterface() -> as
This should probably be WhiteListGetInterfaces, right? What does this
return? The list of interfaces in the whitelist or the list of current
active interfaces on the device. If it's the former, how does the
application work out work what values it can pass to
WhiteListAddInterface? Does it need to go to the network manager to
retrieve this information? Is there any way we could provide a
convenience method that would allow applications to easily retrieve this
information?
Bad naming => misunderstanding. Sorry for the confusion.
It should be WhiteListGetEntries and should return the list of entries
that compose the white list.
So, to resume, if we manage the WL in dLeyna, it simplifies a lot the API.
We don't need API to retrieve the white list. We can add it as a
property and use standard DBUS API for that.
We can let applications enable/disable WL. It could help them to scan a
network without modifying the WL.
Propositions & options:
Signal:
WhiteListChanged(asb)
Return the list of entries currently in the white list(as) and the state
of the WL (b), enabled or disabled.
This signal is raised each time the white list content or state is modified.
Properties:
WhiteListEnabled -> b
WhiteListEntries -> as (read only)
OPTIONS:
About WhiteListEnabled we can manage it in 2 ways:
1 - Specific API
WhiteListEnable(b enable) -> void
In this case, the property WhiteListEnabled is read only, and can be
retrieved with the DBUS properties API
2 - DBUS properties API
We don't add a specific API and use DBUS properties API to set and get
the values.
If we want a single WL for all dLeyna components, the safe way is to
manage another file. If we manage the setting entry in each already
existing settings file, we can have different valus (the file could be
edited manually, not only with an application). And we should take care
of this case.
If we want a WL for dleyna-server and one for dleyna-renderer, then we
can just add new entries in the current settings files.
My opinions is that we don't have the same needs for server & renderer.
In one case we get data, in the other, we send data. So I'm in favor of
separate WL for dleyna-server and dleyna-renderer.
About the properties, I'm in favor of using DBUS properties API, to
avoid to introduce mixed API, one for get, another one for set.
Ludo
--
Ludovic Ferrandis
Open Source Technology Center
Intel Corporation