Commit graph

14 commits

Author SHA1 Message Date
Dan Williams ab84a86678 vpn: handle interactive plugin secrets requests
If all agents can handle VPN hints, then we'll try to use
ConnectInteractive() to let the VPN plugin ask for secrets
interactively via the SecretsRequired signal.  These hints
are then passed to agents during the connection process if
the plugin needs more secrets or different secrets, and when
the new secrets are returned, they are passed back to the VPN
plugin.

If at least one agent does not have the VPN hints capability,
we can't use ConnectInteractive(), but fall back to the old
Connect call, because that agent won't be able to send the
hints to the VPN plugin's authentication dialog, and thus
we won't get back the secrets the VPN plugin is looking for.

So, for interactive secrets to work correctly, you need:

1) A VPN plugin updated for interactive secrets requests
2) NM updated for interactive secrets requests
3) all agents to set the VPN_HINTS capability when
    registering with NetworkManager and to pass hints
    along to the VPN authentication dialog
4) a VPN authentication dialog updated to look for hints
    and only return secrets corresponding to the hints
    requested by the plugin
2013-07-31 08:16:40 -05:00
Dan Williams 16bb798861 agents: add agent capabilities
A new agent registration method enables agents to pass capabilities during
the registration process.
2013-07-31 08:16:34 -05:00
Dan Williams e1bb469f80 api: update SecretAgent API with allowed errors for GetSecrets reply 2013-06-21 16:06:44 -05:00
Dan Williams b6d2ae429f api: clarify expected agent behavior for GetSecrets and saving secrets
Agents are expected to save any new/updated secrets returned to
NetworkManager from a GetSecrets call, as it would be silly to return
those same secrets right back to the agent via SaveSecrets when the
agent is perfectly capable of saving the secrets itself without
round-tripping to NetworkManager and back.
2013-04-16 15:02:17 -05:00
Dan Williams 7b1fe5428a api: clarify some parameters of GetSecrets and CancelGetSecrets 2013-04-15 14:18:14 -05:00
Dan Williams 74e262b303 agents: add a "user-requested" flag to secret agent requests
Allows agents to provide different behavior depending on whether the
secrets request was initiated by a user (eg by picking a connection
from a UI menu or by 'nmcli con up') or was automatically started by
NetworkManager.

See https://bugzilla.gnome.org/show_bug.cgi?id=660293
2012-06-27 09:42:47 -05:00
Dan Williams 220fb52621 api: update documentation about secret agents and SaveSecrets() 2011-07-01 15:38:38 -05:00
Dan Williams aeb02e457a api: clarify meaning of 'hints' property in Agent interface
At some point we'll be passing other info like whether we need
the 802.1x identity too, or unknown CA certificate data for the
Agent to accept, etc.  Basically state that instead of only
hints from the setting, we can pass other stuff as well.
2011-04-19 12:57:49 -05:00
Dan Williams 77239854f4 agents: send system-owned secrets to the agent if it has 'modify' permission
If we can authenticate the agent for 'modify' permission, then send
any existing system secrets to it as the user has permission to change
those secrets.  This means the agent doesn't have to call GetSecrets()
itself, which means simpler code on the agent side for a slight LoC
hit in NM itself.

This also moves the permissions checking into the NMAgentManager to
check each agent, which is sub-optimal since now the agent manager
has to do PolicyKit stuff, but hey that's life.  Agents need secrets,
and we do need to authenticate every agent before we send secrets to
them, and the NMSettingsConnection doesn't know about individual
agents at all.
2011-02-02 16:19:15 -06:00
Dan Williams 570c0eb2df settings: implement deleting secrets from agents when connection is deleted 2011-01-31 23:33:46 -06:00
Dan Williams 9cf13cc3e1 agent: request_new -> flags
Use some flags to modify GetSecrets behavior instead of just the
request_new boolean.
2011-01-18 14:17:18 -06:00
Dan Williams a2f36e8bd4 agent: add CancelGetSecrets D-Bus API
Allows NM to signal to an agent that an in-progress secrets
request is no longer needed.  This could happen if the device
for which the request was started was removed, disabled, or the
network being connected to changed, or whatever.
2011-01-18 13:19:29 -06:00
Dan Williams acd16ceeed api: fix argument direction for SecretAgent API calls 2011-01-13 14:08:36 -06:00
Dan Williams 1496f8056f libnm-glib: add secret agent base class 2010-12-14 00:03:22 -06:00