documentation cleanse, sprints work and planning. remaining non EF DAL migration to EF

This commit is contained in:
master
2026-02-25 01:24:07 +02:00
parent b07d27772e
commit 4db038123b
9090 changed files with 4836 additions and 2909 deletions

View File

@@ -0,0 +1,161 @@
Using launch settings from src\SmRemote\StellaOps.SmRemote.Service\Properties\launchSettings.json...
warn: Microsoft.AspNetCore.Server.Kestrel[0]
Overriding address(es) 'http://127.0.0.1:11033'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead.
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://127.0.0.1:11033
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://127.1.0.31:443
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://127.1.0.31:80
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\dev\New folder\git.stella-ops.org\src\SmRemote\StellaOps.SmRemote.Service
info: StellaOps.LocalHostname[0]
Also accessible at https://smremote.stella-ops.local and http://smremote.stella-ops.local
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://127.0.0.1:11033/health - - -
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: GET /health'
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[1]
Setting HTTP status code 200.
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[3]
Writing value of type 'SmHealthResponse' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: GET /health'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 GET http://127.0.0.1:11033/health - 200 - application/json;+charset=utf-8 68.6760ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://127.0.0.1:11033/health - - -
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: GET /health'
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[1]
Setting HTTP status code 200.
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[3]
Writing value of type 'SmHealthResponse' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: GET /health'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 GET http://127.0.0.1:11033/health - 200 - application/json;+charset=utf-8 1.2002ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET http://127.0.0.1:11033/status - - -
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: GET /status'
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[1]
Setting HTTP status code 200.
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[3]
Writing value of type 'SmStatusResponse' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: GET /status'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 GET http://127.0.0.1:11033/status - 200 - application/json;+charset=utf-8 8.9198ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:11033/hash - application/json;+charset=utf-8 72
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: POST /hash'
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[1]
Setting HTTP status code 200.
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[3]
Writing value of type 'HashResponse' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: POST /hash'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://127.0.0.1:11033/hash - 200 - application/json;+charset=utf-8 13.2869ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:11033/encrypt - application/json;+charset=utf-8 115
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: POST /encrypt'
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[1]
Setting HTTP status code 200.
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[3]
Writing value of type 'EncryptResponse' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: POST /encrypt'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://127.0.0.1:11033/encrypt - 200 - application/json;+charset=utf-8 11.7158ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:11033/decrypt - application/json;+charset=utf-8 130
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: POST /decrypt'
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[1]
Setting HTTP status code 200.
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[3]
Writing value of type 'DecryptResponse' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: POST /decrypt'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://127.0.0.1:11033/decrypt - 200 - application/json;+charset=utf-8 2.5989ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:11033/sign - application/json;+charset=utf-8 95
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: POST /sign'
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[1]
Setting HTTP status code 200.
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[3]
Writing value of type 'SignResponse' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: POST /sign'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://127.0.0.1:11033/sign - 200 - application/json;+charset=utf-8 100.4734ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:11033/verify - application/json;+charset=utf-8 206
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: POST /verify'
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[1]
Setting HTTP status code 200.
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[3]
Writing value of type 'VerifyResponse' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: POST /verify'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://127.0.0.1:11033/verify - 200 - application/json;+charset=utf-8 12.7557ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:11033/verify - application/json;+charset=utf-8 218
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: POST /verify'
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[1]
Setting HTTP status code 200.
info: Microsoft.AspNetCore.Http.Result.OkObjectResult[3]
Writing value of type 'VerifyResponse' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: POST /verify'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://127.0.0.1:11033/verify - 200 - application/json;+charset=utf-8 7.3233ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:11033/hash - application/json;+charset=utf-8 50
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: POST /hash'
info: Microsoft.AspNetCore.Http.Result.BadRequestObjectResult[1]
Setting HTTP status code 400.
info: Microsoft.AspNetCore.Http.Result.BadRequestObjectResult[3]
Writing value of type 'String' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: POST /hash'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://127.0.0.1:11033/hash - 400 - application/json;+charset=utf-8 1.1849ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:11033/encrypt - application/json;+charset=utf-8 103
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: POST /encrypt'
info: Microsoft.AspNetCore.Http.Result.BadRequestObjectResult[1]
Setting HTTP status code 400.
info: Microsoft.AspNetCore.Http.Result.BadRequestObjectResult[3]
Writing value of type 'String' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: POST /encrypt'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://127.0.0.1:11033/encrypt - 400 - application/json;+charset=utf-8 0.4887ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://127.0.0.1:11033/sign - application/json;+charset=utf-8 51
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'HTTP: POST /sign'
info: Microsoft.AspNetCore.Http.Result.BadRequestObjectResult[1]
Setting HTTP status code 400.
info: Microsoft.AspNetCore.Http.Result.BadRequestObjectResult[3]
Writing value of type 'String' as Json.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'HTTP: POST /sign'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished HTTP/1.1 POST http://127.0.0.1:11033/sign - 400 - application/json;+charset=utf-8 0.5671ms

