//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OpenId { using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using System.Linq; using System.Net.Http; using System.Runtime.CompilerServices; using System.Text; using System.Threading; using System.Threading.Tasks; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OpenId.RelyingParty; using Validation; /// /// A module that provides discovery services for OpenID identifiers. /// public interface IIdentifierDiscoveryService { /// /// Performs discovery on the specified identifier. /// /// The identifier to perform discovery on. /// The cancellation token. /// /// A sequence of service endpoints yielded by discovery. Must not be null, but may be empty. /// [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#", Justification = "By design")] Task DiscoverAsync(Identifier identifier, CancellationToken cancellationToken); } /// /// Describes the result of . /// public class IdentifierDiscoveryServiceResult { /// /// Initializes a new instance of the class. /// /// The results. /// if set to true, no further discovery services will be called for this identifier. public IdentifierDiscoveryServiceResult(IEnumerable results, bool abortDiscoveryChain = false) { Requires.NotNull(results, "results"); this.Results = results; this.AbortDiscoveryChain = abortDiscoveryChain; } /// /// Gets the results from this individual discovery service. /// public IEnumerable Results { get; private set; } /// /// Gets a value indicating whether no further discovery services should be called for this identifier. /// public bool AbortDiscoveryChain { get; private set; } } }