Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Redact plaintext sandbox access tokens from response string output to prevent accidental disclosure in logs.
- Set the next NuGet version and default user agent to `0.1.3`.
- Added delegated sandbox access token lifecycle methods and a separate token scoped sandbox handle.

Expand Down
5 changes: 4 additions & 1 deletion src/CreateOS.Sandbox/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public sealed record SandboxData
public sealed record SandboxAccessTokenCreateResponse(
string Token, bool Enabled,
[property: JsonPropertyName("created_at")] DateTimeOffset CreatedAt,
[property: JsonPropertyName("rotated_at")] DateTimeOffset? RotatedAt = null);
[property: JsonPropertyName("rotated_at")] DateTimeOffset? RotatedAt = null)
{
public override string ToString() => "SandboxAccessTokenCreateResponse { Token = [REDACTED] }";
}

/// <summary>Delegated token state without plaintext credential material.</summary>
public sealed record SandboxAccessTokenMetadata(
Expand Down
1 change: 1 addition & 0 deletions tests/CreateOS.Sandbox.Tests/SandboxInstanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public async Task AccessTokenLifecycleUsesScopedCredential()
var owner = Instance(transport, ingress: false);
var created = await owner.CreateAccessTokenAsync();
Assert.Equal("skp_sb_first", created.Token);
Assert.DoesNotContain(created.Token, created.ToString());
Assert.Equal("skp_sb...irst", (await owner.GetAccessTokenAsync()).TokenHint);
var worker = owner.WithAccessToken(created.Token);
Assert.NotSame(owner.Files, worker.Files);
Expand Down
Loading