Verified Commit 668c4708 authored by Vojtech Myslivec's avatar Vojtech Myslivec 🚀

Remove old get_cert request type

parent fed77efc
......@@ -44,7 +44,7 @@ def build_reply_auth_accepted(delay=DELAY_AUTH):
"status": "accepted",
"delay": delay,
"message": "Certification process started, wait for {} sec before"
" sending next 'get_cert' request".format(delay),
" sending next 'get' request".format(delay),
}
......@@ -62,7 +62,7 @@ def build_reply_get_wait(delay=DELAY_GET_SESSION_EXISTS):
"status": "wait",
"delay": delay,
"message": "Certification process still running, wait for"
" {} sec before sending another 'get_cert'"
" {} sec before sending another 'get'"
" request".format(delay),
}
......@@ -218,7 +218,7 @@ def get_auth_session(sn, sid, r):
session_json = r.get(get_session_key(sn, sid))
if not session_json: # authentication session open / certificate creation in progress
current_app.logger.debug("Authentication session not found, sn=%s, sid=%s", sn, sid)
raise RequestProcessError("Auth session not found. Did you send 'get_cert' request?")
raise RequestProcessError("Auth session not found. Did you send 'get' request?")
try:
session = json.loads(session_json.decode("utf-8"))
......@@ -295,7 +295,7 @@ def process_request(req, r, action):
try:
check_request(req, action)
if req["type"] == "get_cert" or req["type"] == "get":
if req["type"] == "get":
if action == "certs":
req["csr_str"] = req["csr"] # stupid different naming in req and internals
return process_req_get_cert(req, r)
......
......@@ -168,7 +168,7 @@ def check_request(req, action):
validate_sn(req["sn"])
validate_sid(req["sid"])
if req["type"] == "get" or req["type"] == "get_cert":
if req["type"] == "get":
check_params_exist(req, GET_REQ_PARAMS)
if action == "certs":
check_params_exist(req, GET_CERT_REQ_PARAMS)
......
......@@ -25,7 +25,7 @@ def redis_mock():
@pytest.fixture(params=[
{
"sn": "0000000A000001F3",
"type": "get_cert",
"type": "get",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\n"
"MIHoMIGOAgEAMBsxGTAXBgNVBAMMEDAwMDAwMDBBMDAwMDAxRjMwWTATBgcqhkjO\n"
"PQIBBggqhkjOPQMBBwNCAATZidHnuSVUH647KgxFnvgP74OTAdKdkSgVZEfyoAXy\n"
......@@ -48,7 +48,7 @@ good_reqs_get_cert = [
"sn": "0000000A000001F3",
"flags": [],
"sid": "4cca5561cf766855a02ee33f229acf4b144fdb7988abd85fd2bad3cfe2546d9f",
"type": "get_cert",
"type": "get",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\n"
"MIHnMIGOAgEAMBsxGTAXBgNVBAMMEDAwMDAwMDBBMDAwMDAxRjMwWTATBgcqhkjO\n"
"PQIBBggqhkjOPQMBBwNCAASCLeKIXMOsIdxYndnySeHcwv+EvJvp6RiXPd2gY/pz\n"
......@@ -58,7 +58,7 @@ good_reqs_get_cert = [
"-----END CERTIFICATE REQUEST-----\n"
},
{
"type": "get_cert",
"type": "get",
"auth_type": "atsha204",
"sid": "aea13dbed3b576cc8300d4710bdc708e6baff00f2e485ad2d9614fdc378fd4e0",
"flags": [],
......@@ -77,7 +77,7 @@ good_reqs_get_cert = [
@pytest.fixture(params=[
{ # bad sn
"sn": "0000000A000001F4",
"type": "get_cert",
"type": "get",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\n"
"MIHoMIGOAgEAMBsxGTAXBgNVBAMMEDAwMDAwMDBBMDAwMDAxRjMwWTATBgcqhkjO\n"
"PQIBBggqhkjOPQMBBwNCAATZidHnuSVUH647KgxFnvgP74OTAdKdkSgVZEfyoAXy\n"
......@@ -91,7 +91,7 @@ good_reqs_get_cert = [
},
{ # bad sid
"sn": "0000000A000001F3",
"type": "get_cert",
"type": "get",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\n"
"MIHoMIGOAgEAMBsxGTAXBgNVBAMMEDAwMDAwMDBBMDAwMDAxRjMwWTATBgcqhkjO\n"
"PQIBBggqhkjOPQMBBwNCAATZidHnuSVUH647KgxFnvgP74OTAdKdkSgVZEfyoAXy\n"
......@@ -105,7 +105,7 @@ good_reqs_get_cert = [
},
{ # bad auth_type
"sn": "0000000A000001F3",
"type": "get_cert",
"type": "get",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\n"
"MIHoMIGOAgEAMBsxGTAXBgNVBAMMEDAwMDAwMDBBMDAwMDAxRjMwWTATBgcqhkjO\n"
"PQIBBggqhkjOPQMBBwNCAATZidHnuSVUH647KgxFnvgP74OTAdKdkSgVZEfyoAXy\n"
......@@ -133,7 +133,7 @@ good_reqs_get_cert = [
},
{ # bad csr
"sn": "0000000A000001F3",
"type": "get_cert",
"type": "get",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\n"
"MIHoMIGOAgEAMBsxGTAXBgNMMEDAwMDAwMDBBMDAwMDAxRjMwWTATBgcqhkjO\n"
"PQIBBggqhkjOPQMBBwNCAATZidnuSVUH647KgxFnvgP74OTAdKdkSgVZEfyoAXy\n"
......@@ -147,7 +147,7 @@ good_reqs_get_cert = [
},
{ # bad flags
"sn": "0000000A000001F3",
"type": "get_cert",
"type": "get",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\n"
"MIHoMIGOAgEAMBsxGTAXBgNVBAMMEDAwMDAwMDBBMDAwMDAxRjMwWTATBgcqhkjO\n"
"PQIBBggqhkjOPQMBBwNCAATZidHnuSVUH647KgxFnvgP74OTAdKdkSgVZEfyoAXy\n"
......
......@@ -53,7 +53,7 @@ def good_sn_atsha(request):
@pytest.fixture(params=[
"get_cert",
"get",
"auth",
])
def good_req_types(request):
......@@ -61,7 +61,7 @@ def good_req_types(request):
@pytest.fixture(params=[
"get_certs",
"get_cert",
"",
" ",
None,
......
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