View File

@@ -0,0 +1,3 @@
HTTP/1.1 200 OK
{"status":"ok"}

View File

@@ -0,0 +1,3 @@
HTTP/1.1 200 OK
{"available":true,"provider":"cn.sm.soft","algorithms":["SM2"]}

View File

@@ -0,0 +1,3 @@
HTTP/1.1 200 OK
{"algorithmId":"SM3","hashBase64":"sxpvMJAEzKz00qd+DUS1WDO58AaQ+HkVsK+Bf084iuE=","hashHex":"b31a6f309004ccacf4d2a77e0d44b55833b9f00690f87915b0af817f4f388ae1"}

View File

@@ -0,0 +1,3 @@
HTTP/1.1 200 OK
{"algorithmId":"SM4-ECB","ciphertextBase64":"K3mES8EomqIu9GgEI5/SVW4TN2QCdrx6wrRt7R8DK8Q="}

View File

@@ -0,0 +1,3 @@
HTTP/1.1 200 OK
{"algorithmId":"SM4-ECB","payloadBase64":"c21yZW1vdGUtdGllcjItcGF5bG9hZA=="}

View File

@@ -0,0 +1,3 @@
HTTP/1.1 200 OK
{"signature":"MEUCIQDC4bLJB2N6IhosD4IVUNx2OiHcCJLlXJcTbDVqv676fQIgWhzyGQai1rfhDNAxsH9zjzGFXMfXApjGIDc7aBZqa5A="}

View File

@@ -0,0 +1,3 @@
HTTP/1.1 200 OK
{"valid":true}

View File

@@ -0,0 +1,3 @@
HTTP/1.1 200 OK
{"valid":false}

View File

@@ -0,0 +1,3 @@
HTTP/1.1 400 Bad Request
"missing or invalid fields"

View File

@@ -0,0 +1,3 @@
HTTP/1.1 400 Bad Request
"invalid sm4 key length"

View File

@@ -0,0 +1,3 @@
HTTP/1.1 400 Bad Request
"missing or invalid fields"

View File

@@ -0,0 +1,6 @@
dotnet run --project src/SmRemote/StellaOps.SmRemote.Service/StellaOps.SmRemote.Service.csproj --no-build --configuration Release --urls http://127.0.0.1:11033
GET /health
GET /status
POST /hash (positive + invalid payload)
POST /encrypt + POST /decrypt (roundtrip + invalid key)
POST /sign + POST /verify (valid + tampered + invalid sign input)

View File

