111 references to OwinConstants
Microsoft.AspNetCore.Owin (111)
OwinEnvironment.cs (30)
52{ OwinConstants.RequestProtocol, new FeatureMap<IHttpRequestFeature>(feature => feature.Protocol, () => string.Empty, (feature, value) => feature.Protocol = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 53{ OwinConstants.RequestScheme, new FeatureMap<IHttpRequestFeature>(feature => feature.Scheme, () => string.Empty, (feature, value) => feature.Scheme = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 54{ OwinConstants.RequestMethod, new FeatureMap<IHttpRequestFeature>(feature => feature.Method, () => string.Empty, (feature, value) => feature.Method = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 55{ OwinConstants.RequestPathBase, new FeatureMap<IHttpRequestFeature>(feature => feature.PathBase, () => string.Empty, (feature, value) => feature.PathBase = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 56{ OwinConstants.RequestPath, new FeatureMap<IHttpRequestFeature>(feature => feature.Path, () => string.Empty, (feature, value) => feature.Path = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 57{ OwinConstants.RequestQueryString, new FeatureMap<IHttpRequestFeature>(feature => Utilities.RemoveQuestionMark(feature.QueryString), () => string.Empty, 59{ OwinConstants.RequestHeaders, new FeatureMap<IHttpRequestFeature>(feature => Utilities.MakeDictionaryStringArray(feature.Headers), (feature, value) => feature.Headers = Utilities.MakeHeaderDictionary((IDictionary<string, string[]>)value)) }, 60{ OwinConstants.RequestBody, new FeatureMap<IHttpRequestFeature>(feature => feature.Body, () => Stream.Null, (feature, value) => feature.Body = (Stream)value) }, 61{ OwinConstants.RequestUser, new FeatureMap<IHttpAuthenticationFeature>(feature => feature.User, () => null, (feature, value) => feature.User = (ClaimsPrincipal)value) }, 63{ OwinConstants.ResponseStatusCode, new FeatureMap<IHttpResponseFeature>(feature => feature.StatusCode, () => 200, (feature, value) => feature.StatusCode = Convert.ToInt32(value, CultureInfo.InvariantCulture)) }, 64{ OwinConstants.ResponseReasonPhrase, new FeatureMap<IHttpResponseFeature>(feature => feature.ReasonPhrase, (feature, value) => feature.ReasonPhrase = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 65{ OwinConstants.ResponseHeaders, new FeatureMap<IHttpResponseFeature>(feature => Utilities.MakeDictionaryStringArray(feature.Headers), (feature, value) => feature.Headers = Utilities.MakeHeaderDictionary((IDictionary<string, string[]>)value)) }, 66{ OwinConstants.ResponseBody, new FeatureMap<IHttpResponseBodyFeature>(feature => feature.Stream, () => Stream.Null, (feature, value) => context.Response.Body = (Stream)value) }, // DefaultHttpResponse.Body.Set has built in logic to handle replacing the feature. 67{ OwinConstants.CommonKeys.OnSendingHeaders, new FeatureMap<IHttpResponseFeature>( 77{ OwinConstants.CommonKeys.ConnectionId, new FeatureMap<IHttpConnectionFeature>(feature => feature.ConnectionId, 80{ OwinConstants.CommonKeys.LocalPort, new FeatureMap<IHttpConnectionFeature>(feature => feature.LocalPort.ToString(CultureInfo.InvariantCulture), 82{ OwinConstants.CommonKeys.RemotePort, new FeatureMap<IHttpConnectionFeature>(feature => feature.RemotePort.ToString(CultureInfo.InvariantCulture), 85{ OwinConstants.CommonKeys.LocalIpAddress, new FeatureMap<IHttpConnectionFeature>(feature => feature.LocalIpAddress.ToString(), 87{ OwinConstants.CommonKeys.RemoteIpAddress, new FeatureMap<IHttpConnectionFeature>(feature => feature.RemoteIpAddress.ToString(), 90{ OwinConstants.SendFiles.SendAsync, new FeatureMap<IHttpResponseBodyFeature>(feature => new SendFileFunc(feature.SendFileAsync)) }, 92{ OwinConstants.Security.User, new FeatureMap<IHttpAuthenticationFeature>(feature => feature.User, 97{ OwinConstants.RequestId, new FeatureMap<IHttpRequestIdentifierFeature>(feature => feature.TraceIdentifier, 106_entries[OwinConstants.CallCancelled] = new FeatureMap<IHttpRequestLifetimeFeature>(feature => feature.RequestAborted); 108else if (!_context.Items.ContainsKey(OwinConstants.CallCancelled)) 110_context.Items[OwinConstants.CallCancelled] = CancellationToken.None; 114if (!context.Items.ContainsKey(OwinConstants.OwinVersion)) 116_context.Items[OwinConstants.OwinVersion] = "1.0"; 121_entries.Add(OwinConstants.CommonKeys.ClientCertificate, new FeatureMap<ITlsConnectionFeature>(feature => feature.ClientCertificate, 123_entries.Add(OwinConstants.CommonKeys.LoadClientCertAsync, new FeatureMap<ITlsConnectionFeature>( 129_entries.Add(OwinConstants.WebSocket.AcceptAlt, new FeatureMap<IHttpWebSocketFeature>(feature => new WebSocketAcceptAlt(feature.AcceptAsync)));
OwinFeatureCollection.cs (58)
52var register = Prop<Action<Action<object>, object>>(OwinConstants.CommonKeys.OnSendingHeaders); 77get { return Prop<string>(OwinConstants.RequestProtocol); } 78set { Prop(OwinConstants.RequestProtocol, value); } 83get { return Prop<string>(OwinConstants.RequestScheme); } 84set { Prop(OwinConstants.RequestScheme, value); } 89get { return Prop<string>(OwinConstants.RequestMethod); } 90set { Prop(OwinConstants.RequestMethod, value); } 95get { return Prop<string>(OwinConstants.RequestPathBase); } 96set { Prop(OwinConstants.RequestPathBase, value); } 101get { return Prop<string>(OwinConstants.RequestPath); } 102set { Prop(OwinConstants.RequestPath, value); } 107get { return Utilities.AddQuestionMark(Prop<string>(OwinConstants.RequestQueryString)); } 108set { Prop(OwinConstants.RequestQueryString, Utilities.RemoveQuestionMark(value)); } 119get { return Utilities.MakeHeaderDictionary(Prop<IDictionary<string, string[]>>(OwinConstants.RequestHeaders)); } 120set { Prop(OwinConstants.RequestHeaders, Utilities.MakeDictionaryStringArray(value)); } 125get { return Prop<string>(OwinConstants.RequestId); } 126set { Prop(OwinConstants.RequestId, value); } 131get { return Prop<Stream>(OwinConstants.RequestBody); } 132set { Prop(OwinConstants.RequestBody, value); } 137get { return Prop<int>(OwinConstants.ResponseStatusCode); } 138set { Prop(OwinConstants.ResponseStatusCode, value); } 143get { return Prop<string>(OwinConstants.ResponseReasonPhrase); } 144set { Prop(OwinConstants.ResponseReasonPhrase, value); } 149get { return Utilities.MakeHeaderDictionary(Prop<IDictionary<string, string[]>>(OwinConstants.ResponseHeaders)); } 150set { Prop(OwinConstants.ResponseHeaders, Utilities.MakeDictionaryStringArray(value)); } 155get { return Prop<Stream>(OwinConstants.ResponseBody); } 156set { Prop(OwinConstants.ResponseBody, value); } 161get { return Prop<Stream>(OwinConstants.ResponseBody); } 170_responseBodyWrapper = PipeWriter.Create(Prop<Stream>(OwinConstants.ResponseBody), new StreamPipeWriterOptions(leaveOpen: true)); 184var register = Prop<Action<Action<object>, object>>(OwinConstants.CommonKeys.OnSendingHeaders); 187throw new NotSupportedException(OwinConstants.CommonKeys.OnSendingHeaders); 201get { return IPAddress.Parse(Prop<string>(OwinConstants.CommonKeys.RemoteIpAddress)); } 202set { Prop(OwinConstants.CommonKeys.RemoteIpAddress, value.ToString()); } 207get { return IPAddress.Parse(Prop<string>(OwinConstants.CommonKeys.LocalIpAddress)); } 208set { Prop(OwinConstants.CommonKeys.LocalIpAddress, value.ToString()); } 213get { return int.Parse(Prop<string>(OwinConstants.CommonKeys.RemotePort), CultureInfo.InvariantCulture); } 214set { Prop(OwinConstants.CommonKeys.RemotePort, value.ToString(CultureInfo.InvariantCulture)); } 219get { return int.Parse(Prop<string>(OwinConstants.CommonKeys.LocalPort), CultureInfo.InvariantCulture); } 220set { Prop(OwinConstants.CommonKeys.LocalPort, value.ToString(CultureInfo.InvariantCulture)); } 225get { return Prop<string>(OwinConstants.CommonKeys.ConnectionId); } 226set { Prop(OwinConstants.CommonKeys.ConnectionId, value); } 232if (Environment.TryGetValue(OwinConstants.SendFiles.SendAsync, out obj)) 237throw new NotSupportedException(OwinConstants.SendFiles.SendAsync); 246&& (Environment.TryGetValue(OwinConstants.CommonKeys.LoadClientCertAsync, out obj) 247|| Environment.TryGetValue(OwinConstants.CommonKeys.ClientCertificate, out obj)) 258get { return Prop<X509Certificate2>(OwinConstants.CommonKeys.ClientCertificate); } 259set { Prop(OwinConstants.CommonKeys.ClientCertificate, value); } 264var loadAsync = Prop<Func<Task>>(OwinConstants.CommonKeys.LoadClientCertAsync); 269return Prop<X509Certificate2>(OwinConstants.CommonKeys.ClientCertificate); 274get { return Prop<CancellationToken>(OwinConstants.CallCancelled); } 275set { Prop(OwinConstants.CallCancelled, value); } 287return Prop<ClaimsPrincipal>(OwinConstants.RequestUser) 288?? Utilities.MakeClaimsPrincipal(Prop<IPrincipal>(OwinConstants.Security.User)); 292Prop(OwinConstants.RequestUser, value); 293Prop(OwinConstants.Security.User, value); 307return Environment.TryGetValue(OwinConstants.WebSocket.AcceptAlt, out _); 314if (!Environment.TryGetValue(OwinConstants.WebSocket.AcceptAlt, out obj)) 432await Prop<Stream>(OwinConstants.ResponseBody).FlushAsync(cancellationToken);
WebSockets\OwinWebSocketAcceptAdapter.cs (3)
61{ OwinConstants.WebSocket.SubProtocol, context.SubProtocol } 119if (environment.TryGetValue(OwinConstants.WebSocket.Accept, out accept) && accept is WebSocketAccept) 123environment[OwinConstants.WebSocket.AcceptAlt] = new WebSocketAcceptAlt(adapter.AcceptWebSocketAsync);
WebSockets\OwinWebSocketAcceptContext.cs (2)
37if (_options != null && _options.TryGetValue(OwinConstants.WebSocket.SubProtocol, out obj)) 49_options[OwinConstants.WebSocket.SubProtocol] = value;
WebSockets\OwinWebSocketAdapter.cs (5)
48_sendAsync = (WebSocketSendAsync)websocketContext[OwinConstants.WebSocket.SendAsync]; 49_receiveAsync = (WebSocketReceiveAsync)websocketContext[OwinConstants.WebSocket.ReceiveAsync]; 50_closeAsync = (WebSocketCloseAsync)websocketContext[OwinConstants.WebSocket.CloseAsync]; 61if (_websocketContext.TryGetValue(OwinConstants.WebSocket.ClientCloseStatus, out obj)) 75if (_websocketContext.TryGetValue(OwinConstants.WebSocket.ClientCloseDescription, out obj))
WebSockets\WebSocketAcceptAdapter.cs (5)
53_env[OwinConstants.ResponseStatusCode] = 101; 66if (environment.TryGetValue(OwinConstants.WebSocket.AcceptAlt, out accept) && accept is WebSocketAcceptAlt) 70environment[OwinConstants.WebSocket.Accept] = new WebSocketAccept(adapter.AcceptWebSocket); 72if ((int)environment[OwinConstants.ResponseStatusCode] == 101 && adapter._callback != null) 86var webSocketAdapter = new WebSocketAdapter(webSocket, (CancellationToken)environment[OwinConstants.CallCancelled]);
WebSockets\WebSocketAdapter.cs (8)
46_environment[OwinConstants.WebSocket.SendAsync] = new WebSocketSendAsync(SendAsync); 47_environment[OwinConstants.WebSocket.ReceiveAsync] = new WebSocketReceiveAsync(ReceiveAsync); 48_environment[OwinConstants.WebSocket.CloseAsync] = new WebSocketCloseAsync(CloseAsync); 49_environment[OwinConstants.WebSocket.CallCancelled] = ct; 50_environment[OwinConstants.WebSocket.Version] = OwinConstants.WebSocket.VersionValue; 82_environment[OwinConstants.WebSocket.ClientCloseStatus] = (int)(nativeResult.CloseStatus ?? WebSocketCloseStatus.NormalClosure); 83_environment[OwinConstants.WebSocket.ClientCloseDescription] = nativeResult.CloseStatusDescription ?? string.Empty;