Skip to content

Commit c231d7e

Browse files
feat(dotnet-utils): add the AI analysis and task read scopes
DVLS can now sign scope tokens for `gateway.recording.analyze`, to start an AI analysis of a recorded session, and `gateway.tasks.read`, to read a Task. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 1f063bb commit c231d7e

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎utils/dotnet/Devolutions.Gateway.Utils.Tests/JsonSerializationTests.cs‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,26 @@ public void ScopeClaimsAgentRead()
208208
Assert.Equal(EXPECTED, result);
209209
}
210210

211+
[Fact]
212+
public void ScopeClaimsRecordingAnalyze()
213+
{
214+
const string EXPECTED = """{"scope":"gateway.recording.analyze","jet_gw_id":"ccbaad3f-4627-4666-8bb5-cb6a1a7db815"}""";
215+
216+
var claims = new ScopeClaims(gatewayId, AccessScope.GatewayRecordingAnalyze);
217+
string result = JsonSerializer.Serialize(claims);
218+
Assert.Equal(EXPECTED, result);
219+
}
220+
221+
[Fact]
222+
public void ScopeClaimsTasksRead()
223+
{
224+
const string EXPECTED = """{"scope":"gateway.tasks.read","jet_gw_id":"ccbaad3f-4627-4666-8bb5-cb6a1a7db815"}""";
225+
226+
var claims = new ScopeClaims(gatewayId, AccessScope.GatewayTasksRead);
227+
string result = JsonSerializer.Serialize(claims);
228+
Assert.Equal(EXPECTED, result);
229+
}
230+
211231
[Fact]
212232
public void EnrollmentClaimsAllFields()
213233
{

‎utils/dotnet/Devolutions.Gateway.Utils/src/AccessScope.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ internal AccessScope(string value)
3030
public static AccessScope GatewayNetMonitorDrain = new AccessScope("gateway.net.monitor.drain");
3131
public static AccessScope GatewayAgentDelete = new AccessScope("gateway.agent.delete");
3232
public static AccessScope GatewayAgentRead = new AccessScope("gateway.agent.read");
33+
public static AccessScope GatewayRecordingAnalyze = new AccessScope("gateway.recording.analyze");
34+
public static AccessScope GatewayTasksRead = new AccessScope("gateway.tasks.read");
3335

3436
public override string? ToString()
3537
{

0 commit comments

Comments
 (0)