Skip to content

Commit f23eeaa

Browse files
committed
Renamed Agent365ToolsProdAppId → WorkIQToolsProdAppId which was already there
1 parent fdeef1b commit f23eeaa

11 files changed

Lines changed: 40 additions & 40 deletions

File tree

src/Microsoft.Agents.A365.DevTools.Cli/Commands/DevelopCommand.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,9 +797,9 @@ private static (List<object> updatedServers, int addedCount, int updatedCount) U
797797
// Warn when the resolved audience is still the legacy ATG AppId (V1 entry)
798798
var resolvedAudience = string.IsNullOrWhiteSpace(audience) ||
799799
audience.StartsWith("api://", StringComparison.OrdinalIgnoreCase)
800-
? McpConstants.Agent365ToolsProdAppId
800+
? McpConstants.WorkIQToolsProdAppId
801801
: audience;
802-
if (string.Equals(resolvedAudience, McpConstants.Agent365ToolsProdAppId, StringComparison.OrdinalIgnoreCase))
802+
if (string.Equals(resolvedAudience, McpConstants.WorkIQToolsProdAppId, StringComparison.OrdinalIgnoreCase))
803803
{
804804
logger.LogWarning("{Server} uses legacy ATG audience. Re-run add-mcp-servers after V2 endpoint is live.", existingServerName);
805805
}
@@ -868,9 +868,9 @@ private static (List<object> updatedServers, int addedCount, int updatedCount) U
868868
// Warn when the resolved audience is still the legacy ATG AppId (V1 entry)
869869
var resolvedAudienceForNew = string.IsNullOrWhiteSpace(audience) ||
870870
audience.StartsWith("api://", StringComparison.OrdinalIgnoreCase)
871-
? McpConstants.Agent365ToolsProdAppId
871+
? McpConstants.WorkIQToolsProdAppId
872872
: audience;
873-
if (string.Equals(resolvedAudienceForNew, McpConstants.Agent365ToolsProdAppId, StringComparison.OrdinalIgnoreCase))
873+
if (string.Equals(resolvedAudienceForNew, McpConstants.WorkIQToolsProdAppId, StringComparison.OrdinalIgnoreCase))
874874
{
875875
logger.LogWarning("{Server} uses legacy ATG audience. Re-run add-mcp-servers after V2 endpoint is live.", serverName);
876876
}

src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/PermissionsSubcommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private static Command CreateMcpSubcommand(
130130
logger.LogWarning("--remove-legacy-scopes will remove the shared ATG audience ({AtgAppId}) " +
131131
"from the blueprint. Agents still on V1 SDK will lose tool access. " +
132132
"Only proceed after V2 SDK is confirmed deployed.",
133-
McpConstants.Agent365ToolsProdAppId);
133+
McpConstants.WorkIQToolsProdAppId);
134134
Console.Write("Continue? [y/N]: ");
135135
var confirm = Console.ReadLine()?.Trim();
136136
if (!string.Equals(confirm, "y", StringComparison.OrdinalIgnoreCase))

src/Microsoft.Agents.A365.DevTools.Cli/Constants/ConfigConstants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public static string GetAgent365ToolsResourceAppId(string environment)
166166
// Default to production app ID
167167
return environment?.ToLower() switch
168168
{
169-
"prod" => McpConstants.Agent365ToolsProdAppId,
170-
_ => McpConstants.Agent365ToolsProdAppId
169+
"prod" => McpConstants.WorkIQToolsProdAppId,
170+
_ => McpConstants.WorkIQToolsProdAppId
171171
};
172172
}
173173
}

