/// <summary> /// Handler für Authentifizierung über IP Adresse des Schalters /// </summary> /// <param name="options"></param> /// <param name="logger"></param> /// <param name="encoder"></param> /// <param name="clock"></param> /// <param name="ctx"></param> /// <param name="ctxDOA"></param> public ApiKeyAuthenticationHandler(IOptionsMonitor <ApiKeyAuthenticationHandlerOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, IGenericDataStore data) : base(options, logger, encoder, clock) { log = logger.CreateLogger <ApiKeyAuthenticationHandler>(); _data = data; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IGenericDataStore dataStore) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Emergency Data API V1"); }); app.UseHttpsRedirection(); app.UseMvc(); app.UseWebSockets(); app.Use(async(context, next) => { if (context.Request.Path.StartsWithSegments("/ws")) { if (context.WebSockets.IsWebSocketRequest) { WebSocket webSocket = await context.WebSockets.AcceptWebSocketAsync(); // Websocket-Request received var websocketManager = context.RequestServices.GetService <IWebsocketManager>(); await websocketManager.OnWebsocketConnected(context, webSocket); } else { context.Response.StatusCode = 400; } } else { await next(); } }); OnApplicationStarted(dataStore); }
/// <summary> /// Controller to Access the Documents /// </summary> /// <param name="db"></param> public ObjectService(IGenericDataStore db) { this.db = db; }
public WebsocketManager(IGenericDataStore data, ObjectService os) { db = data; objectService = os; }
public void OnApplicationStarted(IGenericDataStore dataStore) { dataStore.InitIdentity(); }
/// <summary> /// Controller to Access the Documents /// </summary> /// <param name="db"></param> public ObjectController(IGenericDataStore db, ObjectChangeTracker ct) { this.db = db; this.changeTracker = ct; }
/// <summary> /// Controller to Access the Documents /// </summary> /// <param name="db"></param> public AccountController(IGenericDataStore db) { this.db = db; }