[X2Go-Commits] x2gobroker.git - build-main (branch) updated: 0.0.1.0-10-g26dd010

X2Go dev team git-admin at x2go.org
Sun May 19 13:03:32 CEST 2013


The branch, build-main has been updated
  discards  3fd14f204a2f570d88c95b455fdcffd57b99ed4e (commit)
  discards  870b98422e7e2ceff6e2f2c5f90172e63109b75a (commit)
  discards  8546ee4fcd4c094b1a1a7a04ba81ed549055920e (commit)
  discards  b57e5c7d732c94056ded5046bd2f475074a3d933 (commit)
  discards  ac6024e007f2a0f5a63d82513a7370c72378925a (commit)
  discards  bf62865e24d79f1c697c2ff2d353c52001e41041 (commit)
  discards  3366ab187d971a0de2bf2f13d33c02e24ce77ed5 (commit)
  discards  87e0d33ee82cbbc48ff738d5fa33a49a7b9f904f (commit)
  discards  f5c77c7654c180c9f55f175b9dc2a611a4a26a1c (commit)
  discards  12ace4ff77e043274948ada6f13ffedc5e561d26 (commit)
  discards  d3a17b136b23755840e13547152011193c2febe9 (commit)
  discards  cbe481e17814bf14404b4adc95fc6ae53efa52a1 (commit)
  discards  5f08ed5c43d6c8c96515f5628d3a60cb0c386ab7 (commit)
  discards  a505addd53fee98a0445278c838447b4b20e3d1b (commit)
  discards  9ec668c96ad7a70e1024194c3f7eae7ea3e9e6ba (commit)
  discards  b075080bcd2a1510f4ac820f752580000712e509 (commit)
  discards  d76dcd7f32e82452e74e167ff9de4020403ecb84 (commit)
  discards  b24fe4ed32dc3f3066f20b4f93f1df5bbbdaa778 (commit)
  discards  b440438bdbdcdd248957f6e2e0cfe4deaab895b5 (commit)
  discards  830502fcaa69733d4c5f6561d335a5f7032c4baa (commit)
  discards  317325dd112ba89775ff81984ef985f061a81b21 (commit)
  discards  2cee942cb70599dd79ef3cf7f93fc2aeaa950472 (commit)
  discards  0beb6626be0dd1c9d0363435268def8df85f1380 (commit)
  discards  d14d83a114d66019fe9fa031f3a367c65224cf6a (commit)
  discards  8130c9d12e3447fda3064b4b3f1ba0aef1015341 (commit)
  discards  00fb61c3429809f7511f7bda5667a77facd96918 (commit)
  discards  e341bd86111730b2919697a74ac18d759d2a9e74 (commit)
  discards  c9c92dbff6b4e9ee872eb738121dbd51da94d329 (commit)
  discards  1734e9987eebeaf7574c42c28b92f010fb827008 (commit)
  discards  cd9500b7a1d12cd973af7726dbead83b79bc8581 (commit)
  discards  890debb62b31a29ed482d392e7d276c5d9936d90 (commit)
  discards  aea8e30472982caf3be18c73e3175becfc6d6b4a (commit)
  discards  19582aa37e0e3cab202c43cd7497d791cbeee1b3 (commit)
       via  26dd0105562fbdebc0662b8f86d78a3a8d71c2fa (commit)
       via  ca33ea93056615c370586d9f1054b29695b56393 (commit)
       via  6089879c268eaafb9cd3bdc76dc9f06346ef592f (commit)
       via  bff088d523cccbcbe5c6836eaf61e05bc2145df7 (commit)
       via  1298863cc62b9167f4a270cf5262d8d234fe56b0 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (3fd14f204a2f570d88c95b455fdcffd57b99ed4e)
            \
             N -- N -- N (26dd0105562fbdebc0662b8f86d78a3a8d71c2fa)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                            |    2 -
 etc/broker/x2gobroker-sessionprofiles.conf  |    4 +-
 etc/x2gobroker.conf                         |    3 -
 sbin/x2gobroker                             |    2 -
 x2gobroker/authservice.py                   |    2 -
 x2gobroker/brokers/zeroconf_broker.py       |    7 +-
 x2gobroker/defaults.py                      |    5 +-
 x2gobroker/tests/test_broker_base.py        |    4 +-
 x2gobroker/tests/test_broker_inifile.py     |  142 +++-------------
 x2gobroker/tests/test_broker_zeroconf.py    |    2 -
 x2gobroker/tests/test_web_plain_zeroconf.py |    9 +-
 x2gobroker/tests/test_web_uccs_zeroconf.py  |   80 ---------
 x2gobroker/uccsjson.py                      |  241 ---------------------------
 x2gobroker/web/uccs.py                      |  128 --------------
 14 files changed, 35 insertions(+), 596 deletions(-)
 delete mode 100644 x2gobroker/tests/test_web_uccs_zeroconf.py
 delete mode 100644 x2gobroker/uccsjson.py
 delete mode 100644 x2gobroker/web/uccs.py

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 0b12a34..07e81e1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,8 +3,6 @@ x2gobroker (0.0.1.1-0~x2go1) UNRELEASED; urgency=low
   * New upstream version (0.0.1.1):
     - Add WSGI support to X2Go Session Broker. Allows plugging into
       Apache2 by using the mod_wsgi module.
