1 # -------------------------------------------------------------------------
2 # Copyright (c) 2015-2018 AT&T Intellectual Property
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 # -------------------------------------------------------------------------
19 """Core functions for OSDF Application, including flask app"""
21 from jinja2 import Template
24 end_point_auth_mapping = { # map a URL endpoint to auth group
25 "cmscheduler": "CMScheduler",
26 "placement": "Placement",
29 userid_suffix, passwd_suffix = "Username", "Password"
30 auth_groups = set(end_point_auth_mapping.values())
32 ERROR_TEMPLATE = Template("""
35 "text": "{{ description }}"
40 ACCEPTED_MESSAGE_TEMPLATE = Template("""
42 "requestId": "{{ request_id }}",
43 "transactionId": "{{ transaction_id }}",
44 "requestStatus": "{{ request_status }}",
45 "statusMessage": "{{ status_message }}"