aboutsummaryrefslogtreecommitdiff
path: root/VNLib.Plugins.Essentials.Accounts/Endpoints/KeepAliveEndpoint.cs
diff options
context:
space:
mode:
authorLibravatar vman <public@vaughnnugent.com>2022-11-18 16:08:51 -0500
committerLibravatar vman <public@vaughnnugent.com>2022-11-18 16:08:51 -0500
commit526c2364b9ad685d1c000fc8a168bf1305aaa8b7 (patch)
treea2bc01607320a6a75e1a869d5bd34e79fd63c595 /VNLib.Plugins.Essentials.Accounts/Endpoints/KeepAliveEndpoint.cs
parent2080400119be00bdc354f3121d84ec2f89606ac7 (diff)
Add project files.
Diffstat (limited to 'VNLib.Plugins.Essentials.Accounts/Endpoints/KeepAliveEndpoint.cs')
-rw-r--r--VNLib.Plugins.Essentials.Accounts/Endpoints/KeepAliveEndpoint.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/VNLib.Plugins.Essentials.Accounts/Endpoints/KeepAliveEndpoint.cs b/VNLib.Plugins.Essentials.Accounts/Endpoints/KeepAliveEndpoint.cs
new file mode 100644
index 0000000..eec1a33
--- /dev/null
+++ b/VNLib.Plugins.Essentials.Accounts/Endpoints/KeepAliveEndpoint.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Net;
+using System.Text.Json;
+using System.Collections.Generic;
+
+using VNLib.Plugins.Essentials.Endpoints;
+using VNLib.Plugins.Extensions.Loading;
+
+namespace VNLib.Plugins.Essentials.Accounts.Endpoints
+{
+ [ConfigurationName("keepalive_endpoint")]
+ internal sealed class KeepAliveEndpoint : ProtectedWebEndpoint
+ {
+ /*
+ * Endpoint does not use a log, so IniPathAndLog is never called
+ * and path verification happens verbosly
+ */
+ public KeepAliveEndpoint(PluginBase pbase, IReadOnlyDictionary<string, JsonElement> config)
+ {
+ string? path = config["path"].GetString();
+
+ InitPathAndLog(path, pbase.Log);
+ }
+
+ protected override VfReturnType Get(HttpEntity entity)
+ {
+ //Return okay
+ entity.CloseResponse(HttpStatusCode.OK);
+ return VfReturnType.VirtualSkip;
+ }
+
+ //Allow post to update user's credentials
+ protected override VfReturnType Post(HttpEntity entity)
+ {
+ //Return okay
+ entity.CloseResponse(HttpStatusCode.OK);
+ return VfReturnType.VirtualSkip;
+ }
+ }
+} \ No newline at end of file