Пример #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)
Пример #2
0
def policy(content, path):
    if path.endswith('sjson'):
        return read_signed(content, keyring=KEYRING)
    else:
        return content
Пример #3
0
 def policy(content, path):
     return s_util.read_signed(content, keyring=img_conf['keyring'])
Пример #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())
Пример #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)
Пример #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)
Пример #7
0
 def policy(content, path):  # pylint: disable=W0613
     """TODO."""
     return s_util.read_signed(content, keyring=self.keyring_path)
Пример #8
0
 def policy(content, path):
     return s_util.read_signed(content, keyring=img_conf['keyring'])
Пример #9
0
 def verify_signature(content, path):
     """Policy callback for Simplestreams: verify index signature."""
     return util.read_signed(content, keyring=args.keyring)
Пример #10
0
 def policy(content, path):  # pylint: disable=W0613
     if initial_path.endswith('sjson'):
         return sutil.read_signed(content, keyring=keyring)
     else:
         return content