Skip to content

Commit e03a952

Browse files
Maffoochclaude
andcommitted
devGregA strip cred + stub_finding inline blocks from templates_classic
Remove the cred panels, stub findings table, Credential Manager menu, and the dead quick-add-form JS in view_objects{,_eng}.html that referenced /stub_finding/.../promote and /stub_finding/.../delete. These templates referenced URL names removed in the dev merge (new_cred_*, promote_to_finding, delete_stub_finding) and would have thrown NoReverseMatch at render time. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b47fd51 commit e03a952

6 files changed

Lines changed: 0 additions & 663 deletions

File tree

dojo/templates_classic/base.html

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -535,13 +535,6 @@
535535
</a>
536536
</li>
537537
{% endif %}
538-
{% if system_settings.enable_credentials and "dojo.view_cred_user"|has_configuration_permission:request %}
539-
<li>
540-
<a href="{% url 'cred' %}">
541-
{% trans "Credential Manager" %}
542-
</a>
543-
</li>
544-
{% endif %}
545538
{% if system_settings.enable_github and "dojo.view_github_conf"|has_configuration_permission:request%}
546539
<li>
547540
<a href="{% url 'github' %}">
@@ -965,21 +958,6 @@ <h3 class="no-margin-top" style="padding-bottom: 5px;">
965958
</a>
966959
</li>
967960
{% endif %}
968-
{% if system_settings.enable_credentials %}
969-
<li role="separator" class="divider"></li>
970-
<li role="presentation">
971-
<a href="{% url 'new_cred_product' product_tab.product.id %}">
972-
<i class="fa-solid fa-plus"></i>
973-
{% trans "Add Credentials" %}
974-
</a>
975-
</li>
976-
<li role="presentation">
977-
<a href="{% url 'all_cred_product' product_tab.product.id %}">
978-
<i class="fa-solid fa-rectangle-list"></i>
979-
{% trans "View Credentials" %}
980-
</a>
981-
</li>
982-
{% endif %}
983961
<li role="separator" class="divider"></li>
984962
<li role="presentation">
985963
<a href="{% url 'new_tool_product' product_tab.product.id %}">

dojo/templates_classic/dojo/view_eng.html

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -927,110 +927,6 @@ <h3 class="panel-title"><span class="fa-solid fa-server" aria-hidden="true"></sp
927927
</div>
928928
</div>
929929
{% endif %}
930-
{% if system_settings.enable_credentials %}
931-
<div>
932-
<div class="panel panel-default-secondary">
933-
<div class="panel-heading">
934-
<h4><span class="fa-solid fa-key" aria-hidden="true"></span>
935-
Credentials
936-
{% if creds and eng|has_object_permission:"Engagement_Edit" %}
937-
<a title="Add New Credential" class="pull-right btn btn-sm btn-primary"
938-
href="{% url 'new_cred_product_engagement' eng.id %}"><span class="fa-solid fa-plus"></span></a>
939-
{% endif %}
940-
</h4>
941-
</div>
942-
<div class="table-responsive">
943-
<table class="table table-striped">
944-
<thead>
945-
<tr>
946-
<th>Name</th>
947-
<th></th>
948-
<th>Username</th>
949-
</tr>
950-
</thead>
951-
<tbody>
952-
{% if creds %}
953-
<tr>
954-
<td colspan="3">
955-
<small class="text-muted"><em>
956-
{% if cred_eng %}
957-
Credentials Configured for this <strong>Engagement</strong>
958-
{% else %}
959-
No Credentials Configured for this <strong>Engagement</strong>
960-
{% endif %}
961-
</em></small>
962-
</td>
963-
</tr>
964-
{% endif %}
965-
{% for cred in cred_eng %}
966-
<tr>
967-
<td>
968-
<a href="{% url 'view_cred_product_engagement' cred.engagement.id cred.id %}">{{ cred.cred_id.name }}</a>
969-
</td>
970-
<td>
971-
<ul>
972-
<li class="dropdown" style="list-style:none;">
973-
<a href="#" class="dropdown-toggle" data-toggle="dropdown">&nbsp;<b class="fa-solid fa-ellipsis-vertical"></b>&nbsp;</a>
974-
<ul class="dropdown-menu">
975-
{% if user.is_superuser %}
976-
<li>
977-
<a class="" href="{% url 'view_cred_product_engagement' cred.engagement.id cred.id %}">
978-
View</a>
979-
</li>
980-
{% endif %}
981-
{% if eng|has_object_permission:"Engagement_Edit" %}
982-
<li>
983-
<a class="" href="{% url 'delete_cred_engagement' cred.engagement.id cred.id %}">
984-
Delete</a>
985-
</li>
986-
{% endif %}
987-
</ul>
988-
</li>
989-
</ul>
990-
</td>
991-
<td>{{ cred.cred_id.username }}</td>
992-
</tr>
993-
{% endfor %}
994-
<tr>
995-
<td colspan="3">
996-
<small class="text-muted"><em>
997-
{% if creds %}
998-
Credentials Configured for this <strong>{{ labels.ASSET_LABEL }}</strong>
999-
{% else %}
1000-
No Credentials Configured for this <strong>{{ labels.ASSET_LABEL }}</strong>
1001-
{% endif %}
1002-
</em></small>
1003-
</td>
1004-
</tr>
1005-
{% for cred in creds %}
1006-
<tr>
1007-
<td>
1008-
<a href="{% url 'view_cred_product' cred.product.id cred.id %}">{{ cred.cred_id.name }}</a>
1009-
</td>
1010-
<td>
1011-
<ul>
1012-
<li class="dropdown" style="list-style:none;">
1013-
<a href="#" class="dropdown-toggle" data-toggle="dropdown">&nbsp;<b class="fa-solid fa-ellipsis-vertical"></b>&nbsp;</a>
1014-
<ul class="dropdown-menu">
1015-
{% if user.is_superuser %}
1016-
<li>
1017-
<a class="" href="{% url 'view_cred_product' cred.product.id cred.id %}">
1018-
View</a>
1019-
</li>
1020-
{% endif %}
1021-
</ul>
1022-
</li>
1023-
</ul>
1024-
</td>
1025-
<td>{{ cred.cred_id.username }}</td>
1026-
</tr>
1027-
{% endfor %}
1028-
</tbody>
1029-
</table>
1030-
</div>
1031-
</div>
1032-
</div>
1033-
{% endif %}
1034930
</div>
1035931
</div>
1036932
<div class="protip">