-    - Add cmd and directrdp session profile parameters to defaults.
-    - Fix wrong usage of session option »cmd«, has to be »command«.
     - For sessions profiles with autologin enable, add a dummy key
       session profile parameter that triggers key based auth in X2Go Client.
       (Fixes: #154).
diff --git a/etc/broker/x2gobroker-sessionprofiles.conf b/etc/broker/x2gobroker-sessionprofiles.conf
index 8d060ec..dc79a6b 100644
--- a/etc/broker/x2gobroker-sessionprofiles.conf
+++ b/etc/broker/x2gobroker-sessionprofiles.conf
@@ -29,7 +29,6 @@
 
 
 [DEFAULT]
-command=TERMINAL
 defsndport=true
 useiconv=false
 iconvfrom=UTF-8
@@ -53,14 +52,13 @@ applications=TERMINAL,WWWBROWSER,MAILCLIENT,OFFICE
 multidisp=false
 sshproxyport=22
 sound=true
-rootless=true
+rootless=false
 iconvto=UTF-8
 soundtunnel=true
 dpi=96
 sshport=22
 setdpi=0
 pack=16m-jpeg
-directrdp=false
 
 ### EXAMPLES: Below you find some config examples. Adapt them to your needs or
 ### simply write your own session profiles and remove the examples below.
diff --git a/etc/x2gobroker.conf b/etc/x2gobroker.conf
index 85eaa77..24a530f 100644
--- a/etc/x2gobroker.conf
+++ b/etc/x2gobroker.conf
@@ -71,9 +71,6 @@
 # enable {base_url}/plain/
 #enable-plain-output = true
 
-# enable {base_url}/uccs/
-#enable-uccs-output = false
-
 # enable {base_url}/json/ (THIS IS FUTURE, mg-20121129)
 #enable-json-output = false
 
diff --git a/sbin/x2gobroker b/sbin/x2gobroker
index 5abd86d..a092172 100755
--- a/sbin/x2gobroker
+++ b/sbin/x2gobroker
@@ -107,14 +107,12 @@ if __name__ == "__main__":
 
 # import classes serving the different web.py URLs
 import x2gobroker.web.plain
-import x2gobroker.web.uccs
 #import x2gobroker.web.json
 #import x2gobroker.web.html
 import x2gobroker.web.extras
 
 # define the web.py URLs
 urls = ( ('/plain/(.*)', x2gobroker.web.plain.X2GoBrokerWeb,),
-         ('/uccs/(.*)', x2gobroker.web.uccs.X2GoBrokerWeb,),
 #        ('/json/(.*)', x2gobroker.web.json.X2GoBrokerWeb,),
 #        ('/html/(.*)', x2gobroker.web.html.X2GoBrokerWeb,),
          ('/pubkeys/', x2gobroker.web.extras.X2GoBrokerPubKeyService,),
diff --git a/x2gobroker/authservice.py b/x2gobroker/authservice.py
index bebc2ab..df97435 100644
--- a/x2gobroker/authservice.py
+++ b/x2gobroker/authservice.py
@@ -91,9 +91,7 @@ def loop():
 
 def authenticate(username, password, service="x2gobroker"):
     s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-    logger_authservice.debug('connecting to authentication service socket {socket}'.format(socket=X2GOBROKER_AUTHSERVICE_SOCKET))
     s.connect(X2GOBROKER_AUTHSERVICE_SOCKET)
-    logger_authservice.debug('sending username={username}, password=<hidden>, service={service} to authentication service'.format(username=username, service=service))
     s.send('{username} {password} {service}\n'.format(username=username, password=password, service=service))
     result = s.recv(1024)
     s.close()
diff --git a/x2gobroker/brokers/zeroconf_broker.py b/x2gobroker/brokers/zeroconf_broker.py
index 6cb83ad..5970659 100644
--- a/x2gobroker/brokers/zeroconf_broker.py
+++ b/x2gobroker/brokers/zeroconf_broker.py
@@ -36,7 +36,7 @@ class X2GoBroker(base.X2GoBroker):
 
     def list_profiles(self, username):
 
-        _list_of_profiles = {
+        list_of_profiles = {
             uuid.uuid4(): {
                 'user': u'',
                 'defsndport': True,
@@ -74,11 +74,6 @@ class X2GoBroker(base.X2GoBroker):
                 'pack': u'16m-jpeg',
             },
         }
-        list_of_profiles = {}
-        for profile_id in _list_of_profiles.keys():
-            profile = self.get_profile_defaults()
-            profile.update(_list_of_profiles[profile_id])
-            list_of_profiles[profile_id] = profile
         return list_of_profiles
 
     def select_session(self, profile_id, username=None):
diff --git a/x2gobroker/defaults.py b/x2gobroker/defaults.py
index 7f1f3c8..ee5d7f8 100644
--- a/x2gobroker/defaults.py
+++ b/x2gobroker/defaults.py
@@ -118,7 +118,6 @@ X2GOBROKER_CONFIG_DEFAULTS = {
         u'use-static-cookie': False,
         u'my-cookie': uuid.uuid4(),
         u'enable-plain-output': True,
-        u'enable-uccs-output': False,
         u'enable-json-output': False,
         u'enable-html-output':  False,
         u'default-auth-mech': u'pam',
@@ -161,7 +160,6 @@ X2GOBROKER_CONFIG_DEFAULTS = {
 # defaults for X2Go Sessino Broker session profiles file
 X2GOBROKER_SESSIONPROFILE_DEFAULTS = {
     u'DEFAULT': {
-        u'command': u'TERMINAL',
         u'defsndport': True,
         u'useiconv': False,
         u'iconvfrom': u'UTF-8',
@@ -185,7 +183,7 @@ X2GOBROKER_SESSIONPROFILE_DEFAULTS = {
         u'multidisp': False,
         u'sshproxyport': 22,
         u'sound': True,
-        u'rootless': True,
+        u'rootless': False,
         u'iconvto': u'UTF-8',
         u'soundtunnel': True,
         u'dpi': 96,
@@ -194,7 +192,6 @@ X2GOBROKER_SESSIONPROFILE_DEFAULTS = {
         u'pack': u'16m-jpeg',
         u'user': '',
         u'host': [ u'localhost', ],
-        u'directrdp': False,
         u'acl-users-allow': [],
         u'acl-users-deny': [],
         u'acl-users-order': '',
diff --git a/x2gobroker/tests/test_broker_base.py b/x2gobroker/tests/test_broker_base.py
index 1371724..0bda18e 100644
--- a/x2gobroker/tests/test_broker_base.py
+++ b/x2gobroker/tests/test_broker_base.py
@@ -274,7 +274,6 @@ check-credentials = false
     def test_getdefaultprofile(self):
         base_backend = self._init_base_backend()
         _expected_profile = {
-            'command': 'TERMINAL',
             'defsndport': True,
             'useiconv': False,
             'iconvfrom': 'UTF-8',
@@ -298,7 +297,7 @@ check-credentials = false
             'multidisp': False,
             'sshproxyport': 22,
             'sound': True,
-            'rootless': True,
+            'rootless': False,
             'iconvto': 'UTF-8',
             'soundtunnel': True,
             'dpi': 96,
@@ -307,7 +306,6 @@ check-credentials = false
             'pack': '16m-jpeg',
             'user': '',
             'host': [u'localhost'],
-            'directrdp': False,
         }
         _profile = base_backend.get_profile_defaults()
         self.assertEqual(len(_expected_profile.keys()), len(_profile.keys()))
diff --git a/x2gobroker/tests/test_broker_inifile.py b/x2gobroker/tests/test_broker_inifile.py
index 6bc62f8..35b4289 100644
--- a/x2gobroker/tests/test_broker_inifile.py
+++ b/x2gobroker/tests/test_broker_inifile.py
@@ -47,96 +47,6 @@ class TestX2GoBrokerBackendInifile(unittest.TestCase):
         for _profile_id in _profile_ids:
             self.assertTrue( ( 'default' not in inifile_backend.get_profile(_profile_id).keys() ) )
 
-    # TEST COMPLETION OF DEFAULTS FROM CODE IN defaults.py
-
-    def test_getprofilecompletion(self):
-        _session_profiles = """
-[DEFAULT]
-exports =
-fullscreen = false
-width = 800
-height = 600
-applications = TERMINAL, WWWBROWSER
-
-[testprofile]
-user = foo
-command = GNOME
-
-"""
-        tf = tempfile.NamedTemporaryFile()
-        print >> tf, _session_profiles
-        tf.seek(0)
-        inifile_backend = inifile.X2GoBroker(profile_config_file=tf.name)
-        _expected_defaults = copy.deepcopy(x2gobroker.defaults.X2GOBROKER_SESSIONPROFILE_DEFAULTS['DEFAULT'])
-        for key in copy.deepcopy(_expected_defaults).keys():
-            if key.startswith('acl-'):
-                del _expected_defaults[key]
-        _expected_defaults.update( {
-            u'exports': '',
-            u'fullscreen': False,
-            u'width': 800,
-            u'height': 600,
-            u'applications': ['TERMINAL','WWWBROWSER',],
-            u'user': 'foo',
-            u'command': 'GNOME',
-        } )
-        # just testing the directrdp hard-coded defaults
-        _expected_defaults.update( {
-            u'directrdp': False,
-        } )
-        _expected_profile = copy.deepcopy(_expected_defaults)
-        _profile = inifile_backend.get_profile('testprofile')
-        print _expected_defaults
-        for key in _expected_profile.keys():
-            self.assertTrue( ( key in _profile.keys() ) )
-        for key in _profile.keys():
-            self.assertTrue( ( key in _expected_profile.keys()  and _profile[key] == _expected_profile[key] ) )
-
-    # TEST COMPLETION OF DEFAULTS FROM CODE IN defaults.py
-
-    def test_getprofilecompletion(self):
-        _session_profiles = """
-[DEFAULT]
-exports =
-fullscreen = false
-width = 800
-height = 600
-applications = TERMINAL, WWWBROWSER
-
-[testprofile]
-user = foo
-command = GNOME
-
-"""
-        tf = tempfile.NamedTemporaryFile()
-        print >> tf, _session_profiles
-        tf.seek(0)
-        inifile_backend = inifile.X2GoBroker(profile_config_file=tf.name)
-        _expected_defaults = copy.deepcopy(x2gobroker.defaults.X2GOBROKER_SESSIONPROFILE_DEFAULTS['DEFAULT'])
-        for key in copy.deepcopy(_expected_defaults).keys():
-            if key.startswith('acl-'):
-                del _expected_defaults[key]
-        _expected_defaults.update( {
-            u'exports': '',
-            u'fullscreen': False,
-            u'width': 800,
-            u'height': 600,
-            u'applications': ['TERMINAL','WWWBROWSER',],
-            u'user': 'foo',
-            u'command': 'GNOME',
-        } )
-        # just testing the directrdp hard-coded defaults
-        _expected_defaults.update( {
-            u'directrdp': False,
-        } )
-        _expected_profile = copy.deepcopy(_expected_defaults)
-        _profile = inifile_backend.get_profile('testprofile')
-        for key in _expected_profile.keys():
-            self.assertTrue( ( key in _profile.keys() ) )
-        for key in _profile.keys():
-            self.assertTrue( ( key in _expected_profile.keys()  and _profile[key] == _expected_profile[key] ) )
-
-
     ### TEST SESSION PROFILES: get_profile_defaults()
 
     def test_getprofiledefaults(self):
@@ -164,16 +74,16 @@ applications = TERMINAL, WWWBROWSER
 
 [testprofile1]
 user = foo
-command = GNOME
+cmd = GNOME
 
 [testprofile2]
 user = bar
-command = KDE
+cmd = KDE
 fullscreen = true
 
 [testprofile3]
 user = bar
-command = KDE
+cmd = KDE
 fullscreen = true
 acl-users-deny = ALL
 acl-users-allow = foo,bar
@@ -192,23 +102,23 @@ acl-users-order = deny-allow
             u'fullscreen': False,
             u'width': 800,
             u'height': 600,
-            u'applications': ['TERMINAL','WWWBROWSER',],
+            u'applications': ['TERMINAL','WWWBROWSER',]
         } )
         _expected_profile1 = copy.deepcopy(_expected_defaults)
         _expected_profile1.update({
             u'user': 'foo',
-            u'command': 'GNOME',
+            u'cmd': 'GNOME',
         })
         _expected_profile2 = copy.deepcopy(_expected_defaults)
         _expected_profile2.update({
             u'user': 'bar',
-            u'command': 'KDE',
+            u'cmd': 'KDE',
             u'fullscreen': True,
         })
         _expected_profile3 = copy.deepcopy(_expected_defaults)
         _expected_profile3.update({
             u'user': 'bar',
-            u'command': 'KDE',
+            u'cmd': 'KDE',
             u'fullscreen': True,
         })
         _profile1 = inifile_backend.get_profile('testprofile1')
@@ -244,16 +154,16 @@ acl-clients-allow = 10.0.0.0/16,10.1.0.0/16,admin-1.intern,admin-2.intern
 
 [testprofile1]
 user = foo
-command = GNOME
+cmd = GNOME
 
 [testprofile2]
 user = foo
-command = GNOME
+cmd = GNOME
 acl-clients-deny = 10.0.2.0/24,ALL
 
 [testprofile3]
 user = bar
-command = KDE
+cmd = KDE
 fullscreen = true
 acl-users-deny = ALL
 acl-users-allow = foo,bar
@@ -313,15 +223,15 @@ applications = TERMINAL, WWWBROWSER
 
 [testprofile1]
 user =
-command = GNOME
+cmd = GNOME
 
 [testprofile2]
 user =
-command = XFCE
+cmd = XFCE
 
 [testprofile3]
 user =
-command = KDE
+cmd = KDE
 fullscreen = true
 """
         tf = tempfile.NamedTemporaryFile()
@@ -363,21 +273,21 @@ acl-groups-order = deny-allow
 
 [testprofile1]
 user =
-command = GNOME
+cmd = GNOME
 acl-users-allow = flip
 acl-users-deny = ALL
 acl-users-order = deny-allow
 
 [testprofile2]
 user =
-command = XFCE
+cmd = XFCE
 acl-users-allow = thekla
 acl-users-deny = ALL
 acl-users-order = deny-allow
 
 [testprofile3]
 user =
-command = KDE
+cmd = KDE
 fullscreen = true
 acl-users-deny = willi
 acl-users-order = deny-allow
@@ -392,40 +302,40 @@ acl-users-order = deny-allow
         list_of_profile_ids = list_of_profiles.keys()
         list_of_profile_ids.sort()
         self.assertEqual(list_of_profile_ids, ['testprofile1'])
-        self.assertEqual(list_of_profiles['testprofile1']['command'], 'GNOME')
+        self.assertEqual(list_of_profiles['testprofile1']['cmd'], 'GNOME')
 
         username_m = 'maja'
         list_of_profiles = inifile_backend.list_profiles(username_m)
         list_of_profile_ids = list_of_profiles.keys()
         list_of_profile_ids.sort()
         self.assertEqual(list_of_profile_ids, ['testprofile1', 'testprofile2', 'testprofile3'])
-        self.assertEqual(list_of_profiles['testprofile1']['command'], 'GNOME')
-        self.assertEqual(list_of_profiles['testprofile2']['command'], 'XFCE')
-        self.assertEqual(list_of_profiles['testprofile3']['command'], 'KDE')
+        self.assertEqual(list_of_profiles['testprofile1']['cmd'], 'GNOME')
+        self.assertEqual(list_of_profiles['testprofile2']['cmd'], 'XFCE')
+        self.assertEqual(list_of_profiles['testprofile3']['cmd'], 'KDE')
 
         username_k = 'kassandra'
         list_of_profiles = inifile_backend.list_profiles(username_k)
         list_of_profile_ids = list_of_profiles.keys()
         list_of_profile_ids.sort()
         self.assertEqual(list_of_profile_ids, ['testprofile1', 'testprofile2', 'testprofile3'])
-        self.assertEqual(list_of_profiles['testprofile1']['command'], 'GNOME')
-        self.assertEqual(list_of_profiles['testprofile2']['command'], 'XFCE')
-        self.assertEqual(list_of_profiles['testprofile3']['command'], 'KDE')
+        self.assertEqual(list_of_profiles['testprofile1']['cmd'], 'GNOME')
+        self.assertEqual(list_of_profiles['testprofile2']['cmd'], 'XFCE')
+        self.assertEqual(list_of_profiles['testprofile3']['cmd'], 'KDE')
 
         username_t = 'thekla'
         list_of_profiles = inifile_backend.list_profiles(username_t)
         list_of_profile_ids = list_of_profiles.keys()
         list_of_profile_ids.sort()
         self.assertEqual(list_of_profile_ids, ['testprofile2'])
-        self.assertEqual(list_of_profiles['testprofile2']['command'], 'XFCE')
+        self.assertEqual(list_of_profiles['testprofile2']['cmd'], 'XFCE')
 
         username_w = 'willi'
         list_of_profiles = inifile_backend.list_profiles(username_w)
         list_of_profile_ids = list_of_profiles.keys()
         list_of_profile_ids.sort()
         self.assertEqual(list_of_profile_ids, ['testprofile1', 'testprofile2'])
-        self.assertEqual(list_of_profiles['testprofile1']['command'], 'GNOME')
-        self.assertEqual(list_of_profiles['testprofile2']['command'], 'XFCE')
+        self.assertEqual(list_of_profiles['testprofile1']['cmd'], 'GNOME')
+        self.assertEqual(list_of_profiles['testprofile2']['cmd'], 'XFCE')
 
     ### TEST: select_session() method
 
diff --git a/x2gobroker/tests/test_broker_zeroconf.py b/x2gobroker/tests/test_broker_zeroconf.py
index 485e8bd..0e97b66 100644
--- a/x2gobroker/tests/test_broker_zeroconf.py
+++ b/x2gobroker/tests/test_broker_zeroconf.py
@@ -63,8 +63,6 @@ class TestX2GoBrokerBackendZeroconf(unittest.TestCase):
                 'sshport': 22,
                 'setdpi': 0,
                 'pack': u'16m-jpeg',
-                # make sure, hard-coded defaults end up in the list_profiles() output of the zeroconf backend, as well
-                'directrdp': False,
             },
         }
         zeroconf_backend = x2gobroker.brokers.zeroconf_broker.X2GoBroker()
diff --git a/x2gobroker/tests/test_web_plain_zeroconf.py b/x2gobroker/tests/test_web_plain_zeroconf.py
index 8b98daf..dad829b 100644
--- a/x2gobroker/tests/test_web_plain_zeroconf.py
+++ b/x2gobroker/tests/test_web_plain_zeroconf.py
@@ -52,10 +52,11 @@ desktop-shell = KDE
         r.mustcontain('START_USER_SESSIONS')
         r.mustcontain('command=KDE')
         r.mustcontain('END_USER_SESSIONS')
-        r.mustcontain(no='<BR>',)
-        r.mustcontain(no='<br>',)
-        r.mustcontain(no='<BR />', )
-        r.mustcontain(no='<br />', )
+        # FIXME: get html tags out of the text/plain web renderer, needs patching of X2Go Client
+        #r.mustcontain(no='<BR>',)
+        #r.mustcontain(no='<br>',)
+        #r.mustcontain(no='<BR />', )
+        #r.mustcontain(no='<br />', )
         tf.close()
         _config = """
 [zeroconf]
diff --git a/x2gobroker/tests/test_web_uccs_zeroconf.py b/x2gobroker/tests/test_web_uccs_zeroconf.py
deleted file mode 100644
index 6c5d2b5..0000000
--- a/x2gobroker/tests/test_web_uccs_zeroconf.py
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Copyright (C) 2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
-#
-# X2Go Session Broker is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# X2Go Session Broker is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
-import unittest
-import tempfile
-from paste.fixture import TestApp
-from nose.tools import *
-import tornado.wsgi
-import json
-
-# Python X2GoBroker modules
-import x2gobroker.defaults
-import x2gobroker.web.uccs
-
-urls = ( ('/uccs/(.*)', x2gobroker.web.uccs.X2GoBrokerWeb,) ,)
-application = tornado.wsgi.WSGIApplication(urls)
-
-class TestX2GoBrokerWebUccsZeroConf(unittest.TestCase):
-
-    ### TEST TASK: listsessions (you can influence the session command via the X2Go Broker's configurationfile)
-
-    def test_listsessions(self):
-        _expected_result = {
-            u'URL': u'http://localhost:8080/uccs/zeroconf',
-            u'AdditionalManagementServers': [],
-            u'Name': u'X2Go Session Broker',
-            u'RemoteDesktopServers': [
-                {
-                    u'Username': u'',
-                    u'Protocol': u'x2go',
-                    u'Name': u'LOCALHOST',
-                    u'URL': u'localhost:22',
-                    u'SessionTypeRequired': True,
-                    u'Password': None
-                },
-            ],
-        }
-        _config = """
-[global]
-enable-uccs-output=true
-
-[zeroconf]
-enable = true
-auth-mech = testsuite
-desktop-shell = KDE
-"""
-        tf = tempfile.NamedTemporaryFile()
-        print >> tf, _config
-        tf.seek(0)
-        x2gobroker.defaults.X2GOBROKER_CONFIG = tf.name
-        testApp = TestApp(application)
-        r = testApp.get('/uccs/zeroconf/', params={'user': 'test', 'password': 'sweet',  'task': 'listsessions', }, expect_errors=True)
-        assert_equal(r.status, 200)
-        body = r.normal_body
-        result = json.loads(body)
-        self.assertEqual(_expected_result, result)
-        tf.close()
-
-
-def test_suite():
-    from unittest import TestSuite, makeSuite
-    suite = TestSuite()
-    suite.addTest(makeSuite(TestX2GoBrokerWebUccsZeroConf))
-    return suite
diff --git a/x2gobroker/uccsjson.py b/x2gobroker/uccsjson.py
deleted file mode 100644
index abbcd80..0000000
--- a/x2gobroker/uccsjson.py
+++ /dev/null
@@ -1,241 +0,0 @@
-# Copyright (C) 2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
-# Copyright (C) 2012 by Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
-# Copyright (C) 2012 by Heinz-Markus Graesing <heinz-m.graesing at obviously-nice.de>
-#
-# X2Go Session Broker is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# X2Go Session Broker is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
-import json
-
-def convert_to_builtin_type(obj):
-    """\
-    Helper function for converting Python objects to dictionaries.
-    Used for doing JSON dumps.
-
-    """
-    d = { }
-    d.update(obj.__dict__)
-    return d
-
-class ManagementServer():
-    """\
-    Base class for generating UCCS compatible JSON object.
-
-    """
-    def __init__(self, url, name):
-        """\
-        Initializ instance.
-
-        @param url: URL of the UCCS broker server
-        @type url: C{unicode}
-        @param name: human-readable, descriptive server name
-        @type name: C{unicode}
-
-        """
-        self.RemoteDesktopServers = []
-        self.AdditionalManagementServers = []
-        self.URL = url
-        self.Name = name
-
-    def set_default(self, ts_name):
-        """\
-        Define the default (terminal) server instance.
-
-        @param ts_name: name of the terminal server that is to be set as default
-        @type ts_name: C{unicode}
-
-        """
-        if isinstance(tsName, str):
-            self.DefaultServer = tsName
-        else:
-            raise TypeError("set_default expects a string argument")
-
-    def add_terminalserver(self, server):
-        """\
-        Add a terminal server to this management server object.
-
-        @param server: instance of class L{RDPServer} or L{X2GoServer}.
-        @type server: C{obj}
-
-        """
-        self.RemoteDesktopServers.append(server)
-
-    # NOT USED!!!
-    #def add_additional_management_server(self, amserver):
-    #    if isinstance(amserver, AdditionalManagementServer):
-    #        self.AdditionalManagementServers.append(amserver)
-    #    else:
-    #        raise TypeError("add_additional_management_server expects a "\
-    #            "AdditionalManagementServer argument")
-
-    def toJson(self):
-        """\
-        Dump this instance as JSON object.
-
-        """
-        return json.dumps(self, default=convert_to_builtin_type)
-
-
-# NOT USED!!!
-#class AdditionalManagementServer():
-#    def __init__(self, url, name):
-#        self.URL = url
-#        self.Name = name
-
-
-class RDPServer():
-    """\
-    Instantiate a UCCS compatible RDP server session profile object.
-
-    """
-    def __init__(self, host, name, username=None, password=None):
-        """\
-        @param host: hostname of RDP server host
-        @type host: C{unicode}
-        @param name: session profile name
-        @type name: C{unicode}
-        @param username: username to be used for login
-        @type username: C{unicode}
-        @param password: password to be used for login
-        @type password: C{unicode}
-
-        """
-        self.URL = unicode(host)
-        self.Name = unicode(name)
-        self.Protocol = u'freerdp'
-        self.DomainRequired = unicode(True)
-        self.Username = unicode(username)
-        self.Password = unicode(password)
-
-    def set_domain(self, domain):
-        """\
-        Set the domain for this RDP server.
-
-        @param domain: the domain name to be set
-        @type domain: C{unicode}
-
-        @raise TypeError: domain has to be C{str} or C{unicode}
-
-        """
-        if isinstance(domainName, str):
-            self.WindowsDomain = unicode(domain)
-        elif isinstance(domainName, unicode):
-            self.WindowsDomain = domain
-        else:
-            raise TypeError("set_domain() expects a string or unicode argument")
-
-    def toJson(self):
-        """\
-        Dump this instance as JSON object.
-
-        """
-        return json.dumps(self, default=convert_to_builtin_type)
-
-
-class ICAServer():
-    """\
-    Instantiate a UCCS compatible ICA server session profile object.
-
-    """
-    def __init__(self, host, name, username=None, password=None):
-        """\
-        @param host: hostname of ICA server host
-        @type host: C{unicode}
-        @param name: session profile name
-        @type name: C{unicode}
-        @param username: username to be used for login
-        @type username: C{unicode}
-        @param password: password to be used for login
-        @type password: C{unicode}
-
-        """
-        self.URL = unicode(host)
-        self.Name = unicode(name)
-        self.Protocol = u'ica'
-        self.DomainRequired = unicode(True)
-        self.Username = unicode(username)
-        self.Password = unicode(password)
-
-    def set_domain(self, domain):
-        """\
-        Set the domain for this ICA server.
-
-        @param domain: the domain name to be set
-        @type domain: C{unicode}
-
-        @raise TypeError: domain has to be C{str} or C{unicode}
-
-        """
-        if isinstance(domainName, str):
-            self.WindowsDomain = unicode(domain)
-        elif isinstance(domainName, unicode):
-            self.WindowsDomain = domain
-        else:
-            raise TypeError("set_domain() expects a string or unicode argument")
-
-    def toJson(self):
-        """\
-        Dump this instance as JSON object.
-
-        """
-        return json.dumps(self, default=convert_to_builtin_type)
-
-
-class X2GoServer():
-    """\
-    Instantiate a UCCS compatible X2Go Server session profile object.
-
-    """
-    def __init__(self, host, name, username=None, password=None):
-        """\
-        @param host: hostname of X2Go Server host
-        @type host: C{unicode}
-        @param name: session profile name
-        @type name: C{unicode}
-        @param username: username to be used for login
-        @type username: C{unicode}
-        @param password: password to be used for login
-        @type password: C{unicode}
-
-        """
-        self.URL = host
-        self.Name = name
-        self.Protocol = 'x2go'
-        self.SessionTypeRequired = True
-        self.Username = username
-        self.Password = password
-
-    def set_session_type(self, session_type):
-        """\
-        Set the session type to be used with this X2Go Server.
-
-        @param session_type: the session type to be set
-        @type session_type: C{unicode}
-
-        @raise TypeError: session_type has to be C{str} or C{unicode}
-
-        """
-        if isinstance(domainName, str):
-            self.SessionType = sessiontypeName
-        else:
-            raise TypeError("set_session_type() expects a string or unicode argument")
-
-    def toJson(self):
-        """\
-        Dump this instance as JSON object.
-
-        """
-        return json.dumps(self, default=convert_to_builtin_type)
-
diff --git a/x2gobroker/web/uccs.py b/x2gobroker/web/uccs.py
deleted file mode 100644
index 394583c..0000000
--- a/x2gobroker/web/uccs.py
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/usr/bin/env python
-
-# This file is part of the  X2Go Project - http://www.x2go.org
-# Copyright (C) 2011-2012 by Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de>
-# Copyright (C) 2011-2012 by Heinz-Markus Graesing <heinz-m.graesing at obviously-nice.de>
-# Copyright (C) 2012 by Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
-#
-# X2Go Session Broker is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# X2Go Session Broker is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# modules
-import types
-import tornado.web
-from tornado.escape import native_str, parse_qs_bytes
-
-# Python X2Go Broker modules
-import x2gobroker.defaults
-
-from x2gobroker.loggers import logger_broker, logger_error
-import x2gobroker.uccsjson
-
-class X2GoBrokerWeb(tornado.web.RequestHandler):
-
-    http_header_items = {
-        'Content-Type': 'text/plain; charset=utf-8',
-        'Expires': '+1h',
-    }
-
-    def _gen_http_header(self):
-
-        for http_header_item in self.http_header_items.keys():
-            self.set_header(http_header_item, self.http_header_items[http_header_item])
-
-    def get(self, backend):
-        if x2gobroker.defaults.X2GOBROKER_DEBUG:
-            self._gen_http_header()
-            logger_broker.warn('GET http request detected, if unwanted: disable X2GOBROKER_DEBUG')
-            return self.post(backend)
-        raise tornado.web.HTTPError(404)
-
-    def post(self, backend):
-
-        if not backend:
-            backend = x2gobroker.defaults.X2GOBROKER_DEFAULT_BACKEND
-        else:
-            backend = backend.rstrip('/')
-
-        # silence pyflakes...
-        broker_backend = None
-        # dynamically detect broker backend from given URL
-        exec("import x2gobroker.brokers.{backend}_broker".format(backend=backend))
-        exec("broker_backend = x2gobroker.brokers.{backend}_broker.X2GoBroker()".format(backend=backend))
-        global_config = broker_backend.get_global_config()
-
-        # if the broker backend is disabled in the configuration, pretend to have nothing on offer
-        if not broker_backend.is_enabled():
-            raise tornado.web.HTTPError(404)
-
-        # FIXME: this is to work around a bug in X2Go Client (http://bugs.x2go.org/138)
-        content_type = self.request.headers.get("Content-Type", "")
-        if not content_type.startswith("application/x-www-form-urlencoded"):
-            for name, values in parse_qs_bytes(native_str(self.request.body)).iteritems():
-                self.request.arguments.setdefault(name, []).extend(values)
-
-        # set the client address for the broker backend
-        ip = self.request.remote_ip
-        if ip:
-            logger_broker.info('client address is {address}'.format(address=ip))
-            broker_backend.set_client_address(ip)
-        elif not x2gobroker.defaults.X2GOBROKER_DEBUG:
-            # if the client IP is not set, we pretend to have nothing on offer
-            logger_error.error('client could not provide an IP address, pretending: 404 Not Found')
-            raise tornado.web.HTTPError(404)
-
-        username = 'foo'
-        #username = self.get_argument('user', default='')
-        #password = self.get_argument('password', default='')
-        #cookie = self.get_argument('cookie', default='')
-        #task = self.get_argument('task', default='')
-        #profile_id = self.get_argument('sid', default='')
-        #new_password = self.get_argument('newpass', default='')
-
-        output = ''
-
-        #logger_broker.debug ('username: {username}, password: {password}, task: {task}, profile_id: {profile_id}'.format(username=username, password='XXXXX', task=task, profile_id=profile_id))
-        #if broker_backend.check_access(username=username, password=password, cookie=cookie):
-
-        ###
-        ### CONFIRM SUCCESSFUL AUTHENTICATION FIRST
-        ###
-
-        profiles = broker_backend.list_profiles(username)
-        ms = x2gobroker.uccsjson.ManagementServer('http://localhost:8080/uccs/{backend}'.format(backend=backend), 'X2Go Session Broker')
-
-        profile_ids = profiles.keys()
-        profile_ids.sort()
-
-        for profile_id in profile_ids:
-
-            if profiles[profile_id][u'directrdp']:
-                pass
-            else:
-                ts = x2gobroker.uccsjson.X2GoServer(
-                        host='{hostname}:{port}'.format(hostname=profiles[profile_id][u'host'], port=profiles[profile_id][u'sshport']),
-                        name=profiles[profile_id][u'name'],
-                        username=profiles[profile_id][u'user'],
-                )
-            ms.add_terminalserver(ts)
-
-        output += ms.toJson()
-
-        self.write(output)
-        return
-
-        #raise tornado.web.HTTPError(401)
-


hooks/post-receive
-- 
x2gobroker.git (HTTP(S) Session broker for X2Go)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2gobroker.git" (HTTP(S) Session broker for X2Go).




More information about the x2go-commits mailing list