Browse Source

Bump PolySharp to 1.6.0 and decorate Uri and JSON properties/parameters with [StringSyntax]

pull/1556/head
Kévin Chalet 3 years ago
parent
commit
e2e2c84001
  1. 2
      Directory.Build.props
  2. 366
      Packages.props
  3. 3
      gen/OpenIddict.Client.WebIntegration.Generators/OpenIddictClientWebIntegrationGenerator.cs
  4. 8
      src/OpenIddict.Abstractions/Caches/IOpenIddictApplicationCache.cs
  5. 13
      src/OpenIddict.Abstractions/Managers/IOpenIddictApplicationManager.cs
  6. 3
      src/OpenIddict.Abstractions/Primitives/OpenIddictRequest.cs
  7. 7
      src/OpenIddict.Abstractions/Stores/IOpenIddictApplicationStore.cs
  8. 6
      src/OpenIddict.Client/OpenIddictClientBuilder.cs
  9. 4
      src/OpenIddict.Client/OpenIddictClientEvents.cs
  10. 2
      src/OpenIddict.Client/OpenIddictClientHandlers.cs
  11. 4
      src/OpenIddict.Client/OpenIddictClientRetriever.cs
  12. 7
      src/OpenIddict.Core/Caches/OpenIddictApplicationCache.cs
  13. 20
      src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs
  14. 5
      src/OpenIddict.EntityFramework.Models/OpenIddict.EntityFramework.Models.csproj
  15. 7
      src/OpenIddict.EntityFramework.Models/OpenIddictEntityFrameworkApplication.cs
  16. 3
      src/OpenIddict.EntityFramework.Models/OpenIddictEntityFrameworkAuthorization.cs
  17. 5
      src/OpenIddict.EntityFramework.Models/OpenIddictEntityFrameworkScope.cs
  18. 2
      src/OpenIddict.EntityFramework.Models/OpenIddictEntityFrameworkToken.cs
  19. 5
      src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs
  20. 5
      src/OpenIddict.EntityFrameworkCore.Models/OpenIddict.EntityFrameworkCore.Models.csproj
  21. 7
      src/OpenIddict.EntityFrameworkCore.Models/OpenIddictEntityFrameworkCoreApplication.cs
  22. 2
      src/OpenIddict.EntityFrameworkCore.Models/OpenIddictEntityFrameworkCoreAuthorization.cs
  23. 5
      src/OpenIddict.EntityFrameworkCore.Models/OpenIddictEntityFrameworkCoreScope.cs
  24. 2
      src/OpenIddict.EntityFrameworkCore.Models/OpenIddictEntityFrameworkCoreToken.cs
  25. 5
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs
  26. 5
      src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs
  27. 30
      src/OpenIddict.Server/OpenIddictServerBuilder.cs
  28. 4
      src/OpenIddict.Server/OpenIddictServerEvents.Authentication.cs
  29. 4
      src/OpenIddict.Server/OpenIddictServerEvents.Session.cs
  30. 6
      src/OpenIddict.Server/OpenIddictServerHandlers.Session.cs
  31. 2
      src/OpenIddict.Validation/OpenIddictValidationBuilder.cs
  32. 4
      src/OpenIddict.Validation/OpenIddictValidationRetriever.cs

2
Directory.Build.props

@ -69,7 +69,7 @@
Note: OpenIddict uses PolySharp to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
-->
<PackageReference Include="PolySharp" Version="1.3.0" IsImplicitlyDefined="true"
<PackageReference Include="PolySharp" Version="1.6.0" IsImplicitlyDefined="true"
PrivateAssets="all" Condition=" '$(DisablePolySharp)' != 'true' " />
</ItemGroup>

366
Packages.props

