How to use the keen.scoped_keys.decrypt function in keen

To help you get started, we’ve selected a few keen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CenterForOpenScience / osf.io / scripts / fix_keen_preprint_keys.py View on Github external
def valid_keen_key(keenio_read_key, node_id):
    try:
        ret = scoped_keys.decrypt(settings.KEEN['public']['master_key'], keenio_read_key)
        return ret['filters'][0]['property_value'] == node_id
    except Exception as error:
        logger.exception('Error on {}:'.format(node_id))
        # Returns True to bypass updating of the key -- failed nodes should be investigated separately
        return True