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);
108
else if (!_context.Items.ContainsKey(
OwinConstants
.CallCancelled))
110
_context.Items[
OwinConstants
.CallCancelled] = CancellationToken.None;
114
if (!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)
52
var register = Prop<Action<Action<object>, object>>(
OwinConstants
.CommonKeys.OnSendingHeaders);
77
get { return Prop<string>(
OwinConstants
.RequestProtocol); }
78
set { Prop(
OwinConstants
.RequestProtocol, value); }
83
get { return Prop<string>(
OwinConstants
.RequestScheme); }
84
set { Prop(
OwinConstants
.RequestScheme, value); }
89
get { return Prop<string>(
OwinConstants
.RequestMethod); }
90
set { Prop(
OwinConstants
.RequestMethod, value); }
95
get { return Prop<string>(
OwinConstants
.RequestPathBase); }
96
set { Prop(
OwinConstants
.RequestPathBase, value); }
101
get { return Prop<string>(
OwinConstants
.RequestPath); }
102
set { Prop(
OwinConstants
.RequestPath, value); }
107
get { return Utilities.AddQuestionMark(Prop<string>(
OwinConstants
.RequestQueryString)); }
108
set { Prop(
OwinConstants
.RequestQueryString, Utilities.RemoveQuestionMark(value)); }
119
get { return Utilities.MakeHeaderDictionary(Prop<IDictionary<string, string[]>>(
OwinConstants
.RequestHeaders)); }
120
set { Prop(
OwinConstants
.RequestHeaders, Utilities.MakeDictionaryStringArray(value)); }
125
get { return Prop<string>(
OwinConstants
.RequestId); }
126
set { Prop(
OwinConstants
.RequestId, value); }
131
get { return Prop<Stream>(
OwinConstants
.RequestBody); }
132
set { Prop(
OwinConstants
.RequestBody, value); }
137
get { return Prop<int>(
OwinConstants
.ResponseStatusCode); }
138
set { Prop(
OwinConstants
.ResponseStatusCode, value); }
143
get { return Prop<string>(
OwinConstants
.ResponseReasonPhrase); }
144
set { Prop(
OwinConstants
.ResponseReasonPhrase, value); }
149
get { return Utilities.MakeHeaderDictionary(Prop<IDictionary<string, string[]>>(
OwinConstants
.ResponseHeaders)); }
150
set { Prop(
OwinConstants
.ResponseHeaders, Utilities.MakeDictionaryStringArray(value)); }
155
get { return Prop<Stream>(
OwinConstants
.ResponseBody); }
156
set { Prop(
OwinConstants
.ResponseBody, value); }
161
get { return Prop<Stream>(
OwinConstants
.ResponseBody); }
170
_responseBodyWrapper = PipeWriter.Create(Prop<Stream>(
OwinConstants
.ResponseBody), new StreamPipeWriterOptions(leaveOpen: true));
184
var register = Prop<Action<Action<object>, object>>(
OwinConstants
.CommonKeys.OnSendingHeaders);
187
throw new NotSupportedException(
OwinConstants
.CommonKeys.OnSendingHeaders);
201
get { return IPAddress.Parse(Prop<string>(
OwinConstants
.CommonKeys.RemoteIpAddress)); }
202
set { Prop(
OwinConstants
.CommonKeys.RemoteIpAddress, value.ToString()); }
207
get { return IPAddress.Parse(Prop<string>(
OwinConstants
.CommonKeys.LocalIpAddress)); }
208
set { Prop(
OwinConstants
.CommonKeys.LocalIpAddress, value.ToString()); }
213
get { return int.Parse(Prop<string>(
OwinConstants
.CommonKeys.RemotePort), CultureInfo.InvariantCulture); }
214
set { Prop(
OwinConstants
.CommonKeys.RemotePort, value.ToString(CultureInfo.InvariantCulture)); }
219
get { return int.Parse(Prop<string>(
OwinConstants
.CommonKeys.LocalPort), CultureInfo.InvariantCulture); }
220
set { Prop(
OwinConstants
.CommonKeys.LocalPort, value.ToString(CultureInfo.InvariantCulture)); }
225
get { return Prop<string>(
OwinConstants
.CommonKeys.ConnectionId); }
226
set { Prop(
OwinConstants
.CommonKeys.ConnectionId, value); }
232
if (Environment.TryGetValue(
OwinConstants
.SendFiles.SendAsync, out obj))
237
throw new NotSupportedException(
OwinConstants
.SendFiles.SendAsync);
246
&& (Environment.TryGetValue(
OwinConstants
.CommonKeys.LoadClientCertAsync, out obj)
247
|| Environment.TryGetValue(
OwinConstants
.CommonKeys.ClientCertificate, out obj))
258
get { return Prop<X509Certificate2>(
OwinConstants
.CommonKeys.ClientCertificate); }
259
set { Prop(
OwinConstants
.CommonKeys.ClientCertificate, value); }
264
var loadAsync = Prop<Func<Task>>(
OwinConstants
.CommonKeys.LoadClientCertAsync);
269
return Prop<X509Certificate2>(
OwinConstants
.CommonKeys.ClientCertificate);
274
get { return Prop<CancellationToken>(
OwinConstants
.CallCancelled); }
275
set { Prop(
OwinConstants
.CallCancelled, value); }
287
return Prop<ClaimsPrincipal>(
OwinConstants
.RequestUser)
288
?? Utilities.MakeClaimsPrincipal(Prop<IPrincipal>(
OwinConstants
.Security.User));
292
Prop(
OwinConstants
.RequestUser, value);
293
Prop(
OwinConstants
.Security.User, value);
307
return Environment.TryGetValue(
OwinConstants
.WebSocket.AcceptAlt, out _);
314
if (!Environment.TryGetValue(
OwinConstants
.WebSocket.AcceptAlt, out obj))
432
await Prop<Stream>(
OwinConstants
.ResponseBody).FlushAsync(cancellationToken);
WebSockets\OwinWebSocketAcceptAdapter.cs (3)
61
{
OwinConstants
.WebSocket.SubProtocol, context.SubProtocol }
119
if (environment.TryGetValue(
OwinConstants
.WebSocket.Accept, out accept) && accept is WebSocketAccept)
123
environment[
OwinConstants
.WebSocket.AcceptAlt] = new WebSocketAcceptAlt(adapter.AcceptWebSocketAsync);
WebSockets\OwinWebSocketAcceptContext.cs (2)
37
if (_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];
61
if (_websocketContext.TryGetValue(
OwinConstants
.WebSocket.ClientCloseStatus, out obj))
75
if (_websocketContext.TryGetValue(
OwinConstants
.WebSocket.ClientCloseDescription, out obj))
WebSockets\WebSocketAcceptAdapter.cs (5)
53
_env[
OwinConstants
.ResponseStatusCode] = 101;
66
if (environment.TryGetValue(
OwinConstants
.WebSocket.AcceptAlt, out accept) && accept is WebSocketAcceptAlt)
70
environment[
OwinConstants
.WebSocket.Accept] = new WebSocketAccept(adapter.AcceptWebSocket);
72
if ((int)environment[
OwinConstants
.ResponseStatusCode] == 101 && adapter._callback != null)
86
var 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;