-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1270 from DuendeSoftware/joe/dcr-refactor-processor
Joe/dcr refactor processor
- Loading branch information
Showing
22 changed files
with
393 additions
and
545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
src/Configuration/Models/DynamicClientRegistration/DynamicClientRegistrationErrorResponse.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/Configuration/Models/DynamicClientRegistrationError.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) Duende Software. All rights reserved. | ||
// See LICENSE in the project root for license information. | ||
|
||
using Duende.IdentityServer.Configuration.Models.DynamicClientRegistration; | ||
using Duende.IdentityServer.Configuration.Validation.DynamicClientRegistration; | ||
|
||
namespace Duende.IdentityServer.Configuration.Models; | ||
|
||
/// <summary> | ||
/// Represents an error during dynamic client registration. | ||
/// </summary> | ||
public class DynamicClientRegistrationError : IStepResult, IDynamicClientRegistrationResponse, IDynamicClientRegistrationValidationResult | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see | ||
/// cref="DynamicClientRegistrationError"/> class. | ||
/// </summary> | ||
/// <param name="error">The error code for the error that occurred. Error | ||
/// codes defined by RFC 7591 are defined as constants in the <see | ||
/// cref="DynamicClientRegistrationErrors" /> class.</param> | ||
/// <param name="errorDescription">A human-readable description of the error | ||
/// that occurred during validation or processing.</param> | ||
public DynamicClientRegistrationError(string error, string errorDescription) | ||
{ | ||
Error = error; | ||
ErrorDescription = errorDescription; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the error code for the error that occurred. Error codes | ||
/// defined by RFC 7591 are defined as constants in the <see | ||
/// cref="DynamicClientRegistrationErrors" /> class. | ||
/// </summary> | ||
public string Error { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a human-readable description of the error that occurred. | ||
/// </summary> | ||
public string ErrorDescription { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Duende Software. All rights reserved. | ||
// See LICENSE in the project root for license information. | ||
|
||
namespace Duende.IdentityServer.Configuration.Models; | ||
|
||
/// <summary> | ||
/// Represents the result of a step in dynamic client registration validation or | ||
/// processing. | ||
/// </summary> | ||
public interface IStepResult | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Static helper class for creating instances of IStepResult implementations, | ||
/// wrapped in tasks. | ||
/// </summary> | ||
public static class StepResult | ||
{ | ||
/// <summary> | ||
/// Creates a step result that represents failure, wrapped in a task. | ||
/// </summary> | ||
/// <param name="errorDescription"></param> | ||
/// <param name="error"></param> | ||
/// <returns>A task that returns an <see cref="IStepResult"/>, which either | ||
/// represents that this step succeeded or failed.</returns> | ||
public static Task<IStepResult> Failure(string errorDescription, | ||
string error = DynamicClientRegistrationErrors.InvalidClientMetadata) => | ||
Task.FromResult<IStepResult>(new DynamicClientRegistrationError(error, errorDescription)); | ||
|
||
/// <summary> | ||
/// Creates a step result that represents success, wrapped in a task. | ||
/// </summary> | ||
/// <returns>A task that returns an <see cref="IStepResult"/>, which either | ||
/// represents that this step succeeded or failed.</returns> | ||
public static Task<IStepResult> Success() => | ||
Task.FromResult<IStepResult>(new SuccessfulStep()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) Duende Software. All rights reserved. | ||
// See LICENSE in the project root for license information. | ||
|
||
namespace Duende.IdentityServer.Configuration.Models; | ||
|
||
/// <summary> | ||
/// Represents a successful validation or processing step. | ||
/// </summary> | ||
public class SuccessfulStep : IStepResult | ||
{ | ||
} |
Oops, something went wrong.