mappers: modify response format

This commit is contained in:
Jérôme Schneider 2014-07-09 18:55:37 +02:00
parent 1e1026cd80
commit 5f7b7e9658
1 changed files with 19 additions and 34 deletions

View File

@ -52,60 +52,54 @@ mapping = [
{
'path': r'/mandaye/login$',
'method': 'GET',
'response': [{
'response': {
'auth': 'login',
'values': {
'associate_url': '/mandaye/associate',
},
'condition': "'\"success\":true' in response.msg"
},]
}
},
{
'path': r'/mandaye/sso$',
'method': 'GET',
'response': [{
'auth': 'sso',
}]
'response': {'auth': 'sso',}
},
{
'path': r'/mandaye/slo$',
'method': 'GET',
'response': [{
'auth': 'slo',
}]
'response': {'auth': 'slo',}
},
{
'path': r'%s$' % END_POINTS_PATH['single_sign_on_post'],
'method': 'POST',
'response': [{
'response': {
'auth': 'single_sign_on_post',
'values': {
'login_url': '/mandaye/login',
'next_url': '/%s/' % base
}
}]
}
},
{
'path': r'%s$' % END_POINTS_PATH['single_logout'],
'method': 'GET',
'response': [{
'auth': 'single_logout',
}]
'response': {'auth': 'single_logout'}
},
{
'path': r'%s$' % END_POINTS_PATH['single_logout_return'],
'method': 'GET',
'response': [{
'response': {
'auth': 'single_logout_return',
'values': {
'next_url': '/%s' % base
}
}]
}
},
{
'path': r'/mandaye/associate$',
'method': 'GET',
'response': [{
'response': {
'filter': archimed.associate,
'values': {
'action': '/mandaye/associate?next_url=/%s' % base,
@ -114,7 +108,7 @@ mapping = [
'login_name': form_values['username_field'],
'password_name': form_values['password_field'],
},
}],
},
'on_request': [{
'filter': archimed.associate_req,
'values': {
@ -127,30 +121,26 @@ mapping = [
{
'path': r'/mandaye/disassociate$',
'method': 'GET',
'response': [{
'auth': 'disassociate',
}],
'response': {'auth': 'disassociate',},
},
{
'path': r'/mandaye/associate_confirm$',
'method': 'GET',
'response': [{
'response': {
'filter': archimed.associate_confirm,
'values': {
'associate_url': '/mandaye/associate',
'template': 'archimed/associate_confirm.html',
},
},]
}
},
{
'path': r'/mandaye/associate$',
'method': 'POST',
'response': [
{
'auth': 'associate_submit',
'condition': "'\"success\":true' in response.msg"
},
],
'response': {
'auth': 'associate_submit',
'condition': "'\"success\":true' in response.msg"
},
'on_reponse': [
{
'filter': archimed.clean_registration_session,
@ -160,12 +150,7 @@ mapping = [
{
'path': r'/mandaye/json$',
'method': 'GET',
'response': [
{
'filter': archimed.json_response,
},
]
'response': {'filter': archimed.json_response,},
},
]