{% extends 'generic/object.html' %} {% load i18n %} {% load helpers %} {% load plugins %} {% block content %}

{% trans "Secret" %}

{% trans "Object" %} {{ object.assigned_object|linkify|placeholder }}
{% trans "Object type" %} {{ object.object_type.app_labeled_name }}
{% trans "Type" %} {{ object.secret_type|linkify }}
{% trans "Name" %} {{ object.name }}
{% trans "Description" %} {{ object.description|placeholder }}
{% include 'inc/panels/tags.html' %} {% plugin_left_page object %}
{# The value panel. Rendered for everyone so it is obvious a value exists; #} {# the reveal control itself appears only with the decrypt permission. #}

{% trans "Value" %}

{% if can_decrypt %} {# The token travels in the markup, not the cookie: NetBox sets CSRF_COOKIE_HTTPONLY, so document.cookie cannot see csrftoken and a fetch that reads it there sends an empty header. Django then answers 403 with an HTML page, which the script cannot parse as JSON. #}
{% else %}

{% trans "You do not have permission to reveal this secret's value." %}

{% endif %}

{% trans "Storage" %}

{% trans "ARN" %} {{ object.arn|placeholder }}
{% trans "Version" %} {{ object.version_id|placeholder }}
{% trans "Last written" %} {{ object.last_written|placeholder }}
{% trans "Written by" %} {{ object.last_written_by|placeholder }}
{% if object.has_previous_version and can_decrypt and perms.netbox_secrets_manager.change_secret %}

{% trans "A previous version exists. Someone with permission to change but not to reveal this secret can overwrite a value they cannot read; this restores the version before the last write." %}

{% csrf_token %}
{% endif %}
{% include 'inc/panels/custom_fields.html' %} {% include 'inc/panels/comments.html' %} {% plugin_right_page object %}
{% endblock content %} {% block javascript %} {{ block.super }} {% if can_decrypt %} {% endif %} {% endblock javascript %}