2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-09-02 15:25:44 +00:00

Merge pull request #1287 from Aravindh-Raju/aravindhr/remove-record-change-history

Temporarily remove record change history
This commit is contained in:
Nicholas Spadaccino
2023-08-22 10:17:41 -04:00
committed by GitHub
3 changed files with 10 additions and 32 deletions

View File

@@ -30,7 +30,8 @@ def check_changes_response(response, recordChanges=False, nextId=False, startFro
assert_that(change["userName"], is_("history-user")) assert_that(change["userName"], is_("history-user"))
def check_change_history_response(response, fqdn, type, recordChanges=False, nextId=False, startFrom=False, maxItems=100): def check_change_history_response(response, fqdn, type, recordChanges=False, nextId=False, startFrom=False,
maxItems=100):
""" """
:param type: type of the record :param type: type of the record
:param fqdn: fqdn of the record :param fqdn: fqdn of the record
@@ -208,6 +209,7 @@ def test_list_recordset_changes_max_items_boundaries(shared_zone_test_context):
assert_that(too_small, is_("maxItems was 0, maxItems must be between 0 exclusive and 100 inclusive")) assert_that(too_small, is_("maxItems was 0, maxItems must be between 0 exclusive and 100 inclusive"))
@pytest.mark.skip(reason="since record change history route is temporarily removed")
def test_list_recordset_history_no_authorization(shared_zone_test_context): def test_list_recordset_history_no_authorization(shared_zone_test_context):
""" """
Test that recordset history without authorization fails Test that recordset history without authorization fails
@@ -218,6 +220,7 @@ def test_list_recordset_history_no_authorization(shared_zone_test_context):
client.list_recordset_change_history(fqdn, type, sign_request=False, status=401) client.list_recordset_change_history(fqdn, type, sign_request=False, status=401)
@pytest.mark.skip(reason="since record change history route is temporarily removed")
def test_list_recordset_history_member_auth_success(shared_zone_test_context): def test_list_recordset_history_member_auth_success(shared_zone_test_context):
""" """
Test recordset history succeeds with membership auth for member of admin group Test recordset history succeeds with membership auth for member of admin group
@@ -229,6 +232,7 @@ def test_list_recordset_history_member_auth_success(shared_zone_test_context):
check_change_history_response(response, fqdn, type, recordChanges=True, startFrom=False, nextId=False) check_change_history_response(response, fqdn, type, recordChanges=True, startFrom=False, nextId=False)
@pytest.mark.skip(reason="since record change history route is temporarily removed")
def test_list_recordset_history_member_auth_no_access(shared_zone_test_context): def test_list_recordset_history_member_auth_no_access(shared_zone_test_context):
""" """
Test recordset history fails for user not in admin group with no acl rules Test recordset history fails for user not in admin group with no acl rules
@@ -239,6 +243,7 @@ def test_list_recordset_history_member_auth_no_access(shared_zone_test_context):
client.list_recordset_change_history(fqdn, type, status=403) client.list_recordset_change_history(fqdn, type, status=403)
@pytest.mark.skip(reason="since record change history route is temporarily removed")
def test_list_recordset_history_success(shared_zone_test_context): def test_list_recordset_history_success(shared_zone_test_context):
""" """
Test recordset history succeeds with membership auth for member of admin group Test recordset history succeeds with membership auth for member of admin group
@@ -250,6 +255,7 @@ def test_list_recordset_history_success(shared_zone_test_context):
check_change_history_response(response, fqdn, type, recordChanges=True, startFrom=False, nextId=False) check_change_history_response(response, fqdn, type, recordChanges=True, startFrom=False, nextId=False)
@pytest.mark.skip(reason="since record change history route is temporarily removed")
def test_list_recordset_history_paging(shared_zone_test_context): def test_list_recordset_history_paging(shared_zone_test_context):
""" """
Test paging for recordset history can use previous nextId as start key of next page Test paging for recordset history can use previous nextId as start key of next page
@@ -266,6 +272,7 @@ def test_list_recordset_history_paging(shared_zone_test_context):
check_change_history_response(response_2, fqdn, type, recordChanges=True, nextId=True, startFrom=response_1["nextId"], maxItems=1) check_change_history_response(response_2, fqdn, type, recordChanges=True, nextId=True, startFrom=response_1["nextId"], maxItems=1)
@pytest.mark.skip(reason="since record change history route is temporarily removed")
def test_list_recordset_history_returning_no_changes(shared_zone_test_context): def test_list_recordset_history_returning_no_changes(shared_zone_test_context):
""" """
Pass in startFrom of "2000" should return empty list because start key exceeded number of recordset change history Pass in startFrom of "2000" should return empty list because start key exceeded number of recordset change history
@@ -279,6 +286,7 @@ def test_list_recordset_history_returning_no_changes(shared_zone_test_context):
assert_that(response["maxItems"], is_(100)) assert_that(response["maxItems"], is_(100))
@pytest.mark.skip(reason="since record change history route is temporarily removed")
def test_list_recordset_history_default_max_items(shared_zone_test_context): def test_list_recordset_history_default_max_items(shared_zone_test_context):
""" """
Test default max items is 100 Test default max items is 100
@@ -291,6 +299,7 @@ def test_list_recordset_history_default_max_items(shared_zone_test_context):
check_change_history_response(response, fqdn, type, recordChanges=True, startFrom=False, nextId=False, maxItems=100) check_change_history_response(response, fqdn, type, recordChanges=True, startFrom=False, nextId=False, maxItems=100)
@pytest.mark.skip(reason="since record change history route is temporarily removed")
def test_list_recordset_history_max_items_boundaries(shared_zone_test_context): def test_list_recordset_history_max_items_boundaries(shared_zone_test_context):
""" """
Test 0 < max_items <= 100 Test 0 < max_items <= 100

View File

@@ -910,33 +910,6 @@ class RecordSetRoutingSpec
} }
} }
"GET recordset change history" should {
"return the recordset change" in {
Get(s"/recordsetchange/history?fqdn=rs1.ok.&recordType=A") ~> recordSetRoute ~> check {
val response = responseAs[ListRecordSetHistoryResponse]
response.zoneId shouldBe Some(okZone.id)
(response.recordSetChanges.map(_.id) should contain)
.only(rsChange1.id)
}
}
"return an error when the record fqdn and type is not defined" in {
Get(s"/recordsetchange/history") ~> recordSetRoute ~> check {
status shouldBe StatusCodes.BadRequest
}
}
"return a Bad Request when maxItems is out of Bounds" in {
Get(s"/recordsetchange/history?maxItems=101") ~> recordSetRoute ~> check {
status shouldBe StatusCodes.BadRequest
}
Get(s"/recordsetchange/history?maxItems=0") ~> recordSetRoute ~> check {
status shouldBe StatusCodes.BadRequest
}
}
}
"GET failed record set changes" should { "GET failed record set changes" should {
"return the failed record set changes" in { "return the failed record set changes" in {
val rsChangeFailed1 = rsChange1.copy(status = RecordSetChangeStatus.Failed) val rsChangeFailed1 = rsChange1.copy(status = RecordSetChangeStatus.Failed)

View File

@@ -169,7 +169,6 @@
@if(meta.sharedDisplayEnabled) { @if(meta.sharedDisplayEnabled) {
<th>Owner Group Name</th> <th>Owner Group Name</th>
} }
<th ng-if="rootAccountCanReview || userCanAccessGroup">Record History</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -377,9 +376,6 @@
title="Group with ID {{record.ownerGroupId}} no longer exists."><span class="fa fa-warning"></span> Group deleted</span> title="Group with ID {{record.ownerGroupId}} no longer exists."><span class="fa fa-warning"></span> Group deleted</span>
</td> </td>
} }
<td ng-if="rootAccountCanReview || (record.ownerGroupName && canAccessGroup(record.ownerGroupId))">
<span><button class="btn btn-info btn-sm" ng-click="viewRecordHistory(record.fqdn, record.type)">View History</button></span>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>