1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

Remove passx encode/decode functions from conf.py

They are no longer needed with the new CredentialsManagers
This commit is contained in:
lethliel 2019-08-28 13:58:21 +02:00
parent 629ab25a0e
commit 36ec0c48d4
3 changed files with 0 additions and 42 deletions

View File

@ -710,14 +710,6 @@ def config_set_option(section, opt, val=None, delete=False, update=True, **kwarg
return (opt, cp.get(section, opt, raw=True))
return (opt, None)
def passx_decode(passx):
"""decode the obfuscated password back to plain text password"""
return bz2.decompress(base64.b64decode(passx.encode("ascii"))).decode("ascii")
def passx_encode(passwd):
"""encode plain text password to obfuscated form"""
return base64.b64encode(bz2.compress(passwd.encode('ascii'))).decode("ascii")
def write_initial_config(conffile, entries, custom_template='', creds_mgr_descriptor=None):
"""
write osc's intial configuration file. entries is a dict which contains values

View File

@ -22,7 +22,6 @@ import test_project_status
import test_request
import test_setlinkrev
import test_prdiff
import test_conf
import test_results
import test_helpers
@ -41,7 +40,6 @@ suite.addTests(test_project_status.suite())
suite.addTests(test_request.suite())
suite.addTests(test_setlinkrev.suite())
suite.addTests(test_prdiff.suite())
suite.addTests(test_conf.suite())
suite.addTests(test_results.suite())
suite.addTests(test_helpers.suite())

View File

@ -1,32 +0,0 @@
from osc.conf import passx_encode, passx_decode
from common import OscTestCase
import os
FIXTURES_DIR = os.path.join(os.getcwd(), 'conf_fixtures')
def suite():
import unittest
return unittest.makeSuite(TestConf)
class TestConf(OscTestCase):
def _get_fixtures_dir(self):
return FIXTURES_DIR
def setUp(self):
return super(TestConf, self).setUp(copytree=False)
def testPassxEncodeDecode(self):
passwd = "J0e'sPassword!@#"
passx = passx_encode(passwd)
#base64.b64encode(passwd.encode('bz2'))
passx27 = "QlpoOTFBWSZTWaDg4dQAAAKfgCiAQABAEEAAJgCYgCAAMQAACEyYmTyei67AsYSDSaLuSKcKEhQcHDqA"
self.assertEqual(passwd, passx_decode(passx))
self.assertEqual(passwd, passx_decode(passx27))
self.assertEqual(passx, passx27)
if __name__ == '__main__':
import unittest
unittest.main()