feat: Add MongoIdempotencyStoreOptions for MongoDB configuration
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
feat: Implement BsonJsonConverter for converting BsonDocument and BsonArray to JSON fix: Update project file to include MongoDB.Bson package test: Add GraphOverlayExporterTests to validate NDJSON export functionality refactor: Refactor Program.cs in Attestation Tool for improved argument parsing and error handling docs: Update README for stella-forensic-verify with usage instructions and exit codes feat: Enhance HmacVerifier with clock skew and not-after checks feat: Add MerkleRootVerifier and ChainOfCustodyVerifier for additional verification methods fix: Update DenoRuntimeShim to correctly handle file paths feat: Introduce ComposerAutoloadData and related parsing in ComposerLockReader test: Add tests for Deno runtime execution and verification test: Enhance PHP package tests to include autoload data verification test: Add unit tests for HmacVerifier and verification logic
This commit is contained in:
@@ -73,6 +73,44 @@ public sealed class DenoRuntimeTraceRunnerTests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecutesShimAndWritesRuntime_WhenDenoPresent()
|
||||
{
|
||||
var binary = DenoBinaryLocator.Find();
|
||||
if (string.IsNullOrWhiteSpace(binary))
|
||||
{
|
||||
return; // gracefully skip when deno is unavailable in the environment
|
||||
}
|
||||
|
||||
var root = TestPaths.CreateTemporaryDirectory();
|
||||
try
|
||||
{
|
||||
var entry = Path.Combine(root, "main.ts");
|
||||
var fixture = Path.Combine(TestPaths.GetProjectRoot(), "TestFixtures/deno-runtime/simple/main.ts");
|
||||
File.Copy(fixture, entry);
|
||||
|
||||
using var entryEnv = new EnvironmentVariableScope("STELLA_DENO_ENTRYPOINT", "main.ts");
|
||||
using var binaryEnv = new EnvironmentVariableScope("STELLA_DENO_BINARY", binary);
|
||||
using var denoDirEnv = new EnvironmentVariableScope("DENO_DIR", Path.Combine(root, ".deno-cache"));
|
||||
|
||||
var context = new LanguageAnalyzerContext(root, TimeProvider.System);
|
||||
var result = await DenoRuntimeTraceRunner.TryExecuteAsync(context, logger: null, CancellationToken.None);
|
||||
|
||||
Assert.True(result);
|
||||
|
||||
var runtimePath = Path.Combine(root, "deno-runtime.ndjson");
|
||||
Assert.True(File.Exists(runtimePath));
|
||||
|
||||
var content = await File.ReadAllTextAsync(runtimePath);
|
||||
Assert.Contains("deno.runtime.start", content);
|
||||
Assert.Contains("deno.module.load", content);
|
||||
}
|
||||
finally
|
||||
{
|
||||
TestPaths.SafeDelete(root);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class EnvironmentVariableScope : IDisposable
|
||||
{
|
||||
private readonly string _name;
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// offline-friendly deno entrypoint for shim smoke test
|
||||
console.log("shim-fixture-start");
|
||||
@@ -0,0 +1,47 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StellaOps.Scanner.Analyzers.Lang.Deno.Tests.TestUtilities;
|
||||
|
||||
internal static class DenoBinaryLocator
|
||||
{
|
||||
public static string? Find()
|
||||
{
|
||||
var candidates = new List<string>();
|
||||
var envBinary = Environment.GetEnvironmentVariable("STELLA_DENO_BINARY");
|
||||
if (!string.IsNullOrWhiteSpace(envBinary))
|
||||
{
|
||||
candidates.Add(envBinary);
|
||||
}
|
||||
|
||||
var path = Environment.GetEnvironmentVariable("PATH") ?? string.Empty;
|
||||
var separator = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ';' : ':';
|
||||
var exeName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "deno.exe" : "deno";
|
||||
|
||||
foreach (var segment in path.Split(separator, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
candidates.Add(Path.Combine(segment, exeName));
|
||||
}
|
||||
|
||||
foreach (var candidate in candidates)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(candidate))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (File.Exists(candidate))
|
||||
{
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignore malformed paths
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,18 @@
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/0123456789abcdef0123456789abcdef01234567",
|
||||
"shasum": "6f1b4c0908a5c2fdc3fbc0351d1a8f5f"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Illuminate\\": "src/Illuminate",
|
||||
"Laravel\\": ["src/Laravel", "src/Laravel/Support"]
|
||||
},
|
||||
"classmap": [
|
||||
"src/Illuminate/Support/helpers.php"
|
||||
],
|
||||
"files": [
|
||||
"src/Illuminate/Foundation/helpers.php"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -27,6 +39,14 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "9c9d4e1c8b62f9142fe995c3d76343d6330f0e36"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PHPUnit\\Framework\\": "src/Framework"
|
||||
},
|
||||
"files": [
|
||||
"src/Framework/Assert/Functions.php"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
"type": "composer",
|
||||
"usedByEntrypoint": false,
|
||||
"metadata": {
|
||||
"composer.autoload.classmap": "src/Illuminate/Support/helpers.php",
|
||||
"composer.autoload.files": "src/Illuminate/Foundation/helpers.php",
|
||||
"composer.autoload.psr4": "Illuminate\\->src/Illuminate;Laravel\\->src/Laravel;Laravel\\->src/Laravel/Support",
|
||||
"composer.content_hash": "e01f9b7d7f4b23a6d1ad3b8e91c1c4ae",
|
||||
"composer.dev": "false",
|
||||
"composer.dist.sha256": "6f1b4c0908a5c2fdc3fbc0351d1a8f5f",
|
||||
@@ -24,7 +27,7 @@
|
||||
"source": "composer.lock",
|
||||
"locator": "composer.lock",
|
||||
"value": "laravel/framework@10.48.7",
|
||||
"sha256": "469f987fef544c06365b59539ec5e48d5356011ff829b36b96ec1336be2de9d1"
|
||||
"sha256": "885d825c2fcde1ce56a468ef193ef63a815d357f11465e29f382d9777d9a5706"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -37,6 +40,8 @@
|
||||
"type": "composer",
|
||||
"usedByEntrypoint": false,
|
||||
"metadata": {
|
||||
"composer.autoload.files": "src/Framework/Assert/Functions.php",
|
||||
"composer.autoload.psr4": "PHPUnit\\Framework\\->src/Framework",
|
||||
"composer.content_hash": "e01f9b7d7f4b23a6d1ad3b8e91c1c4ae",
|
||||
"composer.dev": "true",
|
||||
"composer.plugin_api_version": "2.6.0",
|
||||
@@ -51,7 +56,7 @@
|
||||
"source": "composer.lock",
|
||||
"locator": "composer.lock",
|
||||
"value": "phpunit/phpunit@10.5.5",
|
||||
"sha256": "469f987fef544c06365b59539ec5e48d5356011ff829b36b96ec1336be2de9d1"
|
||||
"sha256": "885d825c2fcde1ce56a468ef193ef63a815d357f11465e29f382d9777d9a5706"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user