@ -12,45 +12,45 @@
<ItemGroup Label="Package versions for .NET Framework 4.6.1 and higher"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '4.6.1')) ">
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.Authentication" Version="2.1.2" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="2.1.1" />
<PackageReference Update="Microsoft.AspNetCore.Diagnostics.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="2.1.14" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Options" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="2.1.6" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="2.1.1" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="Microsoft.Owin.Security" Version="4.2.2" />
<PackageReference Update="MongoDB.Bson" Version="2.11.6" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Update="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<PackageReference Update="System.Text.Encodings.Web" Version="4.7.2" />
<PackageReference Update="System.Text.Json" Version="4.7.2" />
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.Authentication" Version="2.1.2" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="2.1.1" />
<PackageReference Update="Microsoft.AspNetCore.Diagnostics.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="2.1.14" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Options" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="2.1.6" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="2.1.1" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="Microsoft.Owin.Security" Version="4.2.2" />
<PackageReference Update="MongoDB.Bson" Version="2.11.6" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Update="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<PackageReference Update="System.Text.Encodings.Web" Version="4.7.2" />
<PackageReference Update="System.Text.Json" Version="4.7.2" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Update="Microsoft.Owin.Testing" Version="4.2.2" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Update="Microsoft.Owin.Testing" Version="4.2.2" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
<!--
Note: the following references are exclusively used in the samples:
@ -76,202 +76,202 @@
<ItemGroup Label="Package versions for .NET Core 2.1"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '2.1')) ">
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.Authentication" Version="2.1.2" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="2.1.1" />
<PackageReference Update="Microsoft.AspNetCore.Diagnostics.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="2.1.14" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Options" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="2.1.6" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="2.1.1" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Update="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<PackageReference Update="System.Text.Json" Version="4.7.2" />
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.Authentication" Version="2.1.2" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="2.1.1" />
<PackageReference Update="Microsoft.AspNetCore.Diagnostics.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="2.1.14" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Options" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="2.1.6" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="2.1.1" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Update="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<PackageReference Update="System.Text.Json" Version="4.7.2" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
<!--
Note: the following references are exclusively used in the source generators:
-->
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
<PackageReference Update="Scriban" Version="5.5.0" />
<PackageReference Update="System.Interactive" Version="4.1.1" />
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
<PackageReference Update="Scriban" Version="5.5.0" />
<PackageReference Update="System.Interactive" Version="4.1.1" />
</ItemGroup>
<ItemGroup Label="Package versions for .NET Core 3.1"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '3.1')) ">
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="3.1.30" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Options" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="3.1.30" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="3.1.30" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Options" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="3.1.30" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="3.1.30" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="3.1.30" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
</ItemGroup>
<ItemGroup Label="Package versions for .NET 6.0"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="6.0.10" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="6.0.10" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="6.0.10" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Driver" Version="2.18.0" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="6.0.10" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="6.0.10" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="6.0.10" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Driver" Version="2.18.0" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageReference Update="AngleSharp" Version="0.17.1" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="6.0.10" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="6.0.1" />
<PackageReference Update="AngleSharp" Version="0.17.1" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="6.0.10" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="6.0.1" />
<!--
Note: the following references are exclusively used in the samples:
-->
<PackageReference Update="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.10" />
<PackageReference Update="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.10" />
<PackageReference Update="Quartz.Extensions.Hosting" Version="3.5.0" />
<PackageReference Update="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.10" />
<PackageReference Update="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.10" />
<PackageReference Update="Quartz.Extensions.Hosting" Version="3.5.0" />
</ItemGroup>
<ItemGroup Label="Package versions for .NET Standard 2.0"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '2.0')) ">
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.Authentication" Version="2.1.2" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="2.1.1" />
<PackageReference Update="Microsoft.AspNetCore.Diagnostics.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="2.1.14" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Options" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="2.1.6" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="2.1.1" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Bson" Version="2.11.6" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Update="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Update="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<PackageReference Update="System.Text.Encodings.Web" Version="4.7.2" />
<PackageReference Update="System.Text.Json" Version="4.7.2" />
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.Authentication" Version="2.1.2" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="2.1.1" />
<PackageReference Update="Microsoft.AspNetCore.Diagnostics.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="2.1.14" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="2.1.23" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Options" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="2.1.6" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="2.1.1" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Bson" Version="2.11.6" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Update="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Update="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<PackageReference Update="System.Text.Encodings.Web" Version="4.7.2" />
<PackageReference Update="System.Text.Json" Version="4.7.2" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
<!--
Note: the following references are exclusively used in the source generators:
-->
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
<PackageReference Update="Scriban" Version="5.5.0" />
<PackageReference Update="System.Interactive" Version="4.1.1" />
<PackageReference Update="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
<PackageReference Update="Scriban" Version="5.5.0" />
<PackageReference Update="System.Interactive" Version="4.1.1" />
</ItemGroup>
<ItemGroup Label="Package versions for .NET Standard 2.1"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '2.1')) ">
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="3.1.30" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Options" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="3.1.30" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Update="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<PackageReference Update="System.Text.Encodings.Web" Version="4.7.2" />
<PackageReference Update="System.Text.Json" Version="4.7.2" />
<PackageReference Update="EntityFramework" Version="6.4.4" />
<PackageReference Update="Microsoft.AspNetCore.DataProtection" Version="3.1.30" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Caching.Abstractions" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Caching.Memory" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Logging" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Options" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.WebEncoders" Version="3.1.30" />
<PackageReference Update="Microsoft.IdentityModel.JsonWebTokens" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Protocols" Version="6.24.0" />
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.24.0" />
<PackageReference Update="MongoDB.Driver" Version="2.11.6" />
<PackageReference Update="Quartz.Extensions.DependencyInjection" Version="3.5.0" />
<PackageReference Update="SmartFormat" Version="3.2.0" />
<PackageReference Update="System.Collections.Immutable" Version="1.7.1" />
<PackageReference Update="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Update="System.Net.Http.Json" Version="3.2.1" />
<PackageReference Update="System.Text.Encodings.Web" Version="4.7.2" />
<PackageReference Update="System.Text.Json" Version="4.7.2" />
<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="3.1.30" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
<PackageReference Update="AngleSharp" Version="0.14.0" />
<PackageReference Update="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Update="Microsoft.AspNetCore.TestHost" Version="3.1.30" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="3.1.30" />
<PackageReference Update="Moq" Version="4.18.2" />
<PackageReference Update="System.Linq.Async" Version="4.1.1" />
</ItemGroup>
</Project>

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

