def access_keys(opts):
    '''
    A key needs to be placed in the filesystem with permissions 0400 so
    clients are required to run as root.
    '''
    # TODO: Need a way to get all available users for systems not supported by pwd module.
    #       For now users pattern matching will not work for publisher_acl.
    keys = {}
    publisher_acl = opts['publisher_acl']
    acl_users = set(publisher_acl.keys())
    if opts.get('user'):
        acl_users.add(opts['user'])
    acl_users.add(salt.utils.user.get_user())
    for user in acl_users:
        log.info('Preparing the %s key for local communication', user)
        key = mk_key(opts, user)
        if key is not None:
            keys[user] = key

    # Check other users matching ACL patterns
    if opts['client_acl_verify'] and HAS_PWD:
        log.profile('Beginning pwd.getpwall() call in masterapi access_keys function')
        for user in pwd.getpwall():
            user = user.pw_name
            if user not in keys and salt.utils.stringutils.check_whitelist_blacklist(user, whitelist=acl_users):
                keys[user] = mk_key(opts, user)
        log.profile('End pwd.getpwall() call in masterapi access_keys function')

    return keys
def access_keys ( opts ) : keys = { } publisher_acl = opts [ 'publisher_acl' ] acl_users = set ( publisher_acl . keys ( ) ) if opts . get ( 'user' ) : acl_users . add ( opts [ 'user' ] ) acl_users . add ( salt . utils . user . get_user ( ) ) for user in acl_users : log . info ( 'Preparing the %s key for local communication' , user ) key = mk_key ( opts , user ) if key is not None : keys [ user ] = key if opts [ 'client_acl_verify' ] and HAS_PWD : log . profile ( 'Beginning pwd.getpwall() call in masterapi access_keys function' ) for user in pwd . getpwall ( ) : user = user . pw_name if user not in keys and salt . utils . stringutils . check_whitelist_blacklist ( user , whitelist = acl_users ) : keys [ user ] = mk_key ( opts , user ) log . profile ( 'End pwd.getpwall() call in masterapi access_keys function' ) return keys
A key needs to be placed in the filesystem with permissions 0400 so
    clients are required to run as root.