@@ -0,0 +1,13 @@
{
"filesModified": [
"src/SmRemote/__Tests/StellaOps.SmRemote.Service.Tests/SmRemoteServiceApiTests.cs",
"docs/features/checked/smremote/sm-remote-crypto-service.md",
"docs/qa/feature-checks/state/smremote.json",
"docs/implplan/SPRINT_20260211_006_SmRemote_unchecked_feature_verification.md"
],
"testsAdded": [
"SignThenVerify_ReportsValidAndInvalidOutcomes",
"EncryptEndpoint_WithInvalidKeyLength_ReturnsBadRequest"
],
"description": "Added regression tests and replayed strict Tier 0/1/2 verification with fresh run-005 evidence."
}

View File

@@ -0,0 +1,11 @@
{
"previousFailures": [
"run-001: missing /health,/hash,/encrypt,/decrypt endpoints and compose-contract mismatch"
],
"retestResults": [
"Tier 0 source verification passed.",
"Tier 1 build/test passed with 6/6 tests in StellaOps.SmRemote.Service.Tests.",
"Tier 2 API replay passed for health/status/hash/encrypt/decrypt/sign/verify and negative-path requests."
],
"verdict": "pass"
}

View File

@@ -0,0 +1,21 @@
{
"type": "source",
"module": "smremote",
"feature": "sm-remote-crypto-service",
"runId": "run-005",
"capturedAtUtc": "2026-02-11T09:33:28.4037800Z",
"filesChecked": [
"src/SmRemote/StellaOps.SmRemote.Service/Program.cs",
"src/SmRemote/__Tests/StellaOps.SmRemote.Service.Tests/SmRemoteServiceApiTests.cs",
"devops/compose/docker-compose.sm-remote.yml"
],
"found": [
"src/SmRemote/StellaOps.SmRemote.Service/Program.cs",
"src/SmRemote/__Tests/StellaOps.SmRemote.Service.Tests/SmRemoteServiceApiTests.cs",
"devops/compose/docker-compose.sm-remote.yml"
],
"missing": [
],
"verdict": "pass"
}

View File

@@ -0,0 +1,31 @@
{
"type": "build_test",
"module": "smremote",
"feature": "sm-remote-crypto-service",
"runId": "run-005",
"capturedAtUtc": "2026-02-11T09:33:28.4552786Z",
"project": "src/SmRemote/StellaOps.SmRemote.Service/StellaOps.SmRemote.Service.csproj",
"testProject": "src/SmRemote/__Tests/StellaOps.SmRemote.Service.Tests/StellaOps.SmRemote.Service.Tests.csproj",
"buildCommand": "dotnet build src/SmRemote/StellaOps.SmRemote.Service/StellaOps.SmRemote.Service.csproj -c Release --nologo",
"testCommand": "dotnet test src/SmRemote/__Tests/StellaOps.SmRemote.Service.Tests/StellaOps.SmRemote.Service.Tests.csproj -c Release --nologo",
"buildExitCode": 0,
"testExitCode": 0,
"testsRun": 6,
"testsPassed": 6,
"testsFailed": 0,
"codeReview": {
"mainServiceExists": true,
"logicMatchesFeatureIntent": true,
"behavioralTestsExist": true,
"testsAssertMeaningfulOutcomes": true,
"notes": [
"Program.cs exposes health/status/hash/encrypt/decrypt/sign/verify endpoints with validation paths.",
"SmRemoteServiceApiTests includes sign/verify valid+tampered flow and SM4 invalid-key rejection tests to guard missing-surface regressions."
]
},
"evidence": [
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/01-tier1-build.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/02-tier1-test.txt"
],
"verdict": "pass"
}

View File

