Skip to content

Scope webhook source attribution to scheduler flow and rely on TaskInfo.Command fallback#33

Closed
Copilot wants to merge 14 commits intodevfrom
copilot/simplify-configuration-endpoint
Closed

Scope webhook source attribution to scheduler flow and rely on TaskInfo.Command fallback#33
Copilot wants to merge 14 commits intodevfrom
copilot/simplify-configuration-endpoint

Conversation

Copy link

Copilot AI commented Mar 3, 2026

The issue was around mixed webhook payload shapes: some alerts (e.g., scheduled offboarding) already carry task command context, while others from scheduler notifications are generic log alerts. This change narrows source attribution behavior to those two realities without introducing broader schema passthrough logic.

  • Scheduler webhook source propagation

    • Push-SchedulerCIPPNotifications now passes an explicit top-down source to webhook alerts via -WebhookSource $MyInvocation.MyCommand.Name.
    • This ensures generic scheduler log alerts are attributed to the invoking entrypoint, not inferred payload fields.
  • Source resolution remains minimal and predictable in Send-CIPPAlert

    • Standardized webhook wrapping behavior is unchanged (New-CIPPWebhookRootSchema).
    • Existing fallback to TaskInfo.Command remains in place when no explicit WebhookSource is provided.
    • No additional branching for “already standardized” payload passthrough was retained.
  • Resulting behavior

    • Scheduled task alerts (with TaskInfo.Command) keep command-based source fallback.
    • Scheduler generic log alerts use explicit top-down source from caller.
Send-CIPPAlert `
  -Type 'webhook' `
  -Title $WebhookTitle `
  -JSONContent $JSONContent `
  -TenantFilter $Tenant `
  -APIName 'Push-SchedulerCIPPNotifications' `
  -WebhookSource $MyInvocation.MyCommand.Name
Original prompt

#23
Can you please review this pr and rebuild it, it's overly complicated I think for something that should be simple enough to have a configuration endpoint and also a webhook standardised root schema


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

JohnDuprey and others added 13 commits February 28, 2026 00:16
Add support for BitLocker recovery keys: new Search-CIPPBitlockerKeys (search + enrich with Devices/ManagedDevices), Set-CIPPDBCacheBitlockerKeys (cache keys from Graph beta), and Invoke-ExecBitlockerSearch entrypoint to expose search via HTTP with tenant filtering and limits. Also register 'BitlockerKeys' in Push-CIPPDBCacheData and Search-CIPPDbData types so BitLocker data is included in caching and DB searches.
Replace references to UserPrincipalName with UPN when selecting mailbox properties and when passing Identity to Set-Mailbox. Updated three locations: NonCompliantMailboxes selection, Set-Mailbox Parameters (Identity), and the report Filtered selection. This ensures correct property access for mailbox objects that expose UPN.
Feat: Add JIT reason to alert messages (add/remove)
Allow callers to explicitly request no types by adding 'None' to the Types ValidateSet and handling it by setting $Types to an empty array. Maintains existing 'All' behavior (expands to Permissions, CalendarPermissions, Rules) and preserves default of 'All'. This enables callers to skip processing types when desired.
Extend the Graph API signIns filter to match both 'Authenticated SMTP' and 'SMTP' clientAppUsed values. This ensures successful SMTP authentication events (status/errorCode eq 0) are captured even when the clientAppUsed is reported as 'SMTP'. Updated the $uri in Get-CIPPAlertSmtpAuthSuccess.ps1 accordingly.
Copilot AI changed the title [WIP] Refactor configuration endpoint and webhook schema Simplify webhook standardization to a single config flag + unified root schema Mar 3, 2026
@Zacgoose
Copy link
Owner

Zacgoose commented Mar 3, 2026

@copilot we need the invoking alert/script name in the root object as well

Copy link
Author

Copilot AI commented Mar 3, 2026

@copilot we need the invoking alert/script name in the root object as well

Implemented in commit 8c35d4b. The standardized webhook root object now includes a Source field populated from the invoking APIName (alert/script context), and tests were updated to verify it.

@Zacgoose Zacgoose force-pushed the copilot/simplify-configuration-endpoint branch from 8c35d4b to 93e7c30 Compare March 3, 2026 08:47
Copilot AI changed the title Simplify webhook standardization to a single config flag + unified root schema Prefer TaskInfo.Command as standardized webhook Source with APIName fallback Mar 3, 2026
Copilot AI changed the title Prefer TaskInfo.Command as standardized webhook Source with APIName fallback Unify webhook notification schema metadata across non-alert senders Mar 3, 2026
Copilot AI changed the title Unify webhook notification schema metadata across non-alert senders Propagate top-down webhook source for standardized notification payloads Mar 3, 2026
Copilot AI changed the title Propagate top-down webhook source for standardized notification payloads Preserve top-down webhook source for scheduler alerts in standardized schema Mar 3, 2026
@Zacgoose Zacgoose force-pushed the copilot/simplify-configuration-endpoint branch from 7aa59ab to fd35a9d Compare March 3, 2026 10:20
Copilot AI changed the title Preserve top-down webhook source for scheduler alerts in standardized schema Scope webhook source attribution to scheduler flow and rely on TaskInfo.Command fallback Mar 3, 2026
@Zacgoose Zacgoose closed this Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants