REST authentication

def auth(username, password):
    '''
    REST authentication
    '''

    url = rest_auth_setup()

    data = {'username': username, 'password': password}

    # Post to the API endpoint. If 200 is returned then the result will be the ACLs
    # for this user
    result = salt.utils.http.query(url, method='POST', data=data, status=True,
                                   decode=True)
    if result['status'] == 200:
        log.debug('eauth REST call returned 200: %s', result)
        if result['dict'] is not None:
            return result['dict']
        return True
    else:
        log.debug('eauth REST call failed: %s', result)
        return False