Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release update #352

Merged
merged 29 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1086791
refactor/sonarcloud -Surround this <li> item tag by a <ul> or <ol> co…
hongwei1 Oct 13, 2023
a05fc3b
Add IP, response body columns to Metrics, start autocomplete feature.
nemozak1 Nov 24, 2023
a99821b
Add response body and IP fields to metrics
nemozak1 Nov 24, 2023
368a695
Merge pull request #343 from nemozak1/develop
simonredfern Nov 26, 2023
3491f17
Merge remote-tracking branch 'OpenBankProject/develop' into develop
hongwei1 Nov 28, 2023
6b54d4a
bugfix/merge date time to same form row
hongwei1 Nov 29, 2023
ff2b203
bugfix/enhanced the error handling
hongwei1 Nov 29, 2023
6c46e9f
Merge pull request #344 from hongwei1/develop
simonredfern Nov 30, 2023
b2f017e
Change to use OBP v5.1.0 as default.
nemozak1 Nov 30, 2023
76c66e3
Deglobalise API version
nemozak1 Dec 1, 2023
d196ae7
feature/added the lastEndpoint info on metric page
hongwei1 Dec 4, 2023
e31d48d
feature/added the lastEndpoint info on metric page - tweaked the page…
hongwei1 Dec 6, 2023
5e3b073
feature/added the lastEndpoint info on metric page - added the to_dat…
hongwei1 Dec 6, 2023
edba69a
Merge pull request #346 from hongwei1/develop
simonredfern Dec 6, 2023
22e1378
refactor/removed the duplicated rest calls
hongwei1 Dec 6, 2023
7e7a3db
Merge pull request #345 from nemozak1/develop
simonredfern Dec 6, 2023
7030e30
Merge pull request #347 from hongwei1/develop
simonredfern Dec 6, 2023
6f0a818
refactor/enhanced the performance and code clean
hongwei1 Dec 6, 2023
b2ffa95
Merge pull request #348 from hongwei1/develop
simonredfern Dec 6, 2023
fabbf30
refactor/tweaked the default limit to 5
hongwei1 Dec 6, 2023
4d197d0
refactor/tweaked Active Apps to Top 100
hongwei1 Dec 6, 2023
ad283e8
refactor/comment not used logic - enhanced performance
hongwei1 Dec 6, 2023
b3cb4aa
Merge pull request #349 from hongwei1/develop
simonredfern Dec 7, 2023
21752f7
bugfix/tweaked the BarchartData. put to html instead of JS
hongwei1 Dec 7, 2023
9c73bf2
refactor/set the default KPI is the weekly page
hongwei1 Dec 7, 2023
026ceee
refactor/commented the unused code
hongwei1 Dec 7, 2023
19a496c
Merge pull request #350 from hongwei1/develop
simonredfern Dec 7, 2023
2e0aee0
refactor/display milliseconds instead of microseconds for metric page
hongwei1 Dec 12, 2023
5482acb
Merge pull request #351 from hongwei1/develop
simonredfern Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apimanager/apicollections/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def apicollections_update(request):
'is_sharable': True if request.POST.get('api_collection_is_sharable').strip().lower() == "true" else False,
'description': request.POST.get('api_collection_description').strip()
}
result = api.put(urlpath, payload=payload, version=settings.API_ROOT['v510'])
result = api.put(urlpath, payload=payload, version=settings.API_VERSION['v510'])
return result


Expand Down
15 changes: 8 additions & 7 deletions apimanager/apimanager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'base.context_processors.api_root',
'base.context_processors.api_version_processor',
'base.context_processors.api_username',
'base.context_processors.api_user_id',
'base.context_processors.api_tester_url',
Expand Down Expand Up @@ -251,6 +251,9 @@
#Map Java: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
API_DATE_FORMAT_WITH_MILLISECONDS = '%Y-%m-%dT%H:%M:%S.%fZ'