src/Microsoft.Agents.A365.DevTools.Cli/Constants/McpConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static class McpConstants
1010
{
1111

1212
// Agent 365 Tools App IDs for different environments
13-
public const string Agent365ToolsProdAppId = "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1";
13+
public const string WorkIQToolsProdAppId = "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1";
1414

1515
/// <summary>
1616
/// Agent 365 Tools identifier URI (used for admin consent URL construction).

src/Microsoft.Agents.A365.DevTools.Cli/Helpers/ManifestHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static void AddScopeString(HashSet<string> set, string scopeValue)
276276
/// Reads ToolingManifest.json and returns scopes grouped by their audience (resourceAppId).
277277
/// Supports V1 (shared ATG AppId), V2 (per-server AppId), and mixed manifests.
278278
/// Fallback rules when audience is missing or in legacy api:// format:
279-
/// → falls back to <see cref="McpConstants.Agent365ToolsProdAppId"/> (ATG AppId).
279+
/// → falls back to <see cref="McpConstants.WorkIQToolsProdAppId"/> (ATG AppId).
280280
/// </summary>
281281
/// <param name="manifestPath">Path to ToolingManifest.json</param>
282282
/// <param name="excludeLegacyAtg">
@@ -288,7 +288,7 @@ public static async Task<Dictionary<string, string[]>> GetScopesByAudienceAsync(
288288
string manifestPath,
289289
bool excludeLegacyAtg = false)
290290
{
291-
var atgAppId = McpConstants.Agent365ToolsProdAppId;
291+
var atgAppId = McpConstants.WorkIQToolsProdAppId;
292292
var scopesByAudience = new Dictionary<string, HashSet<string>>(StringComparer.OrdinalIgnoreCase);
293293

294294
// McpServersMetadata.Read.All is always required and belongs to the ATG AppId

src/Microsoft.Agents.A365.DevTools.Cli/Services/AuthenticationService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private async Task<TokenInfo> AuthenticateInteractivelyAsync(
194194
{
195195
string scope;
196196
// Check if this is the production App ID
197-
if (resourceUrl == McpConstants.Agent365ToolsProdAppId)
197+
if (resourceUrl == McpConstants.WorkIQToolsProdAppId)
198198
{
199199
scope = $"{resourceUrl}/.default";
200200
_logger.LogInformation("Authenticating to Agent 365 Tools");
@@ -205,9 +205,9 @@ private async Task<TokenInfo> AuthenticateInteractivelyAsync(
205205
// Use production App ID by default
206206
// For non-production environments, users should provide the App ID directly via config
207207
// or set environment variable A365_MCP_APP_ID (without environment suffix for backward compatibility)
208-
var appId = Environment.GetEnvironmentVariable("A365_MCP_APP_ID") ?? McpConstants.Agent365ToolsProdAppId;
208+
var appId = Environment.GetEnvironmentVariable("A365_MCP_APP_ID") ?? McpConstants.WorkIQToolsProdAppId;
209209

210-
if (appId != McpConstants.Agent365ToolsProdAppId)
210+
if (appId != McpConstants.WorkIQToolsProdAppId)
211211
{
212212
_logger.LogInformation("Using custom Agent 365 Tools App ID from A365_MCP_APP_ID environment variable");
213213
}
@@ -426,7 +426,7 @@ public async Task<string> GetAccessTokenForMcpAsync(string resourceUrl, string?
426426
public string[] ResolveScopesForResource(string resourceUrl, string? manifestPath = null)
427427
{
428428
// Default to Agent 365 Tools resource app ID scope for backward compatibility
429-
var scope = $"{McpConstants.Agent365ToolsProdAppId}/.default";
429+
var scope = $"{McpConstants.WorkIQToolsProdAppId}/.default";
430430
var defaultScopes = new[] { scope };
431431

432432
// If no manifest path provided, try to find it in current directory

src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Commands/DevelopCommandV1V2MigrationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public void AudienceResolution_MatchesAtgFallbackRules(string? rawAudience, bool
3131
// resolved = (null/empty/api://) ? ATG AppId : rawAudience
3232
var resolved = string.IsNullOrWhiteSpace(rawAudience) ||
3333
rawAudience.StartsWith("api://", StringComparison.OrdinalIgnoreCase)
34-
? McpConstants.Agent365ToolsProdAppId
34+
? McpConstants.WorkIQToolsProdAppId
3535
: rawAudience;
3636

37-
var isAtg = string.Equals(resolved, McpConstants.Agent365ToolsProdAppId,
37+
var isAtg = string.Equals(resolved, McpConstants.WorkIQToolsProdAppId,
3838
StringComparison.OrdinalIgnoreCase);
3939

4040
Assert.Equal(expectsAtg, isAtg);

src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Commands/PermissionsSubcommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public async Task ConfigureMcpPermissionsAsync_V1AndMetadataScopes_AreKnownAndPr
528528
{
529529
"mcpServerName": "mcp_MailTools",
530530
"scope": "McpServers.Mail.All",
531-
"audience": "{{Microsoft.Agents.A365.DevTools.Cli.Constants.McpConstants.Agent365ToolsProdAppId}}"
531+
"audience": "{{Microsoft.Agents.A365.DevTools.Cli.Constants.McpConstants.WorkIQToolsProdAppId}}"
532532
}
533533
]
534534
}

src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Helpers/ManifestHelperGetScopesByAudienceTests.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ public async Task V1Manifest_AllEntriesGroupUnderAtgAppId()
3939
"mcpServerName": "mcp_MailTools",
4040
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_MailTools",
4141
"scope": "McpServers.Mail.All",
42-
"audience": "{{McpConstants.Agent365ToolsProdAppId}}"
42+
"audience": "{{McpConstants.WorkIQToolsProdAppId}}"
4343
},
4444
{
4545
"mcpServerName": "mcp_CalendarTools",
4646
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_CalendarTools",
4747
"scope": "McpServers.Calendar.All",
48-
"audience": "{{McpConstants.Agent365ToolsProdAppId}}"
48+
"audience": "{{McpConstants.WorkIQToolsProdAppId}}"
4949
}
5050
]
5151
}
@@ -56,8 +56,8 @@ public async Task V1Manifest_AllEntriesGroupUnderAtgAppId()
5656

5757
// Assert — single key: ATG AppId
5858
Assert.Single(result);
59-
Assert.True(result.ContainsKey(McpConstants.Agent365ToolsProdAppId));
60-
var scopes = result[McpConstants.Agent365ToolsProdAppId];
59+
Assert.True(result.ContainsKey(McpConstants.WorkIQToolsProdAppId));
60+
var scopes = result[McpConstants.WorkIQToolsProdAppId];
6161
Assert.Contains("McpServers.Mail.All", scopes);
6262
Assert.Contains("McpServers.Calendar.All", scopes);
6363
Assert.Contains("McpServersMetadata.Read.All", scopes);
@@ -83,8 +83,8 @@ public async Task V1Manifest_NoAudienceField_FallsBackToAtgAppId()
8383
var result = await ManifestHelper.GetScopesByAudienceAsync(path);
8484

8585
// Assert — falls back to ATG AppId
86-
Assert.True(result.ContainsKey(McpConstants.Agent365ToolsProdAppId));
87-
Assert.Contains("McpServers.Mail.All", result[McpConstants.Agent365ToolsProdAppId]);
86+
Assert.True(result.ContainsKey(McpConstants.WorkIQToolsProdAppId));
87+
Assert.Contains("McpServers.Mail.All", result[McpConstants.WorkIQToolsProdAppId]);
8888
}
8989

9090
[Fact]
@@ -108,8 +108,8 @@ public async Task V1Manifest_ApiSlashAudienceFormat_FallsBackToAtgAppId()
108108
var result = await ManifestHelper.GetScopesByAudienceAsync(path);
109109

110110
// Assert — api:// audience treated as ATG fallback
111-
Assert.True(result.ContainsKey(McpConstants.Agent365ToolsProdAppId));
112-
Assert.Contains("McpServers.Mail.All", result[McpConstants.Agent365ToolsProdAppId]);
111+
Assert.True(result.ContainsKey(McpConstants.WorkIQToolsProdAppId));
112+
Assert.Contains("McpServers.Mail.All", result[McpConstants.WorkIQToolsProdAppId]);
113113
Assert.DoesNotContain("api://mcp-mailtools", result.Keys);
114114
}
115115

@@ -164,7 +164,7 @@ public async Task MixedManifest_ReturnsBothAtgAndPerServerKeys()
164164
{
165165
"mcpServerName": "mcp_MailTools",
166166
"scope": "McpServers.Mail.All",
167-
"audience": "{{McpConstants.Agent365ToolsProdAppId}}"
167+
"audience": "{{McpConstants.WorkIQToolsProdAppId}}"
168168
},
169169
{
170170
"mcpServerName": "mcp_TeamsServer",
@@ -179,9 +179,9 @@ public async Task MixedManifest_ReturnsBothAtgAndPerServerKeys()
179179
var result = await ManifestHelper.GetScopesByAudienceAsync(path);
180180

181181
// Assert — both keys present (additive by default)
182-
Assert.True(result.ContainsKey(McpConstants.Agent365ToolsProdAppId));
182+
Assert.True(result.ContainsKey(McpConstants.WorkIQToolsProdAppId));
183183
Assert.True(result.ContainsKey("2cc60bb0-1024-48c8-95f0-1fce211a04d8"));
184-
Assert.Contains("McpServers.Mail.All", result[McpConstants.Agent365ToolsProdAppId]);
184+
Assert.Contains("McpServers.Mail.All", result[McpConstants.WorkIQToolsProdAppId]);
185185
Assert.Contains("Tools.ListInvoke.All", result["2cc60bb0-1024-48c8-95f0-1fce211a04d8"]);
186186
}
187187

@@ -195,7 +195,7 @@ public async Task MixedManifest_ExcludeLegacyAtg_RemovesAtgKey()
195195
{
196196
"mcpServerName": "mcp_MailTools",
197197
"scope": "McpServers.Mail.All",
198-
"audience": "{{McpConstants.Agent365ToolsProdAppId}}"
198+
"audience": "{{McpConstants.WorkIQToolsProdAppId}}"
199199
},
200200
{
201201
"mcpServerName": "mcp_TeamsServer",
@@ -210,7 +210,7 @@ public async Task MixedManifest_ExcludeLegacyAtg_RemovesAtgKey()
210210
var result = await ManifestHelper.GetScopesByAudienceAsync(path, excludeLegacyAtg: true);
211211

212212
// Assert — ATG key gone, per-server key remains
213-
Assert.False(result.ContainsKey(McpConstants.Agent365ToolsProdAppId));
213+
Assert.False(result.ContainsKey(McpConstants.WorkIQToolsProdAppId));
214214
Assert.True(result.ContainsKey("2cc60bb0-1024-48c8-95f0-1fce211a04d8"));
215215
Assert.Contains("Tools.ListInvoke.All", result["2cc60bb0-1024-48c8-95f0-1fce211a04d8"]);
216216
}
@@ -227,8 +227,8 @@ public async Task EmptyManifest_ReturnsOnlyMetadataScopeUnderAtgAppId()
227227
var result = await ManifestHelper.GetScopesByAudienceAsync(path);
228228

229229
// Assert — McpServersMetadata.Read.All always seeded under ATG AppId
230-
Assert.True(result.ContainsKey(McpConstants.Agent365ToolsProdAppId));
231-
Assert.Contains("McpServersMetadata.Read.All", result[McpConstants.Agent365ToolsProdAppId]);
230+
Assert.True(result.ContainsKey(McpConstants.WorkIQToolsProdAppId));
231+
Assert.Contains("McpServersMetadata.Read.All", result[McpConstants.WorkIQToolsProdAppId]);
232232
}
233233

234234
[Fact]
@@ -241,7 +241,7 @@ public async Task ExcludeLegacyAtg_AllV1Entries_ReturnsEmptyDictionary()
241241
{
242242
"mcpServerName": "mcp_MailTools",
243243
"scope": "McpServers.Mail.All",
244-
"audience": "{{McpConstants.Agent365ToolsProdAppId}}"
244+
"audience": "{{McpConstants.WorkIQToolsProdAppId}}"
245245
}
246246
]
247247
}

