aboutsummaryrefslogtreecommitdiff
path: root/back-end/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'back-end/plugins')
-rw-r--r--back-end/plugins/nvault/src/Base64KeyEncoder.cs2
-rw-r--r--back-end/plugins/nvault/src/EncryptionResult.cs2
-rw-r--r--back-end/plugins/nvault/src/Endpoints/Endpoint.cs18
-rw-r--r--back-end/plugins/nvault/src/INostrCryptoProvider.cs2
-rw-r--r--back-end/plugins/nvault/src/INostrKeyEncoder.cs2
-rw-r--r--back-end/plugins/nvault/src/INostrOperations.cs2
-rw-r--r--back-end/plugins/nvault/src/INostrVault.cs2
-rw-r--r--back-end/plugins/nvault/src/ManagedCryptoprovider.cs2
-rw-r--r--back-end/plugins/nvault/src/ManagedVaultClient.cs2
-rw-r--r--back-end/plugins/nvault/src/Model/NostrContext.cs2
-rw-r--r--back-end/plugins/nvault/src/Model/NostrEvent.cs2
-rw-r--r--back-end/plugins/nvault/src/Model/NostrKeyMeta.cs2
-rw-r--r--back-end/plugins/nvault/src/Model/NostrKeyMetaStore.cs2
-rw-r--r--back-end/plugins/nvault/src/Model/NostrRelay.cs2
-rw-r--r--back-end/plugins/nvault/src/Model/NostrRelayFlags.cs2
-rw-r--r--back-end/plugins/nvault/src/Model/NostrRelayStore.cs2
-rw-r--r--back-end/plugins/nvault/src/NVault.csproj16
-rw-r--r--back-end/plugins/nvault/src/NativeSecp256k1Library.cs2
-rw-r--r--back-end/plugins/nvault/src/NostrEntry.cs2
-rw-r--r--back-end/plugins/nvault/src/NostrMessageKind.cs2
-rw-r--r--back-end/plugins/nvault/src/NostrOpProvider.cs2
21 files changed, 47 insertions, 25 deletions
diff --git a/back-end/plugins/nvault/src/Base64KeyEncoder.cs b/back-end/plugins/nvault/src/Base64KeyEncoder.cs
index 6e852ef..3b09a19 100644
--- a/back-end/plugins/nvault/src/Base64KeyEncoder.cs
+++ b/back-end/plugins/nvault/src/Base64KeyEncoder.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/EncryptionResult.cs b/back-end/plugins/nvault/src/EncryptionResult.cs
index ad08629..10741d2 100644
--- a/back-end/plugins/nvault/src/EncryptionResult.cs
+++ b/back-end/plugins/nvault/src/EncryptionResult.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/Endpoints/Endpoint.cs b/back-end/plugins/nvault/src/Endpoints/Endpoint.cs
index 4223a10..b8aa0c9 100644
--- a/back-end/plugins/nvault/src/Endpoints/Endpoint.cs
+++ b/back-end/plugins/nvault/src/Endpoints/Endpoint.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@@ -27,6 +27,7 @@ using FluentValidation;
using NVault.VaultExtensions;
+using VNLib.Utils.Logging;
using VNLib.Utils.Extensions;
using VNLib.Plugins;
using VNLib.Plugins.Essentials;
@@ -46,6 +47,8 @@ namespace NVault.Plugins.Vault.Endpoints
[ConfigurationName("endpoint")]
internal class Endpoint : ProtectedWebEndpoint
{
+ const string EventLogTemplate = "Method {m}, UserID {uid}, Type {tp} Payload {p}";
+
private static IValidator<NostrEvent> EventValidator { get; } = NostrEvent.GetValidator();
private static IValidator<NostrRelay> RelayValidator { get; } = NostrRelay.GetValidator();
private static IValidator<NostrKeyMeta> KeyMetaValidator { get; } = NostrKeyMeta.GetValidator();
@@ -57,6 +60,7 @@ namespace NVault.Plugins.Vault.Endpoints
private readonly NostrRelayStore _relays;
private readonly NostrKeyMetaStore _publicKeyStore;
private readonly bool AllowDelete;
+ private readonly ILogProvider? _abnoxiousLog;
public Endpoint(PluginBase plugin, IConfigScope config)
{
@@ -71,6 +75,12 @@ namespace NVault.Plugins.Vault.Endpoints
_relays = new NostrRelayStore(options);
_publicKeyStore = new NostrKeyMetaStore(options);
_vault = new NostrOpProvider(plugin);
+
+ //Check for obnoxious logging
+ if (plugin.HostArgs.HasArgument("--nvault-obnoxious"))
+ {
+ _abnoxiousLog = plugin.Log.CreateScope("NVAULT EVENT");
+ }
}
@@ -151,6 +161,8 @@ namespace NVault.Plugins.Vault.Endpoints
return VirtualOk(entity, webm);
}
+ _abnoxiousLog?.Information(EventLogTemplate, "POST", entity.Session.UserID[..10], "sign-event", nEvent);
+
//Create user scope
VaultUserScope scope = new(entity.Session.UserID);
@@ -193,6 +205,8 @@ namespace NVault.Plugins.Vault.Endpoints
return VirtualClose(entity, webm, HttpStatusCode.NotFound);
}
+ _abnoxiousLog?.Information(EventLogTemplate, "POST", entity.Session.UserID[..10], "decrypt-message", request);
+
VaultUserScope scope = new(entity.Session.UserID);
//Try to decrypt the message
@@ -233,6 +247,8 @@ namespace NVault.Plugins.Vault.Endpoints
return VirtualClose(entity, webm, HttpStatusCode.NotFound);
}
+ _abnoxiousLog?.Information(EventLogTemplate, "POST", entity.Session.UserID[..10], "encrypt-message", request);
+
VaultUserScope scope = new(entity.Session.UserID);
try
{
diff --git a/back-end/plugins/nvault/src/INostrCryptoProvider.cs b/back-end/plugins/nvault/src/INostrCryptoProvider.cs
index b66757c..c65d3e9 100644
--- a/back-end/plugins/nvault/src/INostrCryptoProvider.cs
+++ b/back-end/plugins/nvault/src/INostrCryptoProvider.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/INostrKeyEncoder.cs b/back-end/plugins/nvault/src/INostrKeyEncoder.cs
index a76ab19..fe1b379 100644
--- a/back-end/plugins/nvault/src/INostrKeyEncoder.cs
+++ b/back-end/plugins/nvault/src/INostrKeyEncoder.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/INostrOperations.cs b/back-end/plugins/nvault/src/INostrOperations.cs
index efb5947..c3a3053 100644
--- a/back-end/plugins/nvault/src/INostrOperations.cs
+++ b/back-end/plugins/nvault/src/INostrOperations.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/INostrVault.cs b/back-end/plugins/nvault/src/INostrVault.cs
index 37bc05e..e710538 100644
--- a/back-end/plugins/nvault/src/INostrVault.cs
+++ b/back-end/plugins/nvault/src/INostrVault.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/ManagedCryptoprovider.cs b/back-end/plugins/nvault/src/ManagedCryptoprovider.cs
index 2eeae56..fb15b8f 100644
--- a/back-end/plugins/nvault/src/ManagedCryptoprovider.cs
+++ b/back-end/plugins/nvault/src/ManagedCryptoprovider.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/ManagedVaultClient.cs b/back-end/plugins/nvault/src/ManagedVaultClient.cs
index ff7977c..2e523c4 100644
--- a/back-end/plugins/nvault/src/ManagedVaultClient.cs
+++ b/back-end/plugins/nvault/src/ManagedVaultClient.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/Model/NostrContext.cs b/back-end/plugins/nvault/src/Model/NostrContext.cs
index b70a38e..15900e2 100644
--- a/back-end/plugins/nvault/src/Model/NostrContext.cs
+++ b/back-end/plugins/nvault/src/Model/NostrContext.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/Model/NostrEvent.cs b/back-end/plugins/nvault/src/Model/NostrEvent.cs
index ccd5a2c..9bbfd63 100644
--- a/back-end/plugins/nvault/src/Model/NostrEvent.cs
+++ b/back-end/plugins/nvault/src/Model/NostrEvent.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/Model/NostrKeyMeta.cs b/back-end/plugins/nvault/src/Model/NostrKeyMeta.cs
index 2e18ba7..3f0b985 100644
--- a/back-end/plugins/nvault/src/Model/NostrKeyMeta.cs
+++ b/back-end/plugins/nvault/src/Model/NostrKeyMeta.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/Model/NostrKeyMetaStore.cs b/back-end/plugins/nvault/src/Model/NostrKeyMetaStore.cs
index 96d0a3c..bfb6a26 100644
--- a/back-end/plugins/nvault/src/Model/NostrKeyMetaStore.cs
+++ b/back-end/plugins/nvault/src/Model/NostrKeyMetaStore.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/Model/NostrRelay.cs b/back-end/plugins/nvault/src/Model/NostrRelay.cs
index e80d268..ab8cea7 100644
--- a/back-end/plugins/nvault/src/Model/NostrRelay.cs
+++ b/back-end/plugins/nvault/src/Model/NostrRelay.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/Model/NostrRelayFlags.cs b/back-end/plugins/nvault/src/Model/NostrRelayFlags.cs
index 352ff11..29f3994 100644
--- a/back-end/plugins/nvault/src/Model/NostrRelayFlags.cs
+++ b/back-end/plugins/nvault/src/Model/NostrRelayFlags.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/Model/NostrRelayStore.cs b/back-end/plugins/nvault/src/Model/NostrRelayStore.cs
index 42f48ab..699124b 100644
--- a/back-end/plugins/nvault/src/Model/NostrRelayStore.cs
+++ b/back-end/plugins/nvault/src/Model/NostrRelayStore.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/NVault.csproj b/back-end/plugins/nvault/src/NVault.csproj
index fa82c90..d83dd2f 100644
--- a/back-end/plugins/nvault/src/NVault.csproj
+++ b/back-end/plugins/nvault/src/NVault.csproj
@@ -1,7 +1,7 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFramework>net6.0</TargetFramework>
+ <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<EnableDynamicLoading>true</EnableDynamicLoading>
<PackageReadmeFile>README.md</PackageReadmeFile>
@@ -21,9 +21,9 @@
<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.9.0" />
- <PackageReference Include="VNLib.Plugins.Extensions.Data" Version="0.1.0-ci0045" />
- <PackageReference Include="VNLib.Plugins.Extensions.Validation" Version="0.1.0-ci0045" />
- <PackageReference Include="VNLib.Plugins.Extensions.Loading.Sql" Version="0.1.0-ci0045" />
+ <PackageReference Include="VNLib.Plugins.Extensions.Data" Version="0.1.0-ci0047" />
+ <PackageReference Include="VNLib.Plugins.Extensions.Validation" Version="0.1.0-ci0047" />
+ <PackageReference Include="VNLib.Plugins.Extensions.Loading.Sql" Version="0.1.0-ci0047" />
</ItemGroup>
<ItemGroup>
@@ -36,5 +36,11 @@
</None>
</ItemGroup>
+ <ItemGroup>
+ <None Update="NVault.json">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+
</Project>
diff --git a/back-end/plugins/nvault/src/NativeSecp256k1Library.cs b/back-end/plugins/nvault/src/NativeSecp256k1Library.cs
index 2fcf447..abbafaf 100644
--- a/back-end/plugins/nvault/src/NativeSecp256k1Library.cs
+++ b/back-end/plugins/nvault/src/NativeSecp256k1Library.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/NostrEntry.cs b/back-end/plugins/nvault/src/NostrEntry.cs
index bdb78bb..2e57390 100644
--- a/back-end/plugins/nvault/src/NostrEntry.cs
+++ b/back-end/plugins/nvault/src/NostrEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/NostrMessageKind.cs b/back-end/plugins/nvault/src/NostrMessageKind.cs
index 2a53928..507e941 100644
--- a/back-end/plugins/nvault/src/NostrMessageKind.cs
+++ b/back-end/plugins/nvault/src/NostrMessageKind.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
diff --git a/back-end/plugins/nvault/src/NostrOpProvider.cs b/back-end/plugins/nvault/src/NostrOpProvider.cs
index 5908e26..48ffe93 100644
--- a/back-end/plugins/nvault/src/NostrOpProvider.cs
+++ b/back-end/plugins/nvault/src/NostrOpProvider.cs
@@ -1,4 +1,4 @@
-// Copyright (C) 2023 Vaughn Nugent
+// Copyright (C) 2024 Vaughn Nugent
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as