Commit 1cbf8d05 authored by Hermann Krumrey's avatar Hermann Krumrey

Change API version to 0

parent 044359e6
Pipeline #1864 passed with stages
in 3 minutes and 49 seconds
......@@ -33,7 +33,7 @@ class Config(BaseConfig):
:param parent: The base configuration
:return: None
"""
parent.API_VERSION = "5"
parent.API_VERSION = "0"
parent.STRINGS.update({
"password_changed": "PaSsWoRd ChAnGeD SuCeSsFuLlY"
})
......@@ -17,16 +17,12 @@ You should have received a copy of the GNU General Public License
along with fat-ffipd. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""
import os
from typing import List
from flask.blueprints import Blueprint
from puffotter.env import load_env_file
from puffotter.flask.base import db
from puffotter.flask.Config import Config
from puffotter.flask.initialize import init_flask
from puffotter.flask.wsgi import start_server
from fat_ffipd import sentry_dsn, root_path
from fat_ffipd.bg_tasks import bg_tasks
from fat_ffipd.Config import Config
def main():
......
......@@ -34,7 +34,7 @@ class TestConfig(_TestFramework):
"""
api_headers = self.generate_api_key_headers("1:100")
resp = self.client.get(
"/api/v5/authorize", headers=api_headers, json={}
"/api/v0/authorize", headers=api_headers, json={}
)
self.assertEqual(resp.status_code, 401)
data = json.loads(resp.data.decode("utf-8"))
......@@ -49,7 +49,7 @@ class TestConfig(_TestFramework):
user, _, _ = self.generate_sample_user()
_, api_key, _ = self.generate_api_key(user)
resp = self.client.get(
"/api/v5/authorize",
"/api/v0/authorize",
headers={"Authorization": "Basic " + api_key},
json={}
)
......@@ -71,7 +71,7 @@ class TestConfig(_TestFramework):
api_headers = self.generate_api_key_headers(api_key)
resp = self.client.get(
"/api/v5/authorize", headers=api_headers, json={}
"/api/v0/authorize", headers=api_headers, json={}
)
self.assertEqual(resp.status_code, 401)
data = json.loads(resp.data.decode("utf-8"))
......@@ -84,7 +84,7 @@ class TestConfig(_TestFramework):
:return: None
"""
user, password, _ = self.generate_sample_user()
resp = self.client.post("/api/v5/key", data={
resp = self.client.post("/api/v0/key", data={
"username": user.username,
"password": password
})
......@@ -106,7 +106,7 @@ class TestConfig(_TestFramework):
with patch("puffotter.flask.routes.api.user_management.request",
Mocker):
user, password, _ = self.generate_sample_user()
resp = self.client.post("/api/v5/key", json={
resp = self.client.post("/api/v0/key", json={
"username": user.username,
"password": password
})
......
......@@ -34,7 +34,7 @@ class TestApiKeyRoute(_TestFramework):
"""
user, password, _ = self.generate_sample_user()
self.assertEqual(len(ApiKey.query.all()), 0)
resp = self.client.post("/api/v5/key", json={
resp = self.client.post("/api/v0/key", json={
"username": user.username,
"password": password
})
......@@ -51,7 +51,7 @@ class TestApiKeyRoute(_TestFramework):
self.assertTrue(api_key_obj.verify_key(api_key))
resp = self.client.get(
"/api/v5/authorize", headers=api_headers, json={}
"/api/v0/authorize", headers=api_headers, json={}
)
self.assertEqual(resp.status_code, 200)
data = json.loads(resp.data.decode("utf-8"))
......@@ -77,7 +77,7 @@ class TestApiKeyRoute(_TestFramework):
self.assertEqual(len(ApiKey.query.all()), 0)
params = dict(base)
params.update(args)
resp = self.client.post("/api/v5/key", json=params)
resp = self.client.post("/api/v0/key", json=params)
self.assertEqual(resp.status_code, 401)
data = json.loads(resp.data.decode("utf-8"))
self.assertEqual(data["status"], "error")
......@@ -94,7 +94,7 @@ class TestApiKeyRoute(_TestFramework):
self.assertEqual(len(ApiKey.query.all()), 1)
resp = self.client.delete("/api/v5/key", json={"api_key": api_key})
resp = self.client.delete("/api/v0/key", json={"api_key": api_key})
self.assertEqual(resp.status_code, 200)
data = json.loads(resp.data.decode("utf-8"))
self.assertEqual(data["status"], "ok")
......@@ -116,7 +116,7 @@ class TestApiKeyRoute(_TestFramework):
]:
self.assertEqual(len(ApiKey.query.all()), 1)
resp = self.client.delete("/api/v5/key", json=params)
resp = self.client.delete("/api/v0/key", json=params)
self.assertEqual(resp.status_code, 401)
data = json.loads(resp.data.decode("utf-8"))
self.assertEqual(data["status"], "error")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment