• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HicServices / RDMP / 12050533881

27 Nov 2024 12:42PM UTC coverage: 57.449% (+0.06%) from 57.386%
12050533881

Pull #2006

github

web-flow
Task/rdmp 32 regex redaction (#2009)

* interim

* interim

* redact and add some tests

* add missing interface

* add regex redaction keys

* add helper

* add concept

* update interfaces

* add icons and fix restore

* add missing files

* add docs

* add regions

* add ignore

* add speed test

* improve speed

* improve speed

* update padding

* stress test

* add test case

* add fk names

* faster data load

* faster update

* more timers

* super fast redaction

* tidy up code

* woking keys

* improved

* add limiting

* shared helper

* shared

* interim

* working

* add summary

* restore tests working

* add tests

* start og ui update

* start of ui

* basic configuraion

* working add

* user interface

* update for tests

* update test

* tests

* tidy up

* updates

* fix merge

* ad dicons

* add missing icons

* tidyup

* fix tests

* add missing file

* update migration number

* add changelog

* add timeout

* fix build

* interim

* tidy up

* tidy up code

* add publish

* add todo

* add redact all

* add column

* update table

* add docs

* update markdown

* fix typo

* fix typos

* tidy up tests

* tidy up tests

* Include regex redaction doc in VS Solution file

* Update ExecuteCommandPerformRegexRedactionOnCatalogueTests.cs

Syntax cleanup

* Update ThrowImmediatelyActivator.cs

Remove obsolete comment

* Update ExecuteCommandPerformRegexRedactionOnCatalogueTests.cs

Start being green and recycling

* Update ExecuteCommandPerformRegexRedactionOnCatalogueTests.cs

Finish recycling test objects

---------

Co-authored-by: James A Sutherland <j@sutherland.pw>
Pull Request #2006: Release: 8.4.0

11298 of 21213 branches covered (53.26%)

Branch coverage included in aggregate %.

439 of 675 new or added lines in 30 files covered. (65.04%)

5 existing lines in 4 files now uncovered.

32146 of 54409 relevant lines covered (59.08%)

17122.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.59
/Rdmp.Core/Curation/DataHelper/RegexRedaction/RegexRedactionConfiguration.cs
1
// Copyright (c) The University of Dundee 2024-2024
2
// This file is part of the Research Data Management Platform (RDMP).
3
// RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4
// RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.
6

7
using Rdmp.Core.Curation.Data;
8
using Rdmp.Core.MapsDirectlyToDatabaseTable.Attributes;
9
using System.Text.RegularExpressions;
10
using Rdmp.Core.ReusableLibraryCode.Annotations;
11
using Rdmp.Core.Repositories;
12
using System.Collections.Generic;
13
using System.Data.Common;
14

15
namespace Rdmp.Core.Curation.DataHelper.RegexRedaction;
16

17
/// <summary>
18
/// Stores the configuration used to perform regex redactions
19
/// </summary>
20
public class RegexRedactionConfiguration : DatabaseEntity, IRegexRedactionConfiguration
21
{
22

23

24
    private string _regexPattern;
25
    private string _redactionString;
26
    private string _name;
27
    private string _description;
28

29
    public override string ToString()
30
    {
31
        return $"{_name}";
4!
32
    }
33

34
    [Unique]
35
    [NotNull]
36
    [UsefulProperty]
37
    public string Name
38
    {
39
        get => _name;
108✔
40
        set => SetField(ref _name, value);
4,646✔
41
    }
42

43
    public string Description
44
    {
45
        get => _description;
106✔
46
        set => SetField(ref _description, value);
4,646✔
47
    }
48

49
    [NotNull]
50
    public string RegexPattern
51
    {
52
        get => _regexPattern;
2,000,164✔
53
        set => SetField(ref _regexPattern, value.ToString());
4,646✔
54
    }
55

56
    [NotNull]
57
    public string RedactionString
58
    {
59
        get => _redactionString;
2,000,144✔
60
        set => SetField(ref _redactionString, value);
4,646✔
61
    }
62

NEW
63
    public RegexRedactionConfiguration() { }
×
64

65
    public RegexRedactionConfiguration(ICatalogueRepository repository, string name, Regex regexPattern, string redactionString, string description = null,string folder="\\")
42✔
66
    {
67
        repository.InsertAndHydrate(this, new Dictionary<string, object>
42✔
68
        {
42✔
69
            { "Name", name },
42✔
70
            { "RegexPattern", regexPattern.ToString() },
42✔
71
            {"RedactionString", redactionString },
42✔
72
            {"Description",description }
42✔
73
        });
42✔
74
    }
42✔
75

76
    internal RegexRedactionConfiguration(ICatalogueRepository repository, DbDataReader r) : base(repository, r)
4,604✔
77
    {
78
        Name = r["Name"].ToString();
4,604✔
79
        Description = r["Description"].ToString();
4,604✔
80
        RedactionString = r["RedactionString"].ToString();
4,604✔
81
        RegexPattern = r["RegexPattern"].ToString();
4,604✔
82
    }
4,604✔
83

84

85
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc