Revision ce2a2ef0

b/snf-pithos-app/pithos/api/functions.py
51 51
    validate_modification_preconditions, validate_matching_preconditions, split_container_object_string,
52 52
    copy_or_move_object, get_int_parameter, get_content_length, get_content_range, socket_read_iterator,
53 53
    SaveToBackendHandler, object_data_response, put_object_block, hashmap_md5, simple_list_response, api_method)
54
from pithos.api.settings import AUTHENTICATION_URL, AUTHENTICATION_USERS
54
from pithos.api.settings import AUTHENTICATION_URL, AUTHENTICATION_USERS, COOKIE_NAME
55 55

  
56 56
from pithos.backends.base import NotAllowedError, QuotaError
57 57
from pithos.backends.filter import parse_filters
......
103 103

  
104 104
@csrf_exempt
105 105
def object_demux(request, v_account, v_container, v_object):
106
    get_user(request, AUTHENTICATION_URL, AUTHENTICATION_USERS)
106
    # Helper to avoid placing the token in the URL when loading objects from a browser.
107
    token = None
108
    if request.method in ('HEAD', 'GET') and COOKIE_NAME in request.COOKIES:
109
        cookie_value = unquote(request.COOKIES.get('COOKIE_NAME', ''))
110
        if cookie_value and '|' in cookie_value:
111
            token = cookie_value.split('|', 1)[1]
112
    get_user(request, AUTHENTICATION_URL, AUTHENTICATION_USERS, token)
107 113
    if request.method == 'HEAD':
108 114
        return object_meta(request, v_account, v_container, v_object)
109 115
    elif request.method == 'GET':
b/snf-pithos-app/pithos/api/settings.py
18 18
AUTHENTICATION_URL = getattr(settings, 'PITHOS_AUTHENTICATION_URL', 'http://127.0.0.1:8000/im/authenticate')
19 19
AUTHENTICATION_USERS = getattr(settings, 'PITHOS_AUTHENTICATION_USERS', sample_users)
20 20

  
21
COOKIE_NAME = getattr(settings, 'ASTAKOS_COOKIE_NAME', '_pithos2_a')
22

  
21 23
# SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
22 24
BACKEND_DB_MODULE = getattr(settings, 'PITHOS_BACKEND_DB_MODULE', 'pithos.backends.lib.sqlalchemy')
23 25
BACKEND_DB_CONNECTION = getattr(settings, 'PITHOS_BACKEND_DB_CONNECTION', 'sqlite:////tmp/pithos-backend.db')

Also available in: Unified diff