<div class="tab">
    <h2 class="tab-title">Attestation</h2>
    <div class="tab-content">
        <p class="help">
            The following table lists all Public Key Credential Attestation Options generated by the application.<br>
        </p>
        <table>
            <caption>Public Key Credential Attestation Options</caption>
            <thead>
            <tr>
                <th>Public Key Credential Attestation Options</th>
            </tr>
            </thead>
            <tbody>
            {% if not collector.getData().publicKeyCredentialCreationOptions is empty %}
                {% for id, data in collector.getData().publicKeyCredentialCreationOptions %}
                    <tr>
                        <td>
                            <span>{{ profiler_dump(data.options) }}</span>
                            <div class="text-small font-normal">
                                <a
                                    class="btn btn-link text-small sf-toggle sf-toggle-off"
                                    data-toggle-selector="#webauthn-pkcao-{{ id }}" data-toggle-alt-content="Hide JSON"
                                >
                                    Show JSON
                                </a>
                            </div>
                            <div id="webauthn-pkcao-{{ id }}" class="context sf-toggle-content sf-toggle-hidden">
                                <pre>{{ data.json }}</pre>
                            </div>
                        </td>
                    </tr>
                {% endfor %}
            {% else %}
                <tr>
                    <td colspan="1">No Public Key Credential Attestation Options have been generated</td>
                </tr>
            {% endif %}
            </tbody>
        </table>
        <p class="help">
            The following table lists all Authenticator Attestation validated by the application.<br>
        </p>
        <table>
            <caption>Verified Authenticator Attestations</caption>
            <thead>
            <tr>
                <th>Attestation Response</th>
                <th>Options</th>
                <th>Result</th>
            </tr>
            </thead>
            <tbody>
            {% if collector.getData().authenticatorAttestationResponseValidationSucceeded is empty and collector.getData().authenticatorAttestationResponseValidationFailed is empty %}
                <tr>
                    <td colspan="3">No Authenticator Attestation have been validated</td>
                </tr>
            {% endif %}
            {% if not collector.getData().authenticatorAttestationResponseValidationSucceeded is empty %}
                {% for id, data in collector.getData().authenticatorAttestationResponseValidationSucceeded %}
                    <tr>
                        <td>{{ profiler_dump(data.attestation_response) }}</td>
                        <td>
                            <span>{{ profiler_dump(data.options) }}</span>
                            <div class="text-small font-normal">
                                <a
                                    class="btn btn-link text-small sf-toggle sf-toggle-off"
                                    data-toggle-selector="#webauthn-attestation-validation-succeeded-{{ id }}"
                                    data-toggle-alt-content="Hide JSON"
                                >
                                    Show JSON
                                </a>
                            </div>
                            <div
                                id="webauthn-attestation-validation-succeeded-{{ id }}"
                                class="context sf-toggle-content sf-toggle-hidden"
                            >
                                <pre>{{ data.options_json }}</pre>
                            </div>
                        </td>
                        <td>
                            <span>{{ profiler_dump(data.credential_source) }}</span>
                        </td>
                    </tr>
                {% endfor %}
            {% endif %}
            {% if not collector.getData().authenticatorAttestationResponseValidationFailed is empty %}
                {% for id, data in collector.getData().authenticatorAttestationResponseValidationFailed %}
                    <tr>
                        <td>{{ profiler_dump(data.attestation_response) }}</td>
                        <td>
                            <span>{{ profiler_dump(data.options) }}</span>
                            <div class="text-small font-normal">
                                <a
                                    class="btn btn-link text-small sf-toggle sf-toggle-off"
                                    data-toggle-selector="#webauthn-attestation-validation-failed-{{ id }}"
                                    data-toggle-alt-content="Hide JSON"
                                >
                                    Show JSON
                                </a>
                            </div>
                            <div
                                id="webauthn-attestation-validation-failed-{{ id }}"
                                class="context sf-toggle-content sf-toggle-hidden"
                            >
                                <pre>{{ data.options_json }}</pre>
                            </div>
                        </td>
                        <td>
                            <span>{{ profiler_dump(data.exception) }}</span>
                        </td>
                    </tr>
                {% endfor %}
            {% endif %}
            </tbody>
        </table>
    </div>
</div>
