https://github.com/gsscoder/integrity
Experimental .NET library to verify integrity of a system
https://github.com/gsscoder/integrity
Last synced: 5 months ago
JSON representation
Experimental .NET library to verify integrity of a system
- Host: GitHub
- URL: https://github.com/gsscoder/integrity
- Owner: gsscoder
- License: mit
- Created: 2020-02-08T05:44:28.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2021-12-08T06:19:57.000Z (about 4 years ago)
- Last Synced: 2025-05-19T23:08:46.519Z (7 months ago)
- Language: C#
- Size: 57.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Integrity
Experimental .NET library to verify integrity of a system.
## Philosophy
The idea behind Integrity is to allow testability of a system deployment. It's a library that can be used by any .NET language, but aims to become a **C# DSL**.
## Targets
- .NET Standard 2.0
- .NET Framework 4.6.1
## Build and sample
```sh
# clone the repository
$ git clone https://github.com/gsscoder/integrity.git
# build the package
$ cd integrity/src/Integrity
$ dotnet build -c release
# execute sample
$ cd integrity/src/Integrity.Sample
$ dotnet build -c debug
$ env INTEGRITY_SAMPLE="/absolute/path/to/integrity/src/Integrity.Sample/data" dotnet test
...
Test Run Successful.
Total tests: 1
Passed: 1
Total time: 2.5333 Seconds
```
## At a glance
**CSharp:**
```csharp
class MyApplication : Application
{
public Paths FileSystem => Paths
.SetBasePath(Environment.GetEnvironmentVariable("INTEGRITY_SAMPLE"))
.AddFile("empty0")
.AddFile("empty1")
.AddFile("empty2")
.AddDirectory("empty");
public Hosts Network => Hosts
.AddHost("github.com")
.AddHost("google.com");
}
public class IntegritySpecs
{
[Fact]
public async void Prove_integrity()
{
// Setup the proving context
var context = new MyApplication().ToProvingContext();
// Prove the system integrity
var evidence = await context.ProveAsync();
// Verify the outcome
evidence.ShouldBeProved();
}
}
```
## Libraries
- [System.IO.Abstractions](https://github.com/System-IO-Abstractions/System.IO.Abstractions)
- [RailwaySharp](https://github.com/gsscoder/railwaysharp)
- [CSharpx](https://github.com/gsscoder/csharpx)
- [xUnit.net](https://github.com/xunit/xunit)
- [FluentAssertions](https://github.com/fluentassertions/fluentassertions)
- [Bogus](https://github.com/bchavez/Bogus)
## Tools
- [Paket](https://github.com/fsprojects/Paket)
### Notes
- Integrity is still under development. Library has few `EvidenceProvider` and API could change.