31 |
31 |
# interpreted as representing official policies, either expressed
|
32 |
32 |
# or implied, of GRNET S.A.
|
33 |
33 |
|
34 |
|
from django.conf import settings
|
35 |
34 |
from synnefo.lib import join_urls, parse_base_url
|
36 |
35 |
from synnefo.util.keypath import get_path
|
37 |
|
from pithos.api.services import pithos_services as vanilla_pithos_services
|
38 |
|
from astakosclient import astakos_services as vanilla_astakos_services
|
39 |
36 |
from synnefo.lib.services import get_public_endpoint, fill_endpoints
|
40 |
37 |
|
41 |
|
from copy import deepcopy
|
|
38 |
from django.conf import settings
|
|
39 |
synnefo_services = settings.SYNNEFO_SERVICES
|
42 |
40 |
|
43 |
41 |
# Process Pithos settings. This code is shared between snf-pithos-app and
|
44 |
42 |
# snf-pithos-webclient since they share the PITHOS_ settings prefix for most
|
... | ... | |
53 |
51 |
'https://accounts.example.synnefo.org/astakos/')
|
54 |
52 |
ASTAKOS_BASE_HOST, ASTAKOS_BASE_PATH = parse_base_url(ASTAKOS_BASE_URL)
|
55 |
53 |
|
56 |
|
pithos_services = deepcopy(vanilla_pithos_services)
|
57 |
|
fill_endpoints(pithos_services, BASE_URL)
|
58 |
|
PITHOS_PREFIX = get_path(pithos_services, 'pithos_object-store.prefix')
|
59 |
|
PUBLIC_PREFIX = get_path(pithos_services, 'pithos_public.prefix')
|
60 |
|
UI_PREFIX = get_path(pithos_services, 'pithos_ui.prefix')
|
61 |
|
|
62 |
|
astakos_services = deepcopy(vanilla_astakos_services)
|
63 |
|
fill_endpoints(astakos_services, ASTAKOS_BASE_URL)
|
64 |
|
CUSTOMIZE_ASTAKOS_SERVICES = \
|
65 |
|
getattr(settings, 'PITHOS_CUSTOMIZE_ASTAKOS_SERVICES', ())
|
66 |
|
for path, value in CUSTOMIZE_ASTAKOS_SERVICES:
|
67 |
|
set_path(astakos_services, path, value, createpath=True)
|
|
54 |
PITHOS_PREFIX = get_path(synnefo_services, 'pithos_object-store.prefix')
|
|
55 |
PUBLIC_PREFIX = get_path(synnefo_services, 'pithos_public.prefix')
|
|
56 |
UI_PREFIX = get_path(synnefo_services, 'pithos_ui.prefix')
|
68 |
57 |
|
69 |
|
ASTAKOS_ACCOUNTS_PREFIX = get_path(astakos_services, 'astakos_account.prefix')
|
70 |
|
ASTAKOS_VIEWS_PREFIX = get_path(astakos_services, 'astakos_ui.prefix')
|
71 |
|
ASTAKOS_IDENTITY_PREFIX = get_path(astakos_services, 'astakos_identity.prefix')
|
|
58 |
ASTAKOS_ACCOUNTS_PREFIX = get_path(synnefo_services, 'astakos_account.prefix')
|
|
59 |
ASTAKOS_VIEWS_PREFIX = get_path(synnefo_services, 'astakos_ui.prefix')
|
|
60 |
ASTAKOS_IDENTITY_PREFIX = get_path(synnefo_services, 'astakos_identity.prefix')
|
72 |
61 |
|
73 |
62 |
BASE_ASTAKOS_PROXY_PATH = getattr(settings, 'PITHOS_BASE_ASTAKOS_PROXY_PATH',
|
74 |
63 |
ASTAKOS_BASE_PATH)
|
... | ... | |
80 |
69 |
if not BASE_PATH.startswith("/"):
|
81 |
70 |
BASE_PATH = "/" + BASE_PATH
|
82 |
71 |
|
83 |
|
PITHOS_URL = get_public_endpoint(pithos_services, 'object-store', 'v1')
|
84 |
|
PITHOS_UI_URL = get_public_endpoint(pithos_services, 'pithos_ui', '')
|
85 |
|
ASTAKOS_UI_URL = get_public_endpoint(astakos_services, 'astakos_ui', '')
|
|
72 |
PITHOS_URL = get_public_endpoint(synnefo_services, 'object-store', '1')
|
|
73 |
PITHOS_UI_URL = get_public_endpoint(synnefo_services, 'pithos_ui', '')
|
|
74 |
ASTAKOS_UI_URL = get_public_endpoint(synnefo_services, 'astakos_ui', '')
|
86 |
75 |
|
87 |
76 |
if PROXY_USER_SERVICES:
|
88 |
77 |
ACCOUNT_URL = join_urls('/', BASE_ASTAKOS_PROXY_PATH,
|
89 |
|
ASTAKOS_ACCOUNTS_PREFIX, 'v1.0')
|
|
78 |
ASTAKOS_ACCOUNTS_PREFIX, '1.0')
|
90 |
79 |
else:
|
91 |
|
ACCOUNT_URL = get_public_endpoint(astakos_services, 'account', 'v1.0')
|
|
80 |
ACCOUNT_URL = get_public_endpoint(synnefo_services, 'account', '1.0')
|
92 |
81 |
|
93 |
82 |
|
94 |
83 |
USER_CATALOG_URL = join_urls(ACCOUNT_URL, 'user_catalogs')
|