From f4aa0b403d7c0632de2ef2a1d7a0b0dbdff5412c Mon Sep 17 00:00:00 2001
From: Renovate Bot <accounts+renovatebot@netz39.de>
Date: Sat, 29 Jul 2023 19:36:03 +0000
Subject: [PATCH 01/12] Add renovate.json

---
 renovate.json | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 renovate.json

diff --git a/renovate.json b/renovate.json
new file mode 100644
index 0000000..7190a60
--- /dev/null
+++ b/renovate.json
@@ -0,0 +1,3 @@
+{
+  "$schema": "https://docs.renovatebot.com/renovate-schema.json"
+}

From 8c3d8ae96e7976c6c53a9a50cfbbf21c9f39e958 Mon Sep 17 00:00:00 2001
From: Renovate Bot <accounts+renovatebot@netz39.de>
Date: Thu, 7 Sep 2023 19:18:29 +0000
Subject: [PATCH 02/12] Update dependency pytest to v7

---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index b803341..cf389bc 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
 tornado==6.0.4
 isodate==0.6.0
-pytest==5.4.1
+pytest==7.4.2
 GitPython==3.1.12
\ No newline at end of file

From 53595bebda84b5d0ad3053dd1e18fe1b78779aad Mon Sep 17 00:00:00 2001
From: Renovate Bot <accounts+renovatebot@netz39.de>
Date: Fri, 1 Sep 2023 20:17:28 +0000
Subject: [PATCH 03/12] Update python Docker tag to v3.11

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 488d25c..41407f0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@ COPY . /git/
 RUN find . -type d -name .git -exec git describe --always --dirty > /git-version.txt \;
 
 
-FROM python:3.8
+FROM python:3.11
 
 EXPOSE 8080
 

From d1845d7bbaa19cd72ff95e83f1711cf44ccc018e Mon Sep 17 00:00:00 2001
From: Renovate Bot <accounts+renovatebot@netz39.de>
Date: Fri, 1 Sep 2023 19:17:29 +0000
Subject: [PATCH 04/12] Update dependency tornado to v6.3.3

---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index cf389bc..c3a2079 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-tornado==6.0.4
+tornado==6.3.3
 isodate==0.6.0
 pytest==7.4.2
 GitPython==3.1.12
\ No newline at end of file

From deaeca5f0b045ef0210f02aa972be9cfd2299cb5 Mon Sep 17 00:00:00 2001
From: Renovate Bot <accounts+renovatebot@netz39.de>
Date: Tue, 24 Oct 2023 20:17:22 +0000
Subject: [PATCH 05/12] Update dependency pytest to v7.4.3

---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index c3a2079..d8380c1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
 tornado==6.3.3
 isodate==0.6.0
-pytest==7.4.2
+pytest==7.4.3
 GitPython==3.1.12
\ No newline at end of file

From 1995b738686d3590597c389dae82d565d0e58e7a Mon Sep 17 00:00:00 2001
From: Renovate Bot <accounts+renovatebot@netz39.de>
Date: Tue, 3 Oct 2023 03:17:22 +0000
Subject: [PATCH 06/12] Update python Docker tag to v3.12

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 41407f0..45eb9ba 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@ COPY . /git/
 RUN find . -type d -name .git -exec git describe --always --dirty > /git-version.txt \;
 
 
-FROM python:3.11
+FROM python:3.12
 
 EXPOSE 8080
 

From 90395cd7a3e05b23b0a3d56c462f7f6a4163e4bd Mon Sep 17 00:00:00 2001
From: Renovate Bot <accounts+renovatebot@netz39.de>
Date: Sun, 5 Nov 2023 16:17:19 +0000
Subject: [PATCH 07/12] Update dependency GitPython to v3.1.40

---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index d8380c1..3a34529 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
 tornado==6.3.3
 isodate==0.6.0
 pytest==7.4.3
-GitPython==3.1.12
\ No newline at end of file
+GitPython==3.1.40
\ No newline at end of file

From d3badfe3d4a2b371c606c107b2d75c73ddf57094 Mon Sep 17 00:00:00 2001
From: Renovate Bot <accounts+renovatebot@netz39.de>
Date: Sun, 5 Nov 2023 16:17:24 +0000
Subject: [PATCH 08/12] Update dependency isodate to v0.6.1

---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index 3a34529..87c39f9 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
 tornado==6.3.3
-isodate==0.6.0
+isodate==0.6.1
 pytest==7.4.3
 GitPython==3.1.40
\ No newline at end of file

From 4cb417a4487baba92be0758cef2ecd34db254e02 Mon Sep 17 00:00:00 2001
From: Stefan Haun <tux@netz39.de>
Date: Mon, 28 Sep 2020 00:04:51 +0200
Subject: [PATCH 09/12] Add AuthenticatedHandler base class

---
 app.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/app.py b/app.py
index cd31e35..5dc8a51 100644
--- a/app.py
+++ b/app.py
@@ -18,6 +18,26 @@ 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):

From 95961d4b7b30667401630bc77c4c9ef84fe89ba2 Mon Sep 17 00:00:00 2001
From: Stefan Haun <tux@netz39.de>
Date: Mon, 28 Sep 2020 00:07:00 +0200
Subject: [PATCH 10/12] Add routing for entities handlers

---
 app.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app.py b/app.py
index 5dc8a51..88014a2 100644
--- a/app.py
+++ b/app.py
@@ -103,6 +103,8 @@ def make_app(_auth_provider=None, gitmgr=None):
         (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}),
     ])
 
 

From 309c0b50b1632024bebfca22aebcc7902ef9e4dd Mon Sep 17 00:00:00 2001
From: Stefan Haun <tux@netz39.de>
Date: Mon, 28 Sep 2020 00:07:29 +0200
Subject: [PATCH 11/12] Add SingleEntityHandler stub

---
 app.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app.py b/app.py
index 88014a2..07b93b9 100644
--- a/app.py
+++ b/app.py
@@ -97,6 +97,18 @@ class Oas3Handler(tornado.web.RequestHandler, metaclass=ABCMeta):
         self.finish()
 
 
+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([

From e2128c8402f7f124274fd1efed767eed540b75f1 Mon Sep 17 00:00:00 2001
From: Stefan Haun <tux@netz39.de>
Date: Mon, 28 Sep 2020 00:07:44 +0200
Subject: [PATCH 12/12] Add AllEntitiesHandler stub

---
 app.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app.py b/app.py
index 07b93b9..691e2d4 100644
--- a/app.py
+++ b/app.py
@@ -97,6 +97,18 @@ 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):