svn commit: samba r26062 - in branches/4.0-python: .
source/auth/credentials source/auth/credentials/tests
jelmer at samba.org
jelmer at samba.org
Tue Nov 20 12:52:56 GMT 2007
Author: jelmer
Date: 2007-11-20 12:52:55 +0000 (Tue, 20 Nov 2007)
New Revision: 26062
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26062
Log:
Add bindings for some more credentials functions.
Modified:
branches/4.0-python/
branches/4.0-python/.bzrignore
branches/4.0-python/source/auth/credentials/credentials.i
branches/4.0-python/source/auth/credentials/tests/bindings.py
Changeset:
Property changes on: branches/4.0-python
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:file-ids
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...
Modified: branches/4.0-python/.bzrignore
===================================================================
--- branches/4.0-python/.bzrignore 2007-11-20 12:52:51 UTC (rev 26061)
+++ branches/4.0-python/.bzrignore 2007-11-20 12:52:55 UTC (rev 26062)
@@ -233,3 +233,5 @@
source/auth/auth.py
source/dsdb/schema/proto.h
source/lib/ldb/build
+source/auth/auth_wrap.c
+source/auth/auth_util.h
Modified: branches/4.0-python/source/auth/credentials/credentials.i
===================================================================
--- branches/4.0-python/source/auth/credentials/credentials.i 2007-11-20 12:52:51 UTC (rev 26061)
+++ branches/4.0-python/source/auth/credentials/credentials.i 2007-11-20 12:52:55 UTC (rev 26062)
@@ -67,5 +67,17 @@
void parse_string(const char *text,
enum credentials_obtained=CRED_SPECIFIED);
+
+ /* bind dn */
+ const char *get_bind_dn(void);
+ bool set_bind_dn(const char *bind_dn);
+
+ /* workstation name */
+ const char *get_workstation(void);
+ bool set_workstation(const char *workstation,
+ enum credentials_obtained obtained=CRED_SPECIFIED);
+
+ void guess(void);
+ bool is_anonymous(void);
}
} cli_credentials;
Modified: branches/4.0-python/source/auth/credentials/tests/bindings.py
===================================================================
--- branches/4.0-python/source/auth/credentials/tests/bindings.py 2007-11-20 12:52:51 UTC (rev 26061)
+++ branches/4.0-python/source/auth/credentials/tests/bindings.py 2007-11-20 12:52:55 UTC (rev 26062)
@@ -50,3 +50,20 @@
self.assertEquals("someone", self.creds.get_username())
self.assertEquals("secr", self.creds.get_password())
self.assertEquals("DOM", self.creds.get_domain())
+
+ def test_bind_dn(self):
+ self.assertEquals(None, self.creds.get_bind_dn())
+ self.creds.set_bind_dn("dc=foo,cn=bar")
+ self.assertEquals("dc=foo,cn=bar", self.creds.get_bind_dn())
+
+ def test_is_anon(self):
+ self.creds.set_username("")
+ self.assertTrue(self.creds.is_anonymous())
+ self.creds.set_username("somebody")
+ self.assertFalse(self.creds.is_anonymous())
+
+ def test_workstation(self):
+ # FIXME: This is uninitialised, it should be None
+ #self.assertEquals(None, self.creds.get_workstation())
+ self.creds.set_workstation("myworksta")
+ self.assertEquals("myworksta", self.creds.get_workstation())
More information about the samba-cvs
mailing list