FIXME SR is private

This commit is contained in:
Paul Schneider 2023-03-19 17:57:55 +00:00
commit 123283f277
576 changed files with 75350 additions and 13070 deletions

View file

@ -1,6 +1,6 @@
using System;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
namespace Yavsc.Extensions {
public static class AppBuilderExtensions {
@ -36,4 +36,4 @@ namespace Yavsc.Extensions {
});
}
}
}
}

View file

@ -4,7 +4,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.Extensions.Localization;
namespace Yavsc.Extensions

View file

@ -1,59 +0,0 @@
using System;
using OAuth.AspNet.AuthServer;
namespace Microsoft.AspNet.Builder
{
/// <summary>
/// Extension methods to add Authorization Server capabilities to an OWIN pipeline
/// </summary>
public static class OAuthAuthorizationServerExtensions
{
/// <summary>
/// Adds OAuth2 Authorization Server capabilities to an OWIN web application. This middleware
/// performs the request processing for the Authorize and Token endpoints defined by the OAuth2 specification.
/// See also http://tools.ietf.org/html/rfc6749
/// </summary>
/// <param name="app">The web application builder</param>
/// <param name="options">Options which control the behavior of the Authorization Server.</param>
/// <returns>The application builder</returns>
public static IApplicationBuilder UseOAuthAuthorizationServer(this IApplicationBuilder app, OAuthAuthorizationServerOptions options)
{
if (app == null)
throw new NullReferenceException($"The extension method {nameof(OAuthAuthorizationServerExtensions.UseOAuthAuthorizationServer)} was called on a null reference to a {nameof(IApplicationBuilder)}");
if (options == null)
throw new ArgumentNullException(nameof(options));
return app.UseMiddleware<OAuthAuthorizationServerMiddleware>(options);
}
/// <summary>
/// Adds OAuth2 Authorization Server capabilities to an OWIN web application. This middleware
/// performs the request processing for the Authorize and Token endpoints defined by the OAuth2 specification.
/// See also http://tools.ietf.org/html/rfc6749
/// </summary>
/// <param name="app">The web application builder</param>
/// <param name="configureOptions">Options which control the behavior of the Authorization Server.</param>
/// <returns>The application builder</returns>
public static IApplicationBuilder UseOAuthAuthorizationServer(this IApplicationBuilder app, Action<OAuthAuthorizationServerOptions> configureOptions)
{
if (app == null)
throw new NullReferenceException($"The extension method {nameof(OAuthAuthorizationServerExtensions.UseOAuthAuthorizationServer)} was called on a null reference to a {nameof(IApplicationBuilder)}");
if (configureOptions == null)
throw new ArgumentNullException(nameof(configureOptions));
var options = new OAuthAuthorizationServerOptions();
configureOptions?.Invoke(options);
return app.UseOAuthAuthorizationServer(options);
}
}
}

View file

@ -1,47 +0,0 @@
using Microsoft.AspNet.Builder;
using Microsoft.Owin.Builder;
using Owin;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Yavsc
{
using Microsoft.AspNet.SignalR;
using AppFunc = Func<IDictionary<string, object>, Task>;
public static class BuilderExtensions
{
public static IApplicationBuilder UseAppBuilder(
this IApplicationBuilder app,
Action<IAppBuilder> configure)
{
app.UseOwin(addToPipeline =>
{
addToPipeline(next =>
{
var appBuilder = new AppBuilder();
appBuilder.Properties["builder.DefaultApp"] = next;
configure(appBuilder);
return appBuilder.Build<AppFunc>();
});
});
return app;
}
public static void UseSignalR(this IApplicationBuilder app, string path = "/signalr")
{
app.UseAppBuilder(appBuilder => appBuilder.MapSignalR(
path,
new HubConfiguration() {
EnableDetailedErrors = true,
EnableJSONP = true,
EnableJavaScriptProxies = true
}
));
}
}
}