Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policy Settings syntax failing schema validation #103

Open
arpan3t opened this issue Sep 10, 2024 · 0 comments
Open

Policy Settings syntax failing schema validation #103

arpan3t opened this issue Sep 10, 2024 · 0 comments

Comments

@arpan3t
Copy link

arpan3t commented Sep 10, 2024

Not sure how much of an impact on the schema this group has, but when using a policy setting e.g., TenantId="{Settings:Tenant}" while having the XML file associated with the schema:

"xml.fileAssociations": [
    {
        "pattern": "**.xml",
        "systemId": "https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/master/TrustFrameworkPolicy_0.3.0.0.xsd"
    }
]

as recommended in Troubleshoot policy validation causes the validator to throw errors for cvc-pattern-valid and cvc-attribute. I think both errors are due to characters {:} not passing the regular expression pattern set in the schema:

  <xs:simpleType name="TenantId">
    <xs:annotation>
      <xs:documentation>
        Represents a tenant id.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="[A-Za-z0-9\.]{3,63}" />
    </xs:restriction>
  </xs:simpleType>

As a workaround I've had to exclude the directory that I develop in from validation using:

"xml.validation.filters": [
    {
        "pattern": "CustomPolicies\\*.xml",
        "enabled": false,
        "schema": {
            "enabled": "never"
        }
    }
]

Consider hosting modified version of the schema, thanks.

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

No branches or pull requests

1 participant