111 references to OwinConstants
Microsoft.AspNetCore.Owin (111)
OwinEnvironment.cs (30)
51if (!_context.Items.ContainsKey(OwinConstants.CallCancelled)) 53_context.Items[OwinConstants.CallCancelled] = CancellationToken.None; 57if (!context.Items.ContainsKey(OwinConstants.OwinVersion)) 59_context.Items[OwinConstants.OwinVersion] = "1.0"; 409{ OwinConstants.RequestProtocol, new FeatureMap<IHttpRequestFeature>(feature => feature.Protocol, () => string.Empty, (feature, value) => feature.Protocol = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 410{ OwinConstants.RequestScheme, new FeatureMap<IHttpRequestFeature>(feature => feature.Scheme, () => string.Empty, (feature, value) => feature.Scheme = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 411{ OwinConstants.RequestMethod, new FeatureMap<IHttpRequestFeature>(feature => feature.Method, () => string.Empty, (feature, value) => feature.Method = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 412{ OwinConstants.RequestPathBase, new FeatureMap<IHttpRequestFeature>(feature => feature.PathBase, () => string.Empty, (feature, value) => feature.PathBase = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 413{ OwinConstants.RequestPath, new FeatureMap<IHttpRequestFeature>(feature => feature.Path, () => string.Empty, (feature, value) => feature.Path = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 414{ OwinConstants.RequestQueryString, new FeatureMap<IHttpRequestFeature>(feature => Utilities.RemoveQuestionMark(feature.QueryString), () => string.Empty, (feature, value) => feature.QueryString = Utilities.AddQuestionMark(Convert.ToString(value, CultureInfo.InvariantCulture))) }, 415{ OwinConstants.RequestHeaders, new FeatureMap<IHttpRequestFeature>(feature => Utilities.MakeDictionaryStringArray(feature.Headers), (feature, value) => feature.Headers = Utilities.MakeHeaderDictionary((IDictionary<string, string[]>)value)) }, 416{ OwinConstants.RequestBody, new FeatureMap<IHttpRequestFeature>(feature => feature.Body, () => Stream.Null, (feature, value) => feature.Body = (Stream)value) }, 417{ OwinConstants.RequestUser, new FeatureMap<IHttpAuthenticationFeature>(feature => feature.User, () => null, (feature, value) => feature.User = (ClaimsPrincipal)value) }, 419{ OwinConstants.ResponseStatusCode, new FeatureMap<IHttpResponseFeature>(feature => feature.StatusCode, () => 200, (feature, value) => feature.StatusCode = Convert.ToInt32(value, CultureInfo.InvariantCulture)) }, 420{ OwinConstants.ResponseReasonPhrase, new FeatureMap<IHttpResponseFeature>(feature => feature.ReasonPhrase, (feature, value) => feature.ReasonPhrase = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 421{ OwinConstants.ResponseHeaders, new FeatureMap<IHttpResponseFeature>(feature => Utilities.MakeDictionaryStringArray(feature.Headers), (feature, value) => feature.Headers = Utilities.MakeHeaderDictionary((IDictionary<string, string[]>)value)) }, 422{ OwinConstants.CommonKeys.OnSendingHeaders, new FeatureMap<IHttpResponseFeature>( 432{ OwinConstants.CommonKeys.ConnectionId, new FeatureMap<IHttpConnectionFeature>(feature => feature.ConnectionId, (feature, value) => feature.ConnectionId = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 434{ OwinConstants.CommonKeys.LocalPort, new FeatureMap<IHttpConnectionFeature>(feature => PortToString(feature.LocalPort), (feature, value) => feature.LocalPort = Convert.ToInt32(value, CultureInfo.InvariantCulture)) }, 435{ OwinConstants.CommonKeys.RemotePort, new FeatureMap<IHttpConnectionFeature>(feature => PortToString(feature.RemotePort), (feature, value) => feature.RemotePort = Convert.ToInt32(value, CultureInfo.InvariantCulture)) }, 437{ OwinConstants.CommonKeys.LocalIpAddress, new FeatureMap<IHttpConnectionFeature>(feature => feature.LocalIpAddress.ToString(), (feature, value) => feature.LocalIpAddress = IPAddress.Parse(Convert.ToString(value, CultureInfo.InvariantCulture))) }, 438{ OwinConstants.CommonKeys.RemoteIpAddress, new FeatureMap<IHttpConnectionFeature>(feature => feature.RemoteIpAddress.ToString(), (feature, value) => feature.RemoteIpAddress = IPAddress.Parse(Convert.ToString(value, CultureInfo.InvariantCulture))) }, 440{ OwinConstants.SendFiles.SendAsync, new FeatureMap<IHttpResponseBodyFeature>(feature => new SendFileFunc(feature.SendFileAsync)) }, 441{ OwinConstants.Security.User, new FeatureMap<IHttpAuthenticationFeature>(feature => feature.User, ()=> null, (feature, value) => feature.User = Utilities.MakeClaimsPrincipal((IPrincipal)value), () => new HttpAuthenticationFeature()) }, 442{ OwinConstants.RequestId, new FeatureMap<IHttpRequestIdentifierFeature>(feature => feature.TraceIdentifier, ()=> null, (feature, value) => feature.TraceIdentifier = (string)value, () => new HttpRequestIdentifierFeature()) }, 443{ OwinConstants.CallCancelled, new FeatureMap<IHttpRequestLifetimeFeature>(feature => feature.RequestAborted) }, 445{ OwinConstants.CommonKeys.ClientCertificate, new FeatureMap<ITlsConnectionFeature>(feature => feature.ClientCertificate, (feature, value) => feature.ClientCertificate = (X509Certificate2)value) }, 446{ OwinConstants.CommonKeys.LoadClientCertAsync, new FeatureMap<ITlsConnectionFeature>(feature => new Func<Task>(() => feature.GetClientCertificateAsync(CancellationToken.None))) }, 447{ OwinConstants.WebSocket.AcceptAlt, new FeatureMap<IHttpWebSocketFeature>( 483{ 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.
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;