Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 74f29ad

Browse files
committed
#270 Rename auth wrapper's internal collections to Items.
1 parent cdae112 commit 74f29ad

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationDescription.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,30 @@ public class AuthenticationDescription
2121
/// </summary>
2222
public AuthenticationDescription()
2323
{
24-
Dictionary = new Dictionary<string, object>(StringComparer.Ordinal);
24+
Items = new Dictionary<string, object>(StringComparer.Ordinal);
2525
}
2626

2727
/// <summary>
2828
/// Initializes a new instance of the <see cref="AuthenticationDescription"/> class
2929
/// </summary>
30-
/// <param name="properties"></param>
31-
public AuthenticationDescription([NotNull] IDictionary<string, object> properties)
30+
/// <param name="items"></param>
31+
public AuthenticationDescription([NotNull] IDictionary<string, object> items)
3232
{
33-
Dictionary = properties;
33+
Items = items;
3434
}
3535

3636
/// <summary>
3737
/// Contains metadata about the authentication provider.
3838
/// </summary>
39-
public IDictionary<string, object> Dictionary { get; private set; }
39+
public IDictionary<string, object> Items { get; private set; }
4040

4141
/// <summary>
4242
/// Gets or sets the name used to reference the authentication middleware instance.
4343
/// </summary>
4444
public string AuthenticationScheme
4545
{
4646
get { return GetString(AuthenticationSchemePropertyKey); }
47-
set { Dictionary[AuthenticationSchemePropertyKey] = value; }
47+
set { Items[AuthenticationSchemePropertyKey] = value; }
4848
}
4949

5050
/// <summary>
@@ -53,13 +53,13 @@ public string AuthenticationScheme
5353
public string Caption
5454
{
5555
get { return GetString(CaptionPropertyKey); }
56-
set { Dictionary[CaptionPropertyKey] = value; }
56+
set { Items[CaptionPropertyKey] = value; }
5757
}
5858

