Implement API key validation middleware and add force shutdown endpoint
This commit is contained in:
@@ -104,4 +104,16 @@ dotnet run
|
||||
git add .
|
||||
git commit -m "Add steam running games"
|
||||
git push origin master
|
||||
dotnet publish -c Release -o ./publish
|
||||
dotnet publish -c Release -o ./publish
|
||||
|
||||
# devtest
|
||||
Invoke-WebRequest -Uri "http://localhost:5000/api/kill-process" -Method POST -Body "1234" -Headers @{ "X-API-KEY" = "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a" }
|
||||
|
||||
Invoke-WebRequest -Uri "http://192.168.50.52:5000/api/resource-usage" -Method GET -Headers @{ "X-API-KEY" = "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a" }
|
||||
|
||||
Use 'shutdown', 'restart', or 'cancel'.
|
||||
Invoke-WebRequest -Uri "http://192.168.50.52:5000/api/force-shutdown" `
|
||||
-Method POST `
|
||||
-Headers @{ "X-API-KEY" = "b7f3e8a1-4c2d-4d9f-9a6e-2a1c5d7f8e9a" } `
|
||||
-Body '{"Action": "shutdown", "DelaySeconds": 120}' `
|
||||
-ContentType "application/json"
|
||||
|
||||
Reference in New Issue
Block a user