Compare commits

..

24 commits

Author SHA1 Message Date
ab150963af Merge pull request 'Update python Docker tag to v3.13' (#25) from renovate/python-3.x into master
Reviewed-on: #25
2024-10-15 21:38:08 +02:00
e36cff1a3d Update python Docker tag to v3.13 2024-10-15 21:33:10 +02:00
4622a5d274 Merge pull request 'Update dependency isodate to v0.7.2' (#26) from renovate/isodate-0.x into master
Reviewed-on: #26
2024-10-15 21:32:45 +02:00
2863795580 Update dependency isodate to v0.7.2 2024-10-08 23:17:22 +00:00
1c79f0c4d9 Merge pull request 'Update dependency pytest to v8.3.3' (#24) from renovate/pytest-8.x into master
Reviewed-on: #24
2024-09-15 22:54:59 +02:00
3904819032 Update dependency pytest to v8.3.3 2024-09-10 11:17:41 +00:00
92ae9d79a2 Merge pull request 'Update dependency pytest to v8.3.2' (#23) from renovate/pytest-8.x into master
Reviewed-on: #23
2024-08-04 16:41:12 +02:00
e903272dd8 Update dependency pytest to v8.3.2 2024-07-25 11:17:18 +00:00
6ec26363a1 Merge pull request 'Update dependency GitPython to v3.1.43' (#20) from renovate/gitpython-3.x into master
Reviewed-on: #20
2024-06-10 09:28:42 +02:00
7c9ea635ce Update dependency GitPython to v3.1.43 2024-06-06 21:18:59 +00:00
89821185a8 Merge pull request 'Update dependency pytest to v8.2.2' (#21) from renovate/pytest-8.x into master
Reviewed-on: #21
2024-06-06 22:43:55 +02:00
c582e6f47a Update dependency pytest to v8.2.2 2024-06-06 22:43:29 +02:00
68494d9e09 Merge pull request 'Update dependency tornado to v6.4.1' (#22) from renovate/tornado-6.x into master
Reviewed-on: #22
2024-06-06 22:35:34 +02:00
a4b7025c07 Update dependency tornado to v6.4.1 2024-06-06 19:17:23 +00:00
1b884c771a Merge pull request 'Update dependency GitPython to v3.1.42' (#17) from renovate/gitpython-3.x into master
Reviewed-on: #17
2024-03-22 10:17:56 +01:00
24c6a4d764 Update dependency GitPython to v3.1.42 2024-03-17 20:17:19 +00:00
773879425c Merge pull request 'Update dependency pytest to v8.1.1' (#19) from renovate/pytest-8.x into master
Reviewed-on: #19
2024-03-17 20:21:46 +01:00
e8a6de078a Update dependency pytest to v8.1.1 2024-03-09 12:17:22 +00:00
41f9f0a4dd Merge pull request 'Update dependency pytest to v8' (#18) from renovate/pytest-8.x into master
Reviewed-on: #18
2024-02-23 22:06:10 +01:00
e8886b53ad Update dependency pytest to v8 2024-02-23 20:41:04 +00:00
04a6d36110 Merge pull request 'Update dependency tornado to v6.4' (#15) from renovate/tornado-6.x into master
Reviewed-on: #15
2024-02-23 21:19:02 +01:00
cdef92e8fa Update dependency tornado to v6.4 2024-02-23 21:18:48 +01:00
28bf13b137 Merge pull request 'Update dependency pytest to v7.4.4' (#16) from renovate/pytest-7.x into master
Reviewed-on: #16
2024-02-23 21:18:04 +01:00
33544d3e90 Update dependency pytest to v7.4.4 2024-01-26 19:22:20 +00:00
3 changed files with 5 additions and 51 deletions

View file

@ -8,7 +8,7 @@ COPY . /git/
RUN find . -type d -name .git -exec git describe --always --dirty > /git-version.txt \;
FROM python:3.12
FROM python:3.13
EXPOSE 8080

46
app.py
View file

@ -18,26 +18,6 @@ from gitmgr import GitManagerConfiguration, GitManager
startup_timestamp = datetime.now()
class AuthenticatedHandler(tornado.web.RequestHandler, metaclass=ABCMeta):
# noinspection PyAttributeOutsideInit
def initialize(self, auth_provider=None):
self.auth_provider = auth_provider
def prepare(self):
if self.auth_provider is None:
return
# check authentication
auth_hdr = "Authentication"
if auth_hdr not in self.request.headers:
raise tornado.web.HTTPError(401, reason="authentication not provided")
tk = self.request.headers[auth_hdr]
if not self.auth_provider.validate_token(tk):
raise tornado.web.HTTPError(403, reason="invalid authentication token provided")
class HealthHandler(tornado.web.RequestHandler, metaclass=ABCMeta):
# noinspection PyAttributeOutsideInit
def initialize(self, sources=None):
@ -97,38 +77,12 @@ class Oas3Handler(tornado.web.RequestHandler, metaclass=ABCMeta):
self.finish()
class AllEntitiesHandler(AuthenticatedHandler, metaclass=ABCMeta):
# noinspection PyAttributeOutsideInit
def initialize(self, auth_provider=None):
super().initialize(auth_provider)
def post(self):
pass
def get(self):
pass
class SingleEntityHandler(AuthenticatedHandler, metaclass=ABCMeta):
# noinspection PyAttributeOutsideInit
def initialize(self, auth_provider=None):
super().initialize(auth_provider)
def post(self, identifier):
pass
def get(self, identifier):
pass
def make_app(_auth_provider=None, gitmgr=None):
version_path = r"/v[0-9]"
return tornado.web.Application([
(version_path + r"/health", HealthHandler,
{"sources": [lambda: {"git-head": gitmgr.head_sha}] if gitmgr else None}),
(version_path + r"/oas3", Oas3Handler),
(version_path + r"/entities", AllEntitiesHandler, {"auth_provider": _auth_provider}),
(version_path + r"/entity/{.*}", SingleEntityHandler, {"auth_provider": _auth_provider}),
])

View file

@ -1,4 +1,4 @@
tornado==6.3.3
isodate==0.6.1
pytest==7.4.3
GitPython==3.1.40
tornado==6.4.1
isodate==0.7.2
pytest==8.3.3
GitPython==3.1.43