Language

HtmlWidgetHelpers.ValidateSecurityPolicy Method

Definition

Validates that external references in widget HTML are covered by the declared security policy. Returns a list of warnings for any references to origins not present in the appropriate policy field.

public static System.Collections.Generic.IList<Microsoft.Teams.Apps.HtmlWidget.SecurityPolicyWarning> ValidateSecurityPolicy(string html, Microsoft.Teams.Apps.HtmlWidget.HtmlWidgetSecurityPolicy policy);
static member ValidateSecurityPolicy : string * Microsoft.Teams.Apps.HtmlWidget.HtmlWidgetSecurityPolicy -> System.Collections.Generic.IList<Microsoft.Teams.Apps.HtmlWidget.SecurityPolicyWarning>
Public Shared Function ValidateSecurityPolicy (html As String, policy As HtmlWidgetSecurityPolicy) As IList(Of SecurityPolicyWarning)

Parameters

html
String

The raw HTML content of the widget.

policy
HtmlWidgetSecurityPolicy

The security policy to validate against.

Returns

A list of warnings. Empty list means no issues found.

Applies to