Browse Source

Update the web providers source generator to support marking providers as obsolete

pull/2025/head
Kévin Chalet 3 years ago
parent
commit
c5e5061931
  1. 8
      gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs
  2. 20
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml
  3. 10
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xsd

8
gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs

@ -75,6 +75,9 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
/// </summary>
/// <param name=""configuration"">The delegate used to configure the OpenIddict/{{ provider.display_name }} options.</param>
/// <returns>The <see cref=""OpenIddictClientWebIntegrationBuilder""/> instance.</returns>
{{~ if provider.obsolete ~}}
[Obsolete(""This provider is no longer supported and will be removed in a future version."")]
{{~ end ~}}
public OpenIddictClientWebIntegrationBuilder Add{{ provider.name }}(Action<OpenIddictClientWebIntegrationBuilder.{{ provider.name }}> configuration)
{
if (configuration is null)
@ -103,6 +106,9 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
/// <summary>
/// Exposes the necessary methods required to configure the {{ provider.display_name }} integration.
/// </summary>
{{~ if provider.obsolete ~}}
[Obsolete(""This provider is no longer supported and will be removed in a future version."")]
{{~ end ~}}
public sealed partial class {{ provider.name }}
{
/// <summary>
@ -678,6 +684,8 @@ public sealed partial class OpenIddictClientWebIntegrationBuilder
DisplayName = (string?) provider.Attribute("DisplayName") ?? (string) provider.Attribute("Name"),
Documentation = (string?) provider.Attribute("Documentation"),
Obsolete = (bool?) provider.Attribute("Obsolete") ?? false,
Environments = provider.Elements("Environment").Select(environment => new
{
Name = (string?) environment.Attribute("Name") ?? "Production"

20
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

@ -6,11 +6,11 @@
-->
<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▀██ ▄▄▀██ ▄▄▄██ ▄▄▄ ██
█ ▀▀ ██ ██ ██ ▄▄███▄▄▄▀▀██
█ ██ ██ ▀▀ ██ █████ ▀▀▀ ██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▀██ ▄▄▀█▄▄ ▄▄█▄ ▄██ ███ ██ ▄▄▄████ ▄▄▀█▄ ▄██ ▄▄▀██ ▄▄▄██ ▄▄▀█▄▄ ▄▄██ ▄▄▄ ██ ▄▄▀██ ███ ██
█ ▀▀ ██ ██████ ████ ████ █ ███ ▄▄▄████ ██ ██ ███ ▀▀▄██ ▄▄▄██ ██████ ████ ███ ██ ▀▀▄██▄▀▀▀▄██
█ ██ ██ ▀▀▄███ ███▀ ▀███▄▀▄███ ▀▀▀████ ▀▀ █▀ ▀██ ██ ██ ▀▀▀██ ▀▀▄███ ████ ▀▀▀ ██ ██ ████ ████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-->
<Provider Name="ActiveDirectoryFederationServices"
@ -285,11 +285,11 @@
</Provider>
<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▀██ ▄▀▄ █ ▄▄▀██ ▄▄▄ ██ ▄▄▄ ██ ▀██ ████ ▄▄▀██ ▄▄▄ ██ ▄▄ ██ ▀██ █▄ ▄█▄▄ ▄▄██ ▄▄▄ ██
█ ▀▀ ██ █ █ █ ▀▀ ██▀▀▀▄▄██ ███ ██ █ █ ████ █████ ███ ██ █▀▀██ █ █ ██ ████ ████ ███ ██
█ ██ ██ ███ █ ██ ██ ▀▀▀ ██ ▀▀▀ ██ ██▄ ████ ▀▀▄██ ▀▀▀ ██ ▀▀▄██ ██▄ █▀ ▀███ ████ ▀▀▀ ██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ▄▄▀██ ▄▄▄ ██ ▄▄ ██ ▀██ █▄ ▄█▄▄ ▄▄██ ▄▄▄ ██
██ █████ ███ ██ █▀▀██ █ █ ██ ████ ████ ███ ██
██ ▀▀▄██ ▀▀▀ ██ ▀▀▄██ ██▄ █▀ ▀███ ████ ▀▀▀ ██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-->
<Provider Name="Cognito" DisplayName="Amazon Cognito" Id="37931265-19ea-41e9-8a8c-06bb7deb9a1d"

10
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xsd

@ -572,6 +572,16 @@
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Obsolete" use="optional">
<xs:annotation>
<xs:documentation>A boolean indicating whether the provider is obsolete.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:boolean" />
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Documentation" type="xs:anyURI" use="optional">
<xs:annotation>
<xs:documentation>The documentation URI, if applicable.</xs:documentation>

Loading…
Cancel
Save