Esempio n. 1
0
 def readiness_check():
     """
     A readiness probe checks if the container is ready to handle requests.
     A failed readiness probe means that a container should not receive any traffic from a proxy, even if it's running.
     """
     if issuer.tob_connection_synced():
         return make_response(jsonify({'success': True}), 200)
     else:
         abort(503, "Connection not ready to process requests")
Esempio n. 2
0
    def submit_credential():
        """
        Exposed method to proxy credential issuance requests.
        """
        if not issuer.tob_connection_synced():
            abort(503, "Connection not yet synced")

        start_time = time.perf_counter()
        method = 'submit_credential.batch'

        if not request.json:
            end_time = time.perf_counter()
            issuer.log_timing_method(method, start_time, end_time, False)
            abort(400)

        cred_input = request.json

        response = issuer.handle_send_credential(cred_input)

        end_time = time.perf_counter()
        logging.log_timing_method(method, start_time, end_time, True)

        return response
Esempio n. 3
0
 def health_check():
     if issuer.tob_connection_synced():
         return make_response(jsonify({'success': True}), 200)
     else:
         abort(503, "Connection not yet synced")
Esempio n. 4
0
def test_health_method(app):
    val = issuer.tob_connection_synced()
    assert val