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
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ private static bool IsValidLifecycleEvent(string lifecycleEvent)
Events.AgenticUserIdentityCreated => true,
Events.AgenticUserWorkloadOnboardingUpdated => true,
Events.AgenticUserDeleted => true,
Events.AgenticUserUndeleted => true,
Events.AgenticUserIdentityUpdated => true,
Events.AgenticUserManagerUpdated => true,
_ => false,
Comment on lines 159 to 165
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New lifecycle event types were added to the SDK's validation logic, but there are currently no unit tests covering lifecycle event validation (unlike subchannel validation). Adding tests that assert these new Events constants are accepted by the lifecycle-event validation would help prevent regressions when new event types are introduced.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not even look like there are unit tests today.

};
}
Expand Down Expand Up @@ -287,6 +290,45 @@ public static void OnAgenticUserDeletedNotification(this AgentApplication app, A
a365.OnLifecycleNotification(Events.AgenticUserDeleted, routeHandler, rank, autoSignInHandlers);
});

/// <summary>
/// Registers a handler for agentic user undeleted lifecycle notifications.
/// </summary>
/// <param name="app">The agent application to extend.</param>
/// <param name="routeHandler">The handler to invoke when a notification is received.</param>
/// <param name="rank">The route priority rank (default is 32767).</param>
/// <param name="autoSignInHandlers">Optional array of auto sign-in handlers.</param>
public static void OnAgenticUserUndeletedNotification(this AgentApplication app, AgentNotificationHandler routeHandler, ushort rank = 32767, string[] autoSignInHandlers = null!) =>
app.RegisterExtension(new AgentNotification(app), a365 =>
{
a365.OnLifecycleNotification(Events.AgenticUserUndeleted, routeHandler, rank, autoSignInHandlers);
});

/// <summary>
/// Registers a handler for agentic user identity updated lifecycle notifications.
/// </summary>
/// <param name="app">The agent application to extend.</param>
/// <param name="routeHandler">The handler to invoke when a notification is received.</param>
/// <param name="rank">The route priority rank (default is 32767).</param>
/// <param name="autoSignInHandlers">Optional array of auto sign-in handlers.</param>
public static void OnAgenticUserIdentityUpdatedNotification(this AgentApplication app, AgentNotificationHandler routeHandler, ushort rank = 32767, string[] autoSignInHandlers = null!) =>
app.RegisterExtension(new AgentNotification(app), a365 =>
{
a365.OnLifecycleNotification(Events.AgenticUserIdentityUpdated, routeHandler, rank, autoSignInHandlers);
});

/// <summary>
/// Registers a handler for agentic user manager updated lifecycle notifications.
/// </summary>
/// <param name="app">The agent application to extend.</param>
/// <param name="routeHandler">The handler to invoke when a notification is received.</param>
/// <param name="rank">The route priority rank (default is 32767).</param>
/// <param name="autoSignInHandlers">Optional array of auto sign-in handlers.</param>
public static void OnAgenticUserManagerUpdatedNotification(this AgentApplication app, AgentNotificationHandler routeHandler, ushort rank = 32767, string[] autoSignInHandlers = null!) =>
app.RegisterExtension(new AgentNotification(app), a365 =>
{
a365.OnLifecycleNotification(Events.AgenticUserManagerUpdated, routeHandler, rank, autoSignInHandlers);
});

/// <summary>
/// Creates a reply Activity containing an <see cref="EmailResponse"/> entity populated with the provided HTML body.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,20 @@ public class Events
/// The event name for agentic user deletion
/// </summary>
public const string AgenticUserDeleted = "agenticUserDeleted";

/// <summary>
/// The event name for agentic user undeletion.
/// </summary>
public const string AgenticUserUndeleted = "agenticUserUndeleted";

/// <summary>
/// The event name for agentic user identity update
/// </summary>
public const string AgenticUserIdentityUpdated = "agenticUserIdentityUpdated";

/// <summary>
/// The event name for agentic user manager update
/// </summary>
public const string AgenticUserManagerUpdated = "agenticUserManagerUpdated";
}
}
Loading