# the API_Manager the web form datetime format, eg: 2023-11-28 10:49:27
API_DATE_FORMAT_WITH_DAY_DATE_TIME = '%Y-%m-%d %H:%M:%S'

# the API_Manager the web form date format, eg: 2020-10-11
API_DATE_FORMAT_WITH_DAY = '%Y-%m-%d'
API_FIELD_TIME_FORMAT = '%H-%M-%S'
Expand Down Expand Up @@ -319,8 +322,6 @@
# Global
UNDEFINED = "<undefined>"

API_ROOT_KEY = "v500"

# Local settings can replace any value ABOVE
try:
from apimanager.local_settings import * # noqa
Expand All @@ -331,8 +332,8 @@
OBPv500 = API_HOST + '/obp/v5.0.0'
OBPv510 = API_HOST + '/obp/v5.1.0'

# Settings here might use parts overwritten in local settings
API_ROOT = {
# API Versions
API_VERSION = {
"v500": OBPv500,
"v510": OBPv510
}
Expand All @@ -354,8 +355,8 @@

CSP_IMG_SRC = ("'self' data:", 'https://static.openbankproject.com')
CSP_STYLE_SRC = ("'self' 'sha256-z2a+NIknPDE7NIEqE1lfrnG39eWOhJXWsXHYGGNb5oU=' 'sha256-Dn0vMZLidJplZ4cSlBMg/F5aa7Vol9dBMHzBF4fGEtk=' 'sha256-sA0hymKbXmMTpnYi15KmDw4u6uRdLXqHyoYIaORFtjU=' 'sha256-jUuiwf3ITuJc/jfynxWHLwTZifHIlhddD8NPmmVBztk=' 'sha256-RqzjtXRBqP4i+ruV3IRuHFq6eGIACITqGbu05VSVXsI='", 'https://cdnjs.cloudflare.com', )
CSP_SCRIPT_SRC = ("'self' 'unsafe-eval' 'sha256-4Hr8ttnXaUA4A6o0hGi3NUGNP2Is3Ep0W+rvm+W7BAk=' 'sha256-GgQWQ4Ejk4g9XpAZJ4YxIgZDgp7CdQCmqjMOMh9hD2g=' 'sha256-05NIAwVBHkAzKcXTfkYqTnBPtkpX+AmQvM/raql3qo0='", 'http://code.jquery.com', 'https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/', 'https://cdnjs.cloudflare.com')
CSP_SCRIPT_SRC = ("'self' 'unsafe-eval' 'sha256-CAykt4V7LQN6lEkjV8hZQx0GV6LTZZGUvQDqamuUq2Q=' 'sha256-4Hr8ttnXaUA4A6o0hGi3NUGNP2Is3Ep0W+rvm+W7BAk=' 'sha256-GgQWQ4Ejk4g9XpAZJ4YxIgZDgp7CdQCmqjMOMh9hD2g=' 'sha256-05NIAwVBHkAzKcXTfkYqTnBPtkpX+AmQvM/raql3qo0='", 'http://code.jquery.com', 'https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/', 'https://cdnjs.cloudflare.com')
CSP_FONT_SRC = ("'self'", 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/fonts/')
CSP_FRAME_ANCESTORS = ("'self'")
CSP_FORM_ACTION = ("'self'")
CSP_CONNECT_SRC = (API_HOST)
CSP_CONNECT_SRC = ("'self'", API_HOST)
8 changes: 4 additions & 4 deletions apimanager/atms/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class UpdateAtmsView(LoginRequiredMixin, FormView):
template_name = "atms/update.html"
success_url = '/atms/list'
form_class = CreateAtmForm
v510 = settings.API_ROOT['v510']
v510 = settings.API_VERSION['v510']

def dispatch(self, request, *args, **kwargs):
self.api = API(request.session.get('obp'))
Expand Down Expand Up @@ -410,7 +410,7 @@ def atm_attribute_save(request):
'value': request.POST.get('value').strip(),
'is_active': True
}
result = api.post(urlpath_save, payload = payload, version=settings.API_ROOT['v510'])
result = api.post(urlpath_save, payload = payload, version=settings.API_VERSION['v510'])
return result


Expand All @@ -428,7 +428,7 @@ def atm_attribute_update(request):
'value': request.POST.get('value').strip(),
'is_active': True
}
result = api.put(urlpath_update, payload=payload, version=settings.API_ROOT['v510'])
result = api.put(urlpath_update, payload=payload, version=settings.API_VERSION['v510'])
return result