@@ -0,0 +1,141 @@
{
"type": "api",
"module": "smremote",
"feature": "sm-remote-crypto-service",
"runId": "run-005",
"baseUrl": "http://127.0.0.1:11033",
"capturedAtUtc": "2026-02-11T09:33:28.4945099Z",
"requests": [
{
"description": "Health endpoint responds ok",
"method": "GET",
"path": "/health",
"expectedStatus": 200,
"actualStatus": 200,
"assertion": "service health endpoint is reachable",
"evidenceFile": "evidence/04-health.txt",
"result": "pass"
},
{
"description": "Status endpoint reports provider and algorithms",
"method": "GET",
"path": "/status",
"expectedStatus": 200,
"actualStatus": 200,
"assertion": "status endpoint returns provider availability",
"evidenceFile": "evidence/05-status.txt",
"result": "pass"
},
{
"description": "SM3 hash request succeeds",
"method": "POST",
"path": "/hash",
"expectedStatus": 200,
"actualStatus": 200,
"assertion": "hash response includes digest fields",
"evidenceFile": "evidence/06-hash.txt",
"result": "pass"
},
{
"description": "SM4 encrypt request succeeds",
"method": "POST",
"path": "/encrypt",
"expectedStatus": 200,
"actualStatus": 200,
"assertion": "encrypt response includes ciphertext",
"evidenceFile": "evidence/07-encrypt.txt",
"result": "pass"
},
{
"description": "SM4 decrypt roundtrip succeeds",
"method": "POST",
"path": "/decrypt",
"expectedStatus": 200,
"actualStatus": 200,
"assertion": "decrypt response restores input payload",
"evidenceFile": "evidence/08-decrypt.txt",
"result": "pass"
},
{
"description": "SM2 sign request succeeds",
"method": "POST",
"path": "/sign",
"expectedStatus": 200,
"actualStatus": 200,
"assertion": "sign response includes signature",
"evidenceFile": "evidence/09-sign.txt",
"result": "pass"
},
{
"description": "SM2 verify valid signature succeeds",
"method": "POST",
"path": "/verify",
"expectedStatus": 200,
"actualStatus": 200,
"assertion": "verify returns valid=true",
"evidenceFile": "evidence/10-verify-valid.txt",
"result": "pass"
},
{
"description": "SM2 verify tampered payload returns valid=false",
"method": "POST",
"path": "/verify",
"expectedStatus": 200,
"actualStatus": 200,
"assertion": "verify returns valid=false for tampered payload",
"evidenceFile": "evidence/11-verify-tampered.txt",
"result": "pass"
},
{
"description": "Invalid hash payload returns bad request",
"method": "POST",
"path": "/hash",
"expectedStatus": 400,
"actualStatus": 400,
"assertion": "invalid base64 is rejected",
"evidenceFile": "evidence/12-hash-invalid.txt",
"result": "pass"
},
{
"description": "Invalid SM4 key length returns bad request",
"method": "POST",
"path": "/encrypt",
"expectedStatus": 400,
"actualStatus": 400,
"assertion": "short key is rejected",
"evidenceFile": "evidence/13-encrypt-invalid-key.txt",
"result": "pass"
},
{
"description": "Invalid sign payload returns bad request",
"method": "POST",
"path": "/sign",
"expectedStatus": 400,
"actualStatus": 400,
"assertion": "missing sign fields are rejected",
"evidenceFile": "evidence/14-sign-invalid.txt",
"result": "pass"
}
],
"behaviorVerified": [
"Standalone SmRemote process serves /health and /status routes.",
"SM3 hash and SM4 encrypt/decrypt endpoints process positive requests and preserve roundtrip payload integrity.",
"SM2 sign/verify returns valid=true for matching payload/signature and valid=false for tampered payloads.",
"Negative inputs return expected 400 responses for invalid hash payload, invalid SM4 key length, and invalid sign payload."
],
"evidence": [
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/04-health.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/05-status.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/06-hash.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/07-encrypt.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/08-decrypt.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/09-sign.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/10-verify-valid.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/11-verify-tampered.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/12-hash-invalid.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/13-encrypt-invalid-key.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/14-sign-invalid.txt",
"docs/qa/feature-checks/runs/smremote/sm-remote-crypto-service/run-005/evidence/15-tier2-commands.txt"
],
"verdict": "pass"
}