Esempio n. 1
0
    def policy(content, path=None):  # pylint: disable=unused-argument
        """Simplestreams policy function.

        @param content: signed content
        @param path: not used
        @return: policy for simplestreams
        """
        return s_util.read_signed(content, keyring=keyring)
Esempio n. 2
0
def policy(content, path):
    if path.endswith('sjson'):
        return read_signed(content, keyring=KEYRING)
    else:
        return content
Esempio n. 3
0
 def policy(content, path):
     return s_util.read_signed(content, keyring=img_conf['keyring'])
Esempio n. 4
0
 def test_read_signed(self):
     path = os.path.join(EXAMPLES_DIR, 'foocloud/streams/v1/index.sjson')
     with open(path) as fileobj:
         util.read_signed(fileobj.read())
Esempio n. 5
0
 def test_no_check(self):
     streams = os.path.join(EXAMPLES_DIR, 'foocloud/streams/v1')
     path = os.path.join(streams, 'index.sjson')
     with open(path) as fileobj:
         util.read_signed(fileobj.read(), checked=False)
Esempio n. 6
0
 def policy(content, path):  # pylint: disable=W0613
     """Read signed content with the defined keyring."""
     return s_util.read_signed(content, keyring=self.keyring_path)
Esempio n. 7
0
 def policy(content, path):  # pylint: disable=W0613
     """TODO."""
     return s_util.read_signed(content, keyring=self.keyring_path)
Esempio n. 8
0
 def policy(content, path):
     return s_util.read_signed(content, keyring=img_conf['keyring'])
Esempio n. 9
0
 def verify_signature(content, path):
     """Policy callback for Simplestreams: verify index signature."""
     return util.read_signed(content, keyring=args.keyring)
Esempio n. 10
0
 def policy(content, path):  # pylint: disable=W0613
     if initial_path.endswith('sjson'):
         return sutil.read_signed(content, keyring=keyring)
     else:
         return content