5959
private string GetString(string name)
6060
{
6161
object value;
62-
if (Dictionary.TryGetValue(name, out value))
62+
if (Items.TryGetValue(name, out value))
6363
{
6464
return Convert.ToString(value, CultureInfo.InvariantCulture);
6565
}

src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationProperties.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,71 +24,71 @@ public class AuthenticationProperties
2424
/// Initializes a new instance of the <see cref="AuthenticationProperties"/> class
2525
/// </summary>
2626
public AuthenticationProperties()
27-
: this(dictionary: null)
27+
: this(items: null)
2828
{
2929
}
3030

3131
/// <summary>
3232
/// Initializes a new instance of the <see cref="AuthenticationProperties"/> class
3333
/// </summary>
34-
/// <param name="dictionary"></param>
35-
public AuthenticationProperties(IDictionary<string, string> dictionary)
34+
/// <param name="items"></param>
35+
public AuthenticationProperties(IDictionary<string, string> items)
3636
{
37-
Dictionary = dictionary ?? new Dictionary<string, string>(StringComparer.Ordinal);
37+
Items = items ?? new Dictionary<string, string>(StringComparer.Ordinal);
3838
}
3939

4040
/// <summary>
4141
/// State values about the authentication session.
4242
/// </summary>
43-
public IDictionary<string, string> Dictionary { get; private set; }
43+
public IDictionary<string, string> Items { get; private set; }
4444

4545
/// <summary>
4646
/// Gets or sets whether the authentication session is persisted across multiple requests.
4747
/// </summary>
4848
public bool IsPersistent
4949
{
50-
get { return Dictionary.ContainsKey(IsPersistentKey); }
50+
get { return Items.ContainsKey(IsPersistentKey); }
5151
set
5252
{
53-
if (Dictionary.ContainsKey(IsPersistentKey))
53+
if (Items.ContainsKey(IsPersistentKey))
5454
{
5555
if (!value)
5656
{
57-
Dictionary.Remove(IsPersistentKey);
57+
Items.Remove(IsPersistentKey);
5858
}
5959
}
6060
else
6161
{
6262
if (value)
6363
{
64-
Dictionary.Add(IsPersistentKey, string.Empty);
64+
Items.Add(IsPersistentKey, string.Empty);
6565
}
6666
}
6767
}
6868
}
6969

7070
/// <summary>
71-
/// Gets or sets the full path or absolute URI to be used as an http redirect response value.
71+
/// Gets or sets the full path or absolute URI to be used as an http redirect response value.
7272
/// </summary>
7373
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Justification = "By design")]
7474
public string RedirectUri
7575
{
7676
get
7777
{
7878
string value;
79-
return Dictionary.TryGetValue(RedirectUriKey, out value) ? value : null;
79+
return Items.TryGetValue(RedirectUriKey, out value) ? value : null;
8080
}
8181
set
8282
{
8383
if (value != null)
8484
{
85-
Dictionary[RedirectUriKey] = value;
85+
Items[RedirectUriKey] = value;
8686
}
8787
else
8888
{
89-
if (Dictionary.ContainsKey(RedirectUriKey))
89+
if (Items.ContainsKey(RedirectUriKey))
9090
{
91-
Dictionary.Remove(RedirectUriKey);
91+
Items.Remove(RedirectUriKey);
9292
}
9393
}
9494
}
@@ -102,7 +102,7 @@ public DateTimeOffset? IssuedUtc
102102
get
103103
{
104104
string value;
105-
if (Dictionary.TryGetValue(IssuedUtcKey, out value))
105+
if (Items.TryGetValue(IssuedUtcKey, out value))
106106
{
107107
DateTimeOffset dateTimeOffset;
108108
if (DateTimeOffset.TryParseExact(value, UtcDateTimeFormat, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out dateTimeOffset))
@@ -116,13 +116,13 @@ public DateTimeOffset? IssuedUtc
116116
{
117117
if (value.HasValue)
118118
{
119-
Dictionary[IssuedUtcKey] = value.Value.ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture);
119+
Items[IssuedUtcKey] = value.Value.ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture);
120120
}
121121
else
122122
{
123-
if (Dictionary.ContainsKey(IssuedUtcKey))
123+
if (Items.ContainsKey(IssuedUtcKey))
124124
{
125-
Dictionary.Remove(IssuedUtcKey);
125+
Items.Remove(IssuedUtcKey);
126126
}
127127
}
128128
}
@@ -136,7 +136,7 @@ public DateTimeOffset? ExpiresUtc
136136
get
137137
{
138138
string value;
139-
if (Dictionary.TryGetValue(ExpiresUtcKey, out value))
139+
if (Items.TryGetValue(ExpiresUtcKey, out value))
140140
{
141141
DateTimeOffset dateTimeOffset;
142142
if (DateTimeOffset.TryParseExact(value, UtcDateTimeFormat, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out dateTimeOffset))
@@ -150,13 +150,13 @@ public DateTimeOffset? ExpiresUtc
150150
{
151151
if (value.HasValue)
152152
{
153-
Dictionary[ExpiresUtcKey] = value.Value.ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture);
153+
Items[ExpiresUtcKey] = value.Value.ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture);
154154
}
155155
else
156156
{
157-
if (Dictionary.ContainsKey(ExpiresUtcKey))
157+
if (Items.ContainsKey(ExpiresUtcKey))
158158
{
159-
Dictionary.Remove(ExpiresUtcKey);
159+
Items.Remove(ExpiresUtcKey);
160160
}
161161
}
162162
}
@@ -170,7 +170,7 @@ public bool? AllowRefresh
170170
get
171171
{
172172
string value;
173-
if (Dictionary.TryGetValue(RefreshKey, out value))
173+
if (Items.TryGetValue(RefreshKey, out value))
174174
{
175175
bool refresh;
176176
if (bool.TryParse(value, out refresh))
@@ -184,13 +184,13 @@ public bool? AllowRefresh
184184
{
185185
if (value.HasValue)
186186
{
187-
Dictionary[RefreshKey] = value.Value.ToString();
187+
Items[RefreshKey] = value.Value.ToString();
188188
}
189189
else
190190
{
191-
if (Dictionary.ContainsKey(RefreshKey))
191+
if (Items.ContainsKey(RefreshKey))
192192
{
193-
Dictionary.Remove(RefreshKey);
193+
Items.Remove(RefreshKey);
194194
}
195195
}
196196
}

src/Microsoft.AspNet.Http/Authentication/DefaultAuthenticationManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public override void Challenge(AuthenticationProperties properties, string authe
8787
HttpResponseFeature.StatusCode = 401;
8888
var handler = HttpAuthenticationFeature.Handler;
8989

90-
var challengeContext = new ChallengeContext(authenticationScheme, properties == null ? null : properties.Dictionary);
90+
var challengeContext = new ChallengeContext(authenticationScheme, properties == null ? null : properties.Items);
9191
if (handler != null)
9292
{
9393
handler.Challenge(challengeContext);
@@ -103,7 +103,7 @@ public override void SignIn(string authenticationScheme, [NotNull] ClaimsPrincip
103103
{
104104
var handler = HttpAuthenticationFeature.Handler;
105105

106-
var signInContext = new SignInContext(authenticationScheme, principal, properties == null ? null : properties.Dictionary);
106+
var signInContext = new SignInContext(authenticationScheme, principal, properties == null ? null : properties.Items);
107107
if (handler != null)
108108
{
109109
handler.SignIn(signInContext);
@@ -120,7 +120,7 @@ public override void SignOut(string authenticationScheme, AuthenticationProperti
120120
{
121121
var handler = HttpAuthenticationFeature.Handler;
122122

123-
var signOutContext = new SignOutContext(authenticationScheme, properties?.Dictionary);
123+
var signOutContext = new SignOutContext(authenticationScheme, properties?.Items);
124124
if (handler != null)
125125
{
126126
handler.SignOut(signOutContext);

0 commit comments

Comments
 (0)