Commits

Remy Blank  committed 6e39e32

Use platform-specific auth providers for SVN.

  • Participants
  • Parent commits 6d57458

Comments (0)

Files changed (1)

File SvnBranch.py

             self._revisionKinds.update((name, getattr(core, "svn_opt_revision_" + name)) 
                 for name in ["unspecified", "committed", "previous", "base", "working", "head"])
 
+    def get_auth_providers(self):
+        yield client.get_simple_provider()
+        yield client.get_username_provider()
+        yield client.get_ssl_server_trust_file_provider()
+        yield client.get_ssl_client_cert_file_provider()
+        yield client.get_ssl_client_cert_pw_file_provider()
+        for ptype in ("simple", "ssl_server_trust", "ssl_client_cert_pw"):
+            for pname in ("gnome_keyring", "kwallet", "keychain", "windows"):
+                provider = core.svn_auth_get_platform_specific_provider(pname, ptype)
+                if provider is not None:
+                    yield provider
+    
     @property
     def ctx(self):
         if self._ctx is None:
             self._ctx = client.ctx_t()
-            self._ctx.auth_baton = core.svn_auth_open([
-                client.get_simple_provider(),
-                client.get_username_provider(),
-                client.get_ssl_server_trust_file_provider(),
-                client.get_ssl_client_cert_file_provider(),
-                client.get_ssl_client_cert_pw_file_provider(),
-            ])
+            self._ctx.auth_baton = core.svn_auth_open(list(self.get_auth_providers()))
             self._ctx.config = core.svn_config_get_config(None)
         return self._ctx