diff --git a/Editor/TokenSourceComponentConfigEditor.cs b/Editor/TokenSourceComponentConfigEditor.cs index ad398a2a..03650d98 100644 --- a/Editor/TokenSourceComponentConfigEditor.cs +++ b/Editor/TokenSourceComponentConfigEditor.cs @@ -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")); } } diff --git a/Runtime/Scripts/TokenSource/TokenSource.cs b/Runtime/Scripts/TokenSource/TokenSource.cs index c4127a32..d923c4c0 100644 --- a/Runtime/Scripts/TokenSource/TokenSource.cs +++ b/Runtime/Scripts/TokenSource/TokenSource.cs @@ -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 { @@ -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) } } }; diff --git a/Runtime/Scripts/TokenSource/TokenSourceComponent.cs b/Runtime/Scripts/TokenSource/TokenSourceComponent.cs index e0b3cdec..e1db2a76 100644 --- a/Runtime/Scripts/TokenSource/TokenSourceComponent.cs +++ b/Runtime/Scripts/TokenSource/TokenSourceComponent.cs @@ -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), }; } diff --git a/Runtime/Scripts/TokenSource/TokenSourceComponentConfig.cs b/Runtime/Scripts/TokenSource/TokenSourceComponentConfig.cs index 6b04ce70..28f20a5d 100644 --- a/Runtime/Scripts/TokenSource/TokenSourceComponentConfig.cs +++ b/Runtime/Scripts/TokenSource/TokenSourceComponentConfig.cs @@ -42,6 +42,7 @@ public class TokenSourceComponentConfig : ScriptableObject [SerializeField] private List _participantAttributes; [SerializeField] private string _agentName; [SerializeField] private string _agentMetadata; + [SerializeField] private string _agentDeployment; public TokenSourceType TokenSourceType => _tokenSourceType; @@ -64,6 +65,7 @@ public class TokenSourceComponentConfig : ScriptableObject public List ParticipantAttributes => _participantAttributes; public string AgentName => _agentName; public string AgentMetadata => _agentMetadata; + public string AgentDeployment => _agentDeployment; public bool IsValid => _tokenSourceType switch { diff --git a/Runtime/Scripts/TokenSource/TokenSourceData.cs b/Runtime/Scripts/TokenSource/TokenSourceData.cs index 0a76fcfc..e80ac648 100644 --- a/Runtime/Scripts/TokenSource/TokenSourceData.cs +++ b/Runtime/Scripts/TokenSource/TokenSourceData.cs @@ -15,6 +15,10 @@ public class TokenSourceFetchOptions public Dictionary ParticipantAttributes { get; init; } public string AgentName { get; init; } public string AgentMetadata { get; init; } + /// + /// Optional deployment to target. Leave empty to target the production deployment. + /// + public string AgentDeployment { get; init; } } class TokenSourceRequest @@ -51,6 +55,12 @@ class AgentDispatch [JsonProperty("metadata", NullValueHandling = NullValueHandling.Ignore)] public string Metadata; + + /// + /// Optional deployment to target. Leave empty to target the production deployment. + /// + [JsonProperty("deployment", NullValueHandling = NullValueHandling.Ignore)] + public string Deployment; } ///