vantage6-algorithm-store 4.3.2__tar.gz → 4.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/PKG-INFO +1 -1
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/_version.py +1 -1
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/default_roles.py +2 -2
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/vantage6_server.py +13 -1
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/resource/__init__.py +6 -3
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/resource/schema/output_schema.py +7 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6_algorithm_store.egg-info/PKG-INFO +1 -1
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6_algorithm_store.egg-info/requires.txt +2 -2
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/setup.cfg +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/setup.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/__build__ +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/__init__.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/db.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/globals.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/__init__.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/algorithm.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/argument.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/base.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/common/enums.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/database.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/developer_algorithm_association.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/function.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/permission.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/review.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/role.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/role_rule_association.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/rule.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/model/user.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/permission.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/resource/algorithm.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/resource/role.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/resource/rule.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/resource/schema/input_schema.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/resource/user.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/resource/vantage6_server.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/resource/version.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/wsgi.py +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6_algorithm_store.egg-info/SOURCES.txt +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6_algorithm_store.egg-info/dependency_links.txt +0 -0
- {vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6_algorithm_store.egg-info/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ with open(os.path.join(here, "__build__")) as fp:
|
|
|
7
7
|
__build__ = json.load(fp)
|
|
8
8
|
|
|
9
9
|
# Module version
|
|
10
|
-
version_info = (4, 3,
|
|
10
|
+
version_info = (4, 3, 4, "final", __build__, 0)
|
|
11
11
|
|
|
12
12
|
# Module version stage suffix map
|
|
13
13
|
_specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": ""}
|
|
@@ -54,7 +54,7 @@ def get_default_roles() -> list[dict]:
|
|
|
54
54
|
]
|
|
55
55
|
REVIEWER_ROLE = {
|
|
56
56
|
"name": DefaultRole.REVIEWER,
|
|
57
|
-
"description": "Can view, edit and delete algorithms
|
|
57
|
+
"description": "Can view, edit and delete algorithms",
|
|
58
58
|
"rules": REVIEWER_RULES,
|
|
59
59
|
}
|
|
60
60
|
# 4. Store manager role
|
|
@@ -67,7 +67,7 @@ def get_default_roles() -> list[dict]:
|
|
|
67
67
|
]
|
|
68
68
|
STORE_MANAGER = {
|
|
69
69
|
"name": DefaultRole.STORE_MANAGER,
|
|
70
|
-
"description": "Can
|
|
70
|
+
"description": "Can manage algorithms, and create and edit users.",
|
|
71
71
|
"rules": STORE_MANAGER,
|
|
72
72
|
}
|
|
73
73
|
# 4. Developer role
|
|
@@ -38,5 +38,17 @@ class Vantage6Server(Base):
|
|
|
38
38
|
Vanatge6Server | None
|
|
39
39
|
Vanatge6Server object if found, None otherwise
|
|
40
40
|
"""
|
|
41
|
+
|
|
42
|
+
def _get_by_url(url):
|
|
43
|
+
return session.query(Vantage6Server).filter_by(url=url).first()
|
|
44
|
+
|
|
41
45
|
session = DatabaseSessionManager.get_session()
|
|
42
|
-
|
|
46
|
+
server = _get_by_url(url)
|
|
47
|
+
if not server:
|
|
48
|
+
if url.startswith("https") and url.endswith("443"):
|
|
49
|
+
url = url[:-4]
|
|
50
|
+
server = _get_by_url(url)
|
|
51
|
+
elif url.startswith("http") and url.endswith("80"):
|
|
52
|
+
url = url[:-3]
|
|
53
|
+
server = _get_by_url(url)
|
|
54
|
+
return server
|
|
@@ -59,14 +59,17 @@ def authenticate_with_server(*args, **kwargs):
|
|
|
59
59
|
return {"msg": msg}, HTTPStatus.BAD_REQUEST
|
|
60
60
|
|
|
61
61
|
# check if server is whitelisted
|
|
62
|
-
|
|
62
|
+
server_url = request.headers["Server-Url"]
|
|
63
|
+
server = Vantage6Server.get_by_url(server_url)
|
|
63
64
|
if not server:
|
|
64
|
-
msg =
|
|
65
|
+
msg = (
|
|
66
|
+
f"Server '{server_url}' you are trying to authenticate with is not "
|
|
67
|
+
"whitelisted"
|
|
68
|
+
)
|
|
65
69
|
log.warning(msg)
|
|
66
70
|
return {"msg": msg}, HTTPStatus.UNAUTHORIZED
|
|
67
71
|
|
|
68
72
|
# check if token is valid
|
|
69
|
-
|
|
70
73
|
url = f"{request.headers['Server-Url']}/token/user/validate"
|
|
71
74
|
# if we are looking for a localhost server, we probably have to
|
|
72
75
|
# check host.docker.internal (Windows) or 172.17.0.1 (Linux)
|
|
@@ -111,6 +111,12 @@ class Vantage6ServerOutputSchema(HATEOASModelSchema):
|
|
|
111
111
|
class Meta:
|
|
112
112
|
model = Vantage6Server
|
|
113
113
|
|
|
114
|
+
users = fields.Function(
|
|
115
|
+
lambda obj: create_one_to_many_link(
|
|
116
|
+
obj, link_to="user", link_from="v6_server_id"
|
|
117
|
+
)
|
|
118
|
+
)
|
|
119
|
+
|
|
114
120
|
|
|
115
121
|
class RoleOutputSchema(HATEOASModelSchema):
|
|
116
122
|
rules = fields.Function(
|
|
@@ -139,6 +145,7 @@ class UserOutputSchema(HATEOASModelSchema):
|
|
|
139
145
|
obj, link_to="algorithm", link_from="user_id"
|
|
140
146
|
)
|
|
141
147
|
)
|
|
148
|
+
server = fields.Nested("Vantage6ServerOutputSchema", exclude=["users"])
|
|
142
149
|
|
|
143
150
|
|
|
144
151
|
class ReviewOutputSchema(HATEOASModelSchema):
|
|
File without changes
|
|
File without changes
|
{vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/__build__
RENAMED
|
File without changes
|
|
File without changes
|
{vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/db.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vantage6-algorithm-store-4.3.2 → vantage6-algorithm-store-4.3.4}/vantage6/algorithm/store/wsgi.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|