@ -48,6 +48,7 @@ namespace OpenIddict.Client.WebIntegration.Generators
var template = Template.Parse(@"#nullable enable
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Tokens;
@ -196,7 +197,7 @@ public partial class OpenIddictClientWebIntegrationBuilder
/// </summary>
/// <param name=""address"">The redirection URI.</param>
/// <returns>The <see cref=""OpenIddictClientWebIntegrationBuilder.{{ provider.name }}""/> instance.</returns>
public {{ provider.name }} SetRedirectUri(string address)
public {{ provider.name }} SetRedirectUri([StringSyntax(StringSyntaxAttribute.Uri)] string address)
{
if (string.IsNullOrEmpty(address))
{

8
src/OpenIddict.Abstractions/Caches/IOpenIddictApplicationCache.cs

@ -4,6 +4,8 @@
* the license and the contributors participating to this project.
*/
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.Abstractions;
/// <summary>
@ -48,7 +50,8 @@ public interface IOpenIddictApplicationCache<TApplication> where TApplication :
/// <param name="address">The redirect_uri associated with the applications.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The client applications corresponding to the specified redirect_uri.</returns>
IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(string address, CancellationToken cancellationToken);
IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken);
/// <summary>
/// Retrieves all the applications associated with the specified redirect_uri.
@ -56,7 +59,8 @@ public interface IOpenIddictApplicationCache<TApplication> where TApplication :
/// <param name="address">The redirect_uri associated with the applications.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The client applications corresponding to the specified redirect_uri.</returns>
IAsyncEnumerable<TApplication> FindByRedirectUriAsync(string address, CancellationToken cancellationToken);
IAsyncEnumerable<TApplication> FindByRedirectUriAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken);
/// <summary>
/// Removes the specified application from the cache.

13
src/OpenIddict.Abstractions/Managers/IOpenIddictApplicationManager.cs

@ -6,6 +6,7 @@
using System.Collections.Immutable;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text.Json;
@ -117,7 +118,8 @@ public interface IOpenIddictApplicationManager
/// <param name="address">The post_logout_redirect_uri associated with the applications.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The client applications corresponding to the specified post_logout_redirect_uri.</returns>
IAsyncEnumerable<object> FindByPostLogoutRedirectUriAsync(string address, CancellationToken cancellationToken = default);
IAsyncEnumerable<object> FindByPostLogoutRedirectUriAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken = default);
/// <summary>
/// Retrieves all the applications associated with the specified redirect_uri.
@ -125,7 +127,8 @@ public interface IOpenIddictApplicationManager
/// <param name="address">The redirect_uri associated with the applications.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The client applications corresponding to the specified redirect_uri.</returns>
IAsyncEnumerable<object> FindByRedirectUriAsync(string address, CancellationToken cancellationToken = default);
IAsyncEnumerable<object> FindByRedirectUriAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken = default);
/// <summary>
/// Executes the specified query and returns the first element.
@ -461,7 +464,8 @@ public interface IOpenIddictApplicationManager
/// A <see cref="ValueTask"/> that can be used to monitor the asynchronous operation,
/// whose result returns a boolean indicating whether the post_logout_redirect_uri was valid.
/// </returns>
ValueTask<bool> ValidatePostLogoutRedirectUriAsync(object application, string address, CancellationToken cancellationToken = default);
ValueTask<bool> ValidatePostLogoutRedirectUriAsync(object application,
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken = default);
/// <summary>
/// Validates the redirect_uri to ensure it's associated with an application.
@ -473,5 +477,6 @@ public interface IOpenIddictApplicationManager
/// A <see cref="ValueTask"/> that can be used to monitor the asynchronous operation,
/// whose result returns a boolean indicating whether the redirect_uri was valid.
/// </returns>
ValueTask<bool> ValidateRedirectUriAsync(object application, string address, CancellationToken cancellationToken = default);
ValueTask<bool> ValidateRedirectUriAsync(object application,
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken = default);
}

3
src/OpenIddict.Abstractions/Primitives/OpenIddictRequest.cs

@ -5,6 +5,7 @@
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.Extensions.Primitives;
@ -316,6 +317,7 @@ public class OpenIddictRequest : OpenIddictMessage
/// <summary>
/// Gets or sets the "post_logout_redirect_uri" parameter.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Uri)]
public string? PostLogoutRedirectUri
{
get => (string?) GetParameter(OpenIddictConstants.Parameters.PostLogoutRedirectUri);
@ -334,6 +336,7 @@ public class OpenIddictRequest : OpenIddictMessage
/// <summary>
/// Gets or sets the "redirect_uri" parameter.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Uri)]
public string? RedirectUri
{
get => (string?) GetParameter(OpenIddictConstants.Parameters.RedirectUri);

7
src/OpenIddict.Abstractions/Stores/IOpenIddictApplicationStore.cs

@ -5,6 +5,7 @@
*/
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text.Json;
@ -82,7 +83,8 @@ public interface IOpenIddictApplicationStore<TApplication> where TApplication :
/// <param name="address">The post_logout_redirect_uri associated with the applications.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The client applications corresponding to the specified post_logout_redirect_uri.</returns>
IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(string address, CancellationToken cancellationToken);
IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken);
/// <summary>
/// Retrieves all the applications associated with the specified redirect_uri.
@ -90,7 +92,8 @@ public interface IOpenIddictApplicationStore<TApplication> where TApplication :
/// <param name="address">The redirect_uri associated with the applications.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The client applications corresponding to the specified redirect_uri.</returns>
IAsyncEnumerable<TApplication> FindByRedirectUriAsync(string address, CancellationToken cancellationToken);
IAsyncEnumerable<TApplication> FindByRedirectUriAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken);
/// <summary>
/// Executes the specified query and returns the first element.

