commit 977845e0a63745c5133e57c5ecdfd7584dc8f7fe
Author: Stanislav Král <stanislav.kral3@gmail.com>
Date:   Sat May 1 18:52:46 2021 +0200

    Re #8708 - Changed /api/certificates/{id}/identity endpoint method back to POST (facepalm)
    
    Changed REST API tests accordingly.

diff --git a/app.py b/app.py
index 4f3cc8f..4534460 100644
--- a/app.py
+++ b/app.py
@@ -85,7 +85,7 @@ def get_ocsp_of_issuer_post(id, crl_ocsp_controller: CrlOcspController):
     return crl_ocsp_controller.get_ocsp_from_der(id, request.data)
 
 
-@app.route('/api/certificates/<id>/identity', methods=["GET"])
+@app.route('/api/certificates/<id>/identity', methods=["POST"])
 def generate_certificate_pkcs_identity(id, certificate_controller: CertController):
     return certificate_controller.generate_certificate_pkcs_identity(id)
 
diff --git a/src/swagger.yaml b/src/swagger.yaml
index 789f2b9..abe1ebf 100644
--- a/src/swagger.yaml
+++ b/src/swagger.yaml
@@ -367,7 +367,7 @@ paths:
               schema:
                 $ref: '#/components/schemas/ErrorResponse'
   /api/certificates/{id}/identity:
-    get:
+    post:
       tags:
       - certificates
       summary: Create a PCKS12 identity
diff --git a/tests/integration_tests/rest_api/certificates_test.py b/tests/integration_tests/rest_api/certificates_test.py
index 0508042..09e7423 100644
--- a/tests/integration_tests/rest_api/certificates_test.py
+++ b/tests/integration_tests/rest_api/certificates_test.py
@@ -953,8 +953,8 @@ def test_generate_identity(server):
         "name": "Foo Identity",
         "password": "foobarbaz"
     }
-    identity_ret = server.get(f"/api/certificates/{ret.json['data']}/identity", content_type="application/json",
-                              json=identity_details)
+    identity_ret = server.post(f"/api/certificates/{ret.json['data']}/identity", content_type="application/json",
+                               json=identity_details)
 
     # assert valid HTTP status code and correct content type
     assert identity_ret.status_code == 200
@@ -963,30 +963,30 @@ def test_generate_identity(server):
 
 def test_generate_identity_non_well_formed(server):
     # non integer ID
-    identity_ret = server.get(f"/api/certificates/foo/identity", content_type="application/json",
-                              json={})
+    identity_ret = server.post(f"/api/certificates/foo/identity", content_type="application/json",
+                               json={})
     assert identity_ret.status_code == 400
 
     # required fields not passed
-    identity_ret = server.get(f"/api/certificates/0/identity", content_type="application/json",
-                              json={})
+    identity_ret = server.post(f"/api/certificates/0/identity", content_type="application/json",
+                               json={})
     assert identity_ret.status_code == 400
     assert identity_ret.json == E_IDENTITY_NAME_NOT_SPECIFIED
 
     # passphrase not passed
-    identity_ret = server.get(f"/api/certificates/0/identity", content_type="application/json",
-                              json={"name": "Foo"})
+    identity_ret = server.post(f"/api/certificates/0/identity", content_type="application/json",
+                               json={"name": "Foo"})
     assert identity_ret.status_code == 400
     assert identity_ret.json == E_IDENTITY_PASSWORD_NOT_SPECIFIED
 
     # name not passed
-    identity_ret = server.get(f"/api/certificates/0/identity", content_type="application/json",
-                              json={"password": "foopass"})
+    identity_ret = server.post(f"/api/certificates/0/identity", content_type="application/json",
+                               json={"password": "foopass"})
     assert identity_ret.status_code == 400
     assert identity_ret.json == E_IDENTITY_NAME_NOT_SPECIFIED
 
     # certificate not existing
-    identity_ret = server.get(f"/api/certificates/0/identity", content_type="application/json",
-                              json={"password": "foopass", "name": "Foo"})
+    identity_ret = server.post(f"/api/certificates/0/identity", content_type="application/json",
+                               json={"password": "foopass", "name": "Foo"})
     assert identity_ret.status_code == 404
     assert identity_ret.json == E_NO_CERTIFICATES_FOUND