Expand All @@ -441,7 +441,7 @@ def atm_attribute_delete(request):

api = API(request.session.get('obp'))
urlpath_delete = '/banks/{}/atms/{}/attributes/{}'.format(bank_id, atm_id, atm_attribute_id)
result = api.delete(urlpath_delete, version=settings.API_ROOT['v510'])
result = api.delete(urlpath_delete, version=settings.API_VERSION['v510'])
return result


Expand Down
14 changes: 4 additions & 10 deletions apimanager/banks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class UpdateBanksView(LoginRequiredMixin, FormView):
template_name = "banks/update.html"
form_class = CreateBankForm
success_url = '/banks/list'
v510 = settings.API_ROOT['v510']
v510 = settings.API_VERSION['v510']

def dispatch(self, request, *args, **kwargs):
self.api = API(request.session.get('obp'))
Expand Down Expand Up @@ -111,8 +111,6 @@ def get_form(self, *args, **kwargs):
fields['bank_routings_scheme'].initial = result['bank_routings'][0]["scheme"]
fields['bank_routings_address'].initial = result['bank_routings'][0]["address"]
except Exception as err:
if DEBUG:
raise(err)
messages.error(self.request, "Unknown Error {}".format(err))
return form

Expand All @@ -138,13 +136,9 @@ def form_valid(self, form):
messages.error(self.request, result['message'])
return super(UpdateBanksView, self).form_invalid(form)
except APIError as err:
if DEBUG:
raise(err)
messages.error(self.request, err)
return super(UpdateBanksView, self).form_invalid(form)
except Exception as e:
if DEBUG:
raise(err)
messages.error(self.request, e)
return super(UpdateBanksView, self).form_invalid(form)
msg = 'Bank {} has been updated successfully!'.format( # noqa
Expand Down Expand Up @@ -183,7 +177,7 @@ def bank_attribute_save(request):
'value': request.POST.get('value').strip(),
'is_active': True
}
result = api.post(urlpath_save, payload = payload, version=settings.API_ROOT['v510'])
result = api.post(urlpath_save, payload = payload, version=settings.API_VERSION['v510'])
return result


Expand All @@ -201,7 +195,7 @@ def bank_attribute_update(request):
'value': request.POST.get('value').strip(),
'is_active': True
}
result = api.put(urlpath_update, payload=payload, version=settings.API_ROOT['v510'])
result = api.put(urlpath_update, payload=payload, version=settings.API_VERSION['v510'])
return result


Expand All @@ -212,6 +206,6 @@ def bank_attribute_delete(request):
bank_attribute_id = request.POST.get('bank_attribute_id').strip()
api = API(request.session.get('obp'))
urlpath_delete = '/banks/{}/attributes/{}'.format(bank_id, bank_attribute_id)
result = api.delete(urlpath_delete, version=settings.API_ROOT['v510'])
result = api.delete(urlpath_delete, version=settings.API_VERSION['v510'])
return result

6 changes: 3 additions & 3 deletions apimanager/base/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

USER_CURRENT = "/users/current"

def api_root(request):
"""Returns the configured API_ROOT"""
return {'API_ROOT': settings.API_ROOT['v500']}
def api_version_processor(request):
"""Returns the configured API_VERSION"""
return {'API_VERSION': settings.API_VERSION['v500']}


def portal_page(request):
Expand Down
Loading
Loading