6
src/OpenIddict.Client/OpenIddictClientBuilder.cs

@ -982,7 +982,8 @@ public class OpenIddictClientBuilder
/// </remarks>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictClientBuilder"/> instance.</returns>
public OpenIddictClientBuilder SetRedirectionEndpointUris(params string[] addresses)
public OpenIddictClientBuilder SetRedirectionEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1034,7 +1035,8 @@ public class OpenIddictClientBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictClientBuilder"/> instance.</returns>
public OpenIddictClientBuilder SetPostLogoutRedirectionEndpointUris(params string[] addresses)
public OpenIddictClientBuilder SetPostLogoutRedirectionEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{

4
src/OpenIddict.Client/OpenIddictClientEvents.cs

@ -5,6 +5,7 @@
*/
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Security.Claims;
using Microsoft.Extensions.Logging;
@ -735,6 +736,7 @@ public static partial class OpenIddictClientEvents
/// Gets or sets the redirection endpoint that will
/// be used for the challenge demand, if applicable.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Uri)]
public string? RedirectUri { get; set; }
/// <summary>
@ -769,6 +771,7 @@ public static partial class OpenIddictClientEvents
/// <summary>
/// Gets or sets the optional return URL that will be stored in the state token, if applicable.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Uri)]
public string? TargetLinkUri { get; set; }
/// <summary>
@ -868,6 +871,7 @@ public static partial class OpenIddictClientEvents
/// Gets or sets the post-logout redirection endpoint that
/// will be used for the sign-out demand, if applicable.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Uri)]
public string? PostLogoutRedirectUri { get; set; }
/// <summary>

2
src/OpenIddict.Client/OpenIddictClientHandlers.cs

@ -3627,7 +3627,7 @@ public static partial class OpenIddictClientHandlers
context.Configuration.ResponseTypesSupported.Select(types =>
types.Split(Separators.Space).ToImmutableHashSet(StringComparer.Ordinal)).ToList()) switch
{
// Note: the OAuth 2.0 provider metadata and OpenID Connect discovery specification define
// Note: the OAuth 2.0 provider metadata and OpenID Connect discovery specifications define
// the supported response types as a required property. Nevertheless, to ensure OpenIddict
// is compatible with most identity providers, a missing or empty list is not treated as an
// error. In this case, response_type=code (for the code grant) and response_type=id_token

4
src/OpenIddict.Client/OpenIddictClientRetriever.cs

@ -4,6 +4,7 @@
* the license and the contributors participating to this project.
*/
using System.Diagnostics.CodeAnalysis;
using Microsoft.IdentityModel.Protocols;
namespace OpenIddict.Client;
@ -32,7 +33,8 @@ public class OpenIddictClientRetriever : IConfigurationRetriever<OpenIddictConfi
/// <param name="retriever">The retriever used by IdentityModel.</param>
/// <param name="cancel">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The OpenID Connect server configuration retrieved from the remote server.</returns>
async Task<OpenIddictConfiguration> IConfigurationRetriever<OpenIddictConfiguration>.GetConfigurationAsync(string address, IDocumentRetriever retriever, CancellationToken cancel)
async Task<OpenIddictConfiguration> IConfigurationRetriever<OpenIddictConfiguration>.GetConfigurationAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, IDocumentRetriever retriever, CancellationToken cancel)
{
if (string.IsNullOrEmpty(address))
{

7
src/OpenIddict.Core/Caches/OpenIddictApplicationCache.cs

@ -6,6 +6,7 @@
using System.Collections.Concurrent;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
@ -167,7 +168,8 @@ public class OpenIddictApplicationCache<TApplication> : IOpenIddictApplicationCa
}
/// <inheritdoc/>
public IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(string address, CancellationToken cancellationToken)
public IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(address))
{
@ -208,7 +210,8 @@ public class OpenIddictApplicationCache<TApplication> : IOpenIddictApplicationCa
}
/// <inheritdoc/>
public IAsyncEnumerable<TApplication> FindByRedirectUriAsync(string address, CancellationToken cancellationToken)
public IAsyncEnumerable<TApplication> FindByRedirectUriAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(address))
{

20
src/OpenIddict.Core/Managers/OpenIddictApplicationManager.cs

@ -334,7 +334,7 @@ public class OpenIddictApplicationManager<TApplication> : IOpenIddictApplication
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The client applications corresponding to the specified post_logout_redirect_uri.</returns>
public virtual IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(
string address, CancellationToken cancellationToken = default)
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken = default)
{
if (string.IsNullOrEmpty(address))
{
@ -376,7 +376,7 @@ public class OpenIddictApplicationManager<TApplication> : IOpenIddictApplication
/// <param name="cancellationToken">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The client applications corresponding to the specified redirect_uri.</returns>
public virtual IAsyncEnumerable<TApplication> FindByRedirectUriAsync(
string address, CancellationToken cancellationToken = default)
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken = default)
{
if (string.IsNullOrEmpty(address))
{
@ -1300,8 +1300,8 @@ public class OpenIddictApplicationManager<TApplication> : IOpenIddictApplication
/// A <see cref="ValueTask"/> that can be used to monitor the asynchronous operation,
/// whose result returns a boolean indicating whether the post_logout_redirect_uri was valid.
/// </returns>
public virtual async ValueTask<bool> ValidatePostLogoutRedirectUriAsync(
TApplication application, string address, CancellationToken cancellationToken = default)
public virtual async ValueTask<bool> ValidatePostLogoutRedirectUriAsync(TApplication application,
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken = default)
{
if (application is null)
{
@ -1337,8 +1337,8 @@ public class OpenIddictApplicationManager<TApplication> : IOpenIddictApplication
/// A <see cref="ValueTask"/> that can be used to monitor the asynchronous operation,
/// whose result returns a boolean indicating whether the redirect_uri was valid.
/// </returns>
public virtual async ValueTask<bool> ValidateRedirectUriAsync(
TApplication application, string address, CancellationToken cancellationToken = default)
public virtual async ValueTask<bool> ValidateRedirectUriAsync(TApplication application,
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken = default)
{
if (application is null)
{
@ -1596,11 +1596,11 @@ public class OpenIddictApplicationManager<TApplication> : IOpenIddictApplication
=> await FindByIdAsync(identifier, cancellationToken);
/// <inheritdoc/>
IAsyncEnumerable<object> IOpenIddictApplicationManager.FindByPostLogoutRedirectUriAsync(string address, CancellationToken cancellationToken)
IAsyncEnumerable<object> IOpenIddictApplicationManager.FindByPostLogoutRedirectUriAsync([StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
=> FindByPostLogoutRedirectUriAsync(address, cancellationToken);
/// <inheritdoc/>
IAsyncEnumerable<object> IOpenIddictApplicationManager.FindByRedirectUriAsync(string address, CancellationToken cancellationToken)
IAsyncEnumerable<object> IOpenIddictApplicationManager.FindByRedirectUriAsync([StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
=> FindByRedirectUriAsync(address, cancellationToken);
/// <inheritdoc/>
@ -1720,10 +1720,10 @@ public class OpenIddictApplicationManager<TApplication> : IOpenIddictApplication
=> ValidateClientSecretAsync((TApplication) application, secret, cancellationToken);
/// <inheritdoc/>
ValueTask<bool> IOpenIddictApplicationManager.ValidatePostLogoutRedirectUriAsync(object application, string address, CancellationToken cancellationToken)
ValueTask<bool> IOpenIddictApplicationManager.ValidatePostLogoutRedirectUriAsync(object application, [StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
=> ValidatePostLogoutRedirectUriAsync((TApplication) application, address, cancellationToken);
/// <inheritdoc/>
ValueTask<bool> IOpenIddictApplicationManager.ValidateRedirectUriAsync(object application, string address, CancellationToken cancellationToken)
ValueTask<bool> IOpenIddictApplicationManager.ValidateRedirectUriAsync(object application, [StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
=> ValidateRedirectUriAsync((TApplication) application, address, cancellationToken);
}

5
src/OpenIddict.EntityFramework.Models/OpenIddict.EntityFramework.Models.csproj

@ -2,7 +2,10 @@
<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<DisablePolySharp>true</DisablePolySharp>
</PropertyGroup>
<PropertyGroup>
<PolySharpIncludeGeneratedTypes>System.Diagnostics.CodeAnalysis.StringSyntaxAttribute</PolySharpIncludeGeneratedTypes>
</PropertyGroup>
<PropertyGroup>

7
src/OpenIddict.EntityFramework.Models/OpenIddictEntityFrameworkApplication.cs

@ -5,6 +5,7 @@
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.EntityFramework.Models;
@ -66,6 +67,7 @@ public class OpenIddictEntityFrameworkApplication<TKey, TAuthorization, TToken>
/// associated with the current application,
/// serialized as a JSON object.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? DisplayNames { get; set; }
/// <summary>
@ -77,30 +79,35 @@ public class OpenIddictEntityFrameworkApplication<TKey, TAuthorization, TToken>
/// Gets or sets the permissions associated with the
/// current application, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Permissions { get; set; }
/// <summary>
/// Gets or sets the logout callback URLs associated with
/// the current application, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? PostLogoutRedirectUris { get; set; }
/// <summary>
/// Gets or sets the additional properties serialized as a JSON object,
/// or <see langword="null"/> if no bag was associated with the current application.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Properties { get; set; }
/// <summary>
/// Gets or sets the callback URLs associated with the
/// current application, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? RedirectUris { get; set; }
/// <summary>
/// Gets or sets the requirements associated with the
/// current application, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Requirements { get; set; }
/// <summary>

3
src/OpenIddict.EntityFramework.Models/OpenIddictEntityFrameworkAuthorization.cs

@ -5,6 +5,7 @@
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.EntityFramework.Models;
@ -53,12 +54,14 @@ public class OpenIddictEntityFrameworkAuthorization<TKey, TApplication, TToken>
/// Gets or sets the additional properties serialized as a JSON object,
/// or <see langword="null"/> if no bag was associated with the current authorization.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Properties { get; set; }
/// <summary>
/// Gets or sets the scopes associated with the current
/// authorization, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Scopes { get; set; }
/// <summary>

5
src/OpenIddict.EntityFramework.Models/OpenIddictEntityFrameworkScope.cs

@ -5,6 +5,7 @@
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.EntityFramework.Models;
@ -40,6 +41,7 @@ public class OpenIddictEntityFrameworkScope<TKey> where TKey : notnull, IEquatab
/// Gets or sets the localized public descriptions associated
/// with the current scope, serialized as a JSON object.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Descriptions { get; set; }
/// <summary>
@ -52,6 +54,7 @@ public class OpenIddictEntityFrameworkScope<TKey> where TKey : notnull, IEquatab
/// associated with the current application,
/// serialized as a JSON object.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? DisplayNames { get; set; }
/// <summary>
@ -68,11 +71,13 @@ public class OpenIddictEntityFrameworkScope<TKey> where TKey : notnull, IEquatab
/// Gets or sets the additional properties serialized as a JSON object,
/// or <see langword="null"/> if no bag was associated with the current scope.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Properties { get; set; }
/// <summary>
/// Gets or sets the resources associated with the
/// current scope, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Resources { get; set; }
}

2
src/OpenIddict.EntityFramework.Models/OpenIddictEntityFrameworkToken.cs

@ -5,6 +5,7 @@
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.EntityFramework.Models;
@ -70,6 +71,7 @@ public class OpenIddictEntityFrameworkToken<TKey, TApplication, TAuthorization>
/// Gets or sets the additional properties serialized as a JSON object,
/// or <see langword="null"/> if no bag was associated with the current token.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Properties { get; set; }
/// <summary>

5
src/OpenIddict.EntityFramework/Stores/OpenIddictEntityFrameworkApplicationStore.cs

@ -8,6 +8,7 @@ using System.Collections.Immutable;
using System.ComponentModel;
using System.Data;
using System.Data.Entity.Infrastructure;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Text;
@ -236,7 +237,7 @@ public class OpenIddictEntityFrameworkApplicationStore<TApplication, TAuthorizat
/// <inheritdoc/>
public virtual IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(
string address, CancellationToken cancellationToken)
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(address))
{
@ -270,7 +271,7 @@ public class OpenIddictEntityFrameworkApplicationStore<TApplication, TAuthorizat
/// <inheritdoc/>
public virtual IAsyncEnumerable<TApplication> FindByRedirectUriAsync(
string address, CancellationToken cancellationToken)
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(address))
{

5
src/OpenIddict.EntityFrameworkCore.Models/OpenIddict.EntityFrameworkCore.Models.csproj

@ -2,7 +2,10 @@
<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<DisablePolySharp>true</DisablePolySharp>
</PropertyGroup>
<PropertyGroup>
<PolySharpIncludeGeneratedTypes>System.Diagnostics.CodeAnalysis.StringSyntaxAttribute</PolySharpIncludeGeneratedTypes>
</PropertyGroup>
<PropertyGroup>

7
src/OpenIddict.EntityFrameworkCore.Models/OpenIddictEntityFrameworkCoreApplication.cs

@ -5,6 +5,7 @@
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.EntityFrameworkCore.Models;
@ -74,6 +75,7 @@ public class OpenIddictEntityFrameworkCoreApplication<TKey, TAuthorization, TTok
/// associated with the current application,
/// serialized as a JSON object.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? DisplayNames { get; set; }
/// <summary>
@ -85,30 +87,35 @@ public class OpenIddictEntityFrameworkCoreApplication<TKey, TAuthorization, TTok
/// Gets or sets the permissions associated with the
/// current application, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Permissions { get; set; }
/// <summary>
/// Gets or sets the logout callback URLs associated with
/// the current application, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? PostLogoutRedirectUris { get; set; }
/// <summary>
/// Gets or sets the additional properties serialized as a JSON object,
/// or <see langword="null"/> if no bag was associated with the current application.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Properties { get; set; }
/// <summary>
/// Gets or sets the callback URLs associated with the
/// current application, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? RedirectUris { get; set; }
/// <summary>
/// Gets or sets the requirements associated with the
/// current application, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Requirements { get; set; }
/// <summary>

2
src/OpenIddict.EntityFrameworkCore.Models/OpenIddictEntityFrameworkCoreAuthorization.cs

@ -5,6 +5,7 @@
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.EntityFrameworkCore.Models;
@ -61,6 +62,7 @@ public class OpenIddictEntityFrameworkCoreAuthorization<TKey, TApplication, TTok
/// Gets or sets the additional properties serialized as a JSON object,
/// or <see langword="null"/> if no bag was associated with the current authorization.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Properties { get; set; }
/// <summary>

5
src/OpenIddict.EntityFrameworkCore.Models/OpenIddictEntityFrameworkCoreScope.cs

@ -5,6 +5,7 @@
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.EntityFrameworkCore.Models;
@ -40,6 +41,7 @@ public class OpenIddictEntityFrameworkCoreScope<TKey> where TKey : notnull, IEqu
/// Gets or sets the localized public descriptions associated
/// with the current scope, serialized as a JSON object.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Descriptions { get; set; }
/// <summary>
@ -52,6 +54,7 @@ public class OpenIddictEntityFrameworkCoreScope<TKey> where TKey : notnull, IEqu
/// associated with the current application,
/// serialized as a JSON object.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? DisplayNames { get; set; }
/// <summary>
@ -68,11 +71,13 @@ public class OpenIddictEntityFrameworkCoreScope<TKey> where TKey : notnull, IEqu
/// Gets or sets the additional properties serialized as a JSON object,
/// or <see langword="null"/> if no bag was associated with the current scope.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Properties { get; set; }
/// <summary>
/// Gets or sets the resources associated with the
/// current scope, serialized as a JSON array.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Resources { get; set; }
}

2
src/OpenIddict.EntityFrameworkCore.Models/OpenIddictEntityFrameworkCoreToken.cs

@ -5,6 +5,7 @@
*/
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace OpenIddict.EntityFrameworkCore.Models;
@ -78,6 +79,7 @@ public class OpenIddictEntityFrameworkCoreToken<TKey, TApplication, TAuthorizati
/// Gets or sets the additional properties serialized as a JSON object,
/// or <see langword="null"/> if no bag was associated with the current token.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Json)]
public virtual string? Properties { get; set; }
/// <summary>

5
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictEntityFrameworkCoreApplicationStore.cs

@ -7,6 +7,7 @@
using System.Collections.Immutable;
using System.ComponentModel;
using System.Data;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Text;
@ -278,7 +279,7 @@ public class OpenIddictEntityFrameworkCoreApplicationStore<TApplication, TAuthor
/// <inheritdoc/>
public virtual IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(
string address, CancellationToken cancellationToken)
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(address))
{
@ -312,7 +313,7 @@ public class OpenIddictEntityFrameworkCoreApplicationStore<TApplication, TAuthor
/// <inheritdoc/>
public virtual IAsyncEnumerable<TApplication> FindByRedirectUriAsync(
string address, CancellationToken cancellationToken)
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(address))
{

5
src/OpenIddict.MongoDb/Stores/OpenIddictMongoDbApplicationStore.cs

@ -5,6 +5,7 @@
*/
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Text;
@ -137,7 +138,7 @@ public class OpenIddictMongoDbApplicationStore<TApplication> : IOpenIddictApplic
/// <inheritdoc/>
public virtual IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(
string address, CancellationToken cancellationToken)
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(address))
{
@ -161,7 +162,7 @@ public class OpenIddictMongoDbApplicationStore<TApplication> : IOpenIddictApplic
/// <inheritdoc/>
public virtual IAsyncEnumerable<TApplication> FindByRedirectUriAsync(
string address, CancellationToken cancellationToken)
[StringSyntax(StringSyntaxAttribute.Uri)] string address, CancellationToken cancellationToken)
{
if (string.IsNullOrEmpty(address))
{

30
src/OpenIddict.Server/OpenIddictServerBuilder.cs

@ -1094,7 +1094,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetAuthorizationEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetAuthorizationEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1142,7 +1143,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetConfigurationEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetConfigurationEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1190,7 +1192,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetCryptographyEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetCryptographyEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1238,7 +1241,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetDeviceEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetDeviceEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1286,7 +1290,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetIntrospectionEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetIntrospectionEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1334,7 +1339,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetLogoutEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetLogoutEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1382,7 +1388,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetRevocationEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetRevocationEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1430,7 +1437,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetTokenEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetTokenEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1478,7 +1486,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetUserinfoEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetUserinfoEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{
@ -1526,7 +1535,8 @@ public class OpenIddictServerBuilder
/// </summary>
/// <param name="addresses">The addresses associated to the endpoint.</param>
/// <returns>The <see cref="OpenIddictServerBuilder"/> instance.</returns>
public OpenIddictServerBuilder SetVerificationEndpointUris(params string[] addresses)
public OpenIddictServerBuilder SetVerificationEndpointUris(
[StringSyntax(StringSyntaxAttribute.Uri)] params string[] addresses)
{
if (addresses is null)
{

4
src/OpenIddict.Server/OpenIddictServerEvents.Authentication.cs

@ -4,6 +4,7 @@
* the license and the contributors participating to this project.
*/
using System.Diagnostics.CodeAnalysis;
using System.Security.Claims;
namespace OpenIddict.Server;
@ -67,6 +68,7 @@ public static partial class OpenIddictServerEvents
/// If it's not provided by the client, it must be set by
/// the user code by calling <see cref="SetRedirectUri(string)"/>.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Uri)]
public string? RedirectUri { get; private set; }
/// <summary>
@ -79,7 +81,7 @@ public static partial class OpenIddictServerEvents
/// Populates the <see cref="RedirectUri"/> property with the specified redirect_uri.
/// </summary>
/// <param name="address">The redirect_uri to use when redirecting the user agent.</param>
public void SetRedirectUri(string address)
public void SetRedirectUri([StringSyntax(StringSyntaxAttribute.Uri)] string address)
{
if (string.IsNullOrEmpty(address))
{

4
src/OpenIddict.Server/OpenIddictServerEvents.Session.cs

@ -4,6 +4,7 @@
* the license and the contributors participating to this project.
*/
using System.Diagnostics.CodeAnalysis;
using System.Security.Claims;
namespace OpenIddict.Server;
@ -65,6 +66,7 @@ public static partial class OpenIddictServerEvents
/// <summary>
/// Gets the post_logout_redirect_uri specified by the client application.
/// </summary>
[StringSyntax(StringSyntaxAttribute.Uri)]
public string? PostLogoutRedirectUri { get; private set; }
/// <summary>
@ -77,7 +79,7 @@ public static partial class OpenIddictServerEvents
/// Populates the <see cref="PostLogoutRedirectUri"/> property with the specified redirect_uri.
/// </summary>
/// <param name="address">The post_logout_redirect_uri to use when redirecting the user agent.</param>
public void SetPostLogoutRedirectUri(string address)
public void SetPostLogoutRedirectUri([StringSyntax(StringSyntaxAttribute.Uri)] string address)
{
if (string.IsNullOrEmpty(address))
{

6
src/OpenIddict.Server/OpenIddictServerHandlers.Session.cs

@ -6,6 +6,7 @@
using System.Collections.Immutable;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Security.Claims;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@ -513,7 +514,7 @@ public static partial class OpenIddictServerHandlers
return;
}
async ValueTask<bool> ValidatePostLogoutRedirectUriAsync(string address)
async ValueTask<bool> ValidatePostLogoutRedirectUriAsync([StringSyntax(StringSyntaxAttribute.Uri)] string address)
{
// To be considered valid, a post_logout_redirect_uri must correspond to an existing client application
// that was granted the ept:logout permission, unless endpoint permissions checking was explicitly disabled.
@ -753,7 +754,8 @@ public static partial class OpenIddictServerHandlers
return;
}
async ValueTask<bool> ValidateAuthorizedParty(ClaimsPrincipal principal, string address)
async ValueTask<bool> ValidateAuthorizedParty(ClaimsPrincipal principal,
[StringSyntax(StringSyntaxAttribute.Uri)] string address)
{
// To be considered valid, one of the clients matching the specified post_logout_redirect_uri
// must be listed either as an audience or as a presenter in the identity token hint.

2
src/OpenIddict.Validation/OpenIddictValidationBuilder.cs

@ -456,7 +456,7 @@ public class OpenIddictValidationBuilder
/// </summary>
/// <param name="address">The issuer address.</param>
/// <returns>The <see cref="OpenIddictValidationBuilder"/> instance.</returns>
public OpenIddictValidationBuilder SetIssuer(string address)
public OpenIddictValidationBuilder SetIssuer([StringSyntax(StringSyntaxAttribute.Uri)] string address)
{
if (string.IsNullOrEmpty(address))
{

4
src/OpenIddict.Validation/OpenIddictValidationRetriever.cs

@ -4,6 +4,7 @@
* the license and the contributors participating to this project.
*/
using System.Diagnostics.CodeAnalysis;
using Microsoft.IdentityModel.Protocols;
namespace OpenIddict.Validation;
@ -26,7 +27,8 @@ public class OpenIddictValidationRetriever : IConfigurationRetriever<OpenIddictC
/// <param name="retriever">The retriever used by IdentityModel.</param>
/// <param name="cancel">The <see cref="CancellationToken"/> that can be used to abort the operation.</param>
/// <returns>The OpenID Connect server configuration retrieved from the remote server.</returns>
async Task<OpenIddictConfiguration> IConfigurationRetriever<OpenIddictConfiguration>.GetConfigurationAsync(string address, IDocumentRetriever retriever, CancellationToken cancel)
async Task<OpenIddictConfiguration> IConfigurationRetriever<OpenIddictConfiguration>.GetConfigurationAsync(
[StringSyntax(StringSyntaxAttribute.Uri)] string address, IDocumentRetriever retriever, CancellationToken cancel)
{
if (string.IsNullOrEmpty(address))
{

Loading…
Cancel
Save