Skip to content
Open
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 Editor/TokenSourceComponentConfigEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ private void DrawConnectionOptions()
EditorGUILayout.PropertyField(serializedObject.FindProperty("_participantAttributes"), true);
EditorGUILayout.PropertyField(serializedObject.FindProperty("_agentName"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("_agentMetadata"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("_agentDeployment"));
}
}
5 changes: 3 additions & 2 deletions Runtime/Scripts/TokenSource/TokenSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private static TokenSourceRequest BuildRequest(TokenSourceFetchOptions options)
request.ParticipantAttributes = null;
}

if (!string.IsNullOrEmpty(options.AgentName) || !string.IsNullOrEmpty(options.AgentMetadata))
if (!string.IsNullOrEmpty(options.AgentName) || !string.IsNullOrEmpty(options.AgentMetadata) || !string.IsNullOrEmpty(options.AgentDeployment))
{
request.RoomConfig = new RoomConfig
{
Expand All @@ -149,7 +149,8 @@ private static TokenSourceRequest BuildRequest(TokenSourceFetchOptions options)
new AgentDispatch
{
AgentName = NullIfEmpty(options.AgentName),
Metadata = NullIfEmpty(options.AgentMetadata)
Metadata = NullIfEmpty(options.AgentMetadata),
Deployment = NullIfEmpty(options.AgentDeployment)
}
}
};
Expand Down
1 change: 1 addition & 0 deletions Runtime/Scripts/TokenSource/TokenSourceComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ private static TokenSourceFetchOptions Coalesce(TokenSourceComponentConfig confi
ParticipantAttributes = participantAttributes,
AgentName = Coalesce(options?.AgentName, config.AgentName),
AgentMetadata = Coalesce(options?.AgentMetadata, config.AgentMetadata),
AgentDeployment = Coalesce(options?.AgentDeployment, config.AgentDeployment),
};
}

Expand Down
2 changes: 2 additions & 0 deletions Runtime/Scripts/TokenSource/TokenSourceComponentConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class TokenSourceComponentConfig : ScriptableObject
[SerializeField] private List<StringPair> _participantAttributes;
[SerializeField] private string _agentName;
[SerializeField] private string _agentMetadata;
[SerializeField] private string _agentDeployment;

public TokenSourceType TokenSourceType => _tokenSourceType;

Expand All @@ -64,6 +65,7 @@ public class TokenSourceComponentConfig : ScriptableObject
public List<StringPair> ParticipantAttributes => _participantAttributes;
public string AgentName => _agentName;
public string AgentMetadata => _agentMetadata;
public string AgentDeployment => _agentDeployment;

public bool IsValid => _tokenSourceType switch
{
Expand Down
10 changes: 10 additions & 0 deletions Runtime/Scripts/TokenSource/TokenSourceData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public class TokenSourceFetchOptions
public Dictionary<string, string> ParticipantAttributes { get; init; }
public string AgentName { get; init; }
public string AgentMetadata { get; init; }
/// <summary>
/// Optional deployment to target. Leave empty to target the production deployment.
/// </summary>
public string AgentDeployment { get; init; }
}

class TokenSourceRequest
Expand Down Expand Up @@ -51,6 +55,12 @@ class AgentDispatch

[JsonProperty("metadata", NullValueHandling = NullValueHandling.Ignore)]
public string Metadata;

/// <summary>
/// Optional deployment to target. Leave empty to target the production deployment.
/// </summary>
[JsonProperty("deployment", NullValueHandling = NullValueHandling.Ignore)]
public string Deployment;
}

/// <summary>
Expand Down
Loading