dojo/templates_classic/dojo/view_finding.html

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,118 +1076,6 @@ <h4>References <span class="pull-right"><a data-toggle="collapse" href="#vuln_re
10761076
</div>
10771077
</div>
10781078

1079-
<!--Cred Begin-->
1080-
{% if finding.static_finding != True and system_settings.enable_credentials %}
1081-
<div class="row">
1082-
<div class="col-md-12" id="cred">
1083-
<div class="panel panel-default">
1084-
<div class="panel-heading">
1085-
<h4>Credential
1086-
{% if not cred_finding and finding|has_object_permission:"Finding_Edit" %}
1087-
{% if cred_engagement or creds %}
1088-
<a title="Add New Credential" class="pull-right btn btn-primary btn-sm"
1089-
href="{% url 'new_cred_finding' finding.id %}"><span
1090-
class="fa-solid fa-plus"></span></a>
1091-
{% endif %}
1092-
{% endif %}
1093-
</h4>
1094-
</div>
1095-
{% if cred_finding or creds %}
1096-
<table class="tablesorter-bootstrap table table-condensed table-striped table-hover">
1097-
<thead>
1098-
<tr>
1099-
<th>Name</th>
1100-
<th>Username</th>
1101-
<th>Role</th>
1102-
<th>Environment</th>
1103-
<th>Authentication Provider</th>
1104-
<th>Login Valid</th>
1105-
<th>Actions</th>
1106-
</tr>
1107-
</thead>
1108-
<tbody>
1109-
{% if cred_finding %}
1110-
<tr>
1111-
<td colspan="7">
1112-
Credential Configured for this <strong>Finding</strong>
1113-
{% if not cred_finding %}
1114-
<br/>
1115-
<center>None configured</center>
1116-
{% endif %}
1117-
</td>
1118-
</tr>
1119-
1120-
{% for cred in cred_finding %}
1121-
<tr>
1122-
<td>
1123-
<a href="{{ cred.cred_id.url }}"
1124-
target="_blank">{{ cred.cred_id.name }}</a>
1125-
</td>
1126-
<td>{{ cred.cred_id.username }}</td>
1127-
<td>{{ cred.cred_id.role }}</td>
1128-
<td>{{ cred.cred_id.environment }}</td>
1129-
<td>{{ cred.is_authn_provider }}</td>
1130-
<td>{{ cred.cred_id.is_valid }}</td>
1131-
<td>
1132-
<div class="btn-group">
1133-
{% if user.is_superuser %}
1134-
<a class="btn btn-sm btn-secondary"
1135-
href="{% url 'view_cred_finding' cred.finding.id cred.id %}">View</a>
1136-
{% endif %}
1137-
{% if finding|has_object_permission:"Finding_Edit" %}
1138-
<a class="btn btn-sm btn-danger delete"
1139-
href="{% url 'delete_cred_finding' cred.finding.id cred.id %}">Delete</a>
1140-
{% endif %}
1141-
</div>
1142-
</td>
1143-
</tr>
1144-
{% endfor %}
1145-
{% endif %}
1146-
{% if not cred_finding %}
1147-
<tr>
1148-
<td colspan="7">
1149-
Credentials Inherited from <strong>Test: {{ finding.test }}</strong>
1150-
</td>
1151-
</tr>
1152-
{% for cred in creds %}
1153-
<tr>
1154-
<td>
1155-
<a href="{{ cred.cred_id.url }}"
1156-
target="_blank">{{ cred.cred_id.name }}</a>
1157-
</td>
1158-
<td>{{ cred.cred_id.username }}</td>
1159-
<td>{{ cred.cred_id.role }}</td>
1160-
<td>{{ cred.cred_id.environment }}</td>
1161-
<td>{{ cred.is_authn_provider }}</td>
1162-
<td>{{ cred.cred_id.is_valid }}</td>
1163-
<td>
1164-
<div class="btn-group">
1165-
<a class="btn btn-sm btn-primary"
1166-
href="{% url 'view_cred_engagement_test' cred.test.id cred.id %}">View</a>
1167-
</div>
1168-
</td>
1169-
</tr>
1170-
{% endfor %}
1171-
{% endif %}
1172-
1173-
1174-
</tbody>
1175-
</table>
1176-
{% else %}
1177-
<div class="panel-body">
1178-
<p>No credentials configured.
1179-
{% if not cred_engagement %}
1180-
Configure engagement credentials first, then add a credential to the test or
1181-
finding.
1182-
{% endif %}
1183-
</p>
1184-
</div>
1185-
{% endif %}
1186-
</div>
1187-
</div>
1188-
</div>
1189-
<!--Cred end -->
1190-
{% endif %}
11911079
</div>
11921080

11931081
{% include "dojo/snippets/sonarqube_history.html" with finding=finding only %}

0 commit comments

Comments
 (0)