[Sugar-devel] SecretAgent.GetSecrets() return value
dsd at laptop.org
Tue Sep 6 18:03:30 EDT 2011
On Tue, Sep 6, 2011 at 10:54 PM, Dan Williams <dcbw at redhat.com> wrote:
> Not sure I follow this... you shouldn't need a secret agent if all that
> the UI is doing is Update() and AddConnection(). A secret agent is only
> required if there are any agent-provided secrets (ie, some secret has
> the flag AGENT_OWNED). If you let NM handle all secrets then no secret
> agent should be required; initial secrets get to NM via the
> Connection.Update() call, which shouldn't require a secret agent (as
> long as all secrets are not AGENT_OWNED).
The way I've implemented it at the moment is (I think) the same as
nm-applet. I implement the SecretAgent interface, but I don't set any
special flags, so the secrets do get stored by NM.
However, the first time a connection is established, NetworkManager
needs to communicate the need for secrets, Sugar then needs to request
the info from the user and communicate it to NM. I implemented
SecretAgent for that purpose, and it is working.
I think you might be suggesting that before activating a connection,
Sugar somehow queries NM to see if secrets are present, and if they
aren't, it pops up a dialog requesting them, then it modifies the
connection to add the secrets, then it activates it?
It seems roundabout but it might work, but I wonder what happens when
the secrets are wrong or the password has changed, and the user needs
to be prompted? Seems like impementing SecretAgent (for the purpose of
prompting the user when the user needs to be prompted, not for the
purpose of actually storing secrets) would smooth out those corner
cases, and it looks like nm-applet works this way.
More information about the Sugar-devel