src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Helpers/SetupHelpersConsentUrlTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void PopulateAdminConsentUrls_UpsertsConsentUrlIntoResourceConsents()
127127
};
128128
var mcpScopes = new[] { "McpServers.Mail.All" };
129129

130-
var names = SetupHelpers.PopulateAdminConsentUrls(config, McpConstants.Agent365ToolsProdAppId, mcpScopes);
130+
var names = SetupHelpers.PopulateAdminConsentUrls(config, McpConstants.WorkIQToolsProdAppId, mcpScopes);
131131

132132
names.Should().NotBeEmpty();
133133
config.ResourceConsents.Should().NotBeEmpty();
@@ -143,7 +143,7 @@ public void PopulateAdminConsentUrls_ReturnsResourceNamesForAllPopulatedUrls()
143143
AgentBlueprintId = BlueprintClientId,
144144
};
145145

146-
var names = SetupHelpers.PopulateAdminConsentUrls(config, McpConstants.Agent365ToolsProdAppId, new[] { "scope" });
146+
var names = SetupHelpers.PopulateAdminConsentUrls(config, McpConstants.WorkIQToolsProdAppId, new[] { "scope" });
147147

148148
names.Should().BeEquivalentTo(config.ResourceConsents.Select(rc => rc.ResourceName));
149149
}
@@ -163,7 +163,7 @@ public void PopulateAdminConsentUrls_WhenConsentAlreadyExists_UpdatesUrl()
163163
ConsentUrl = "https://old-url"
164164
});
165165

166-
SetupHelpers.PopulateAdminConsentUrls(config, McpConstants.Agent365ToolsProdAppId, new[] { "scope" });
166+
SetupHelpers.PopulateAdminConsentUrls(config, McpConstants.WorkIQToolsProdAppId, new[] { "scope" });
167167

168168
var botConsent = config.ResourceConsents.First(rc => rc.ResourceName == "Messaging Bot API");
169169
botConsent.ConsentUrl.Should().NotBe("https://old-url",

0 commit comments

Comments
 (0)