Skip to content

Commit 6046555

Browse files
committed
Renamed auth. manager to auth. root.
1 parent d5bfd57 commit 6046555

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ packages
1010
*.dotCover
1111
log.txt
1212
*ncrunch*
13-
*.gpState
13+
*.gpState
14+
*.DotSettings

OAuth2.Example/Controllers/HomeController.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace OAuth2.Example.Controllers
1010
/// </summary>
1111
public class HomeController : Controller
1212
{
13-
private readonly AuthorizationManager authorizationManager;
13+
private readonly AuthorizationRoot authorizationRoot;
1414

1515
private const string ProviderNameKey = "providerName";
1616

@@ -23,18 +23,18 @@ private string ProviderName
2323
/// <summary>
2424
/// Initializes a new instance of the <see cref="HomeController"/> class.
2525
/// </summary>
26-
/// <param name="authorizationManager">The authorization manager.</param>
27-
public HomeController(AuthorizationManager authorizationManager)
26+
/// <param name="authorizationRoot">The authorization manager.</param>
27+
public HomeController(AuthorizationRoot authorizationRoot)
2828
{
29-
this.authorizationManager = authorizationManager;
29+
this.authorizationRoot = authorizationRoot;
3030
}
3131

3232
/// <summary>
3333
/// Renders home page with login link.
3434
/// </summary>
3535
public ActionResult Index()
3636
{
37-
var model = authorizationManager.Clients.Select(client => new LoginInfoModel
37+
var model = authorizationRoot.Clients.Select(client => new LoginInfoModel
3838
{
3939
ProviderName = client.ProviderName
4040
});
@@ -60,7 +60,7 @@ public ActionResult Auth()
6060

6161
private IClient GetClient()
6262
{
63-
return authorizationManager.Clients.First(c => c.ProviderName == ProviderName);
63+
return authorizationRoot.Clients.First(c => c.ProviderName == ProviderName);
6464
}
6565
}
6666
}

OAuth2.Example/Global.asax.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private void SetDependencyResolver()
7878
Assembly.GetAssembly(typeof(RestClient)))
7979
.AsImplementedInterfaces().AsSelf();
8080

81-
builder.RegisterType<AuthorizationManager>()
81+
builder.RegisterType<AuthorizationRoot>()
8282
.WithParameter(new NamedParameter("sectionName", "oauth2"));
8383

8484
DependencyResolver.SetResolver(new AutofacDependencyResolver(builder.Build()));

OAuth2/AuthorizationManager.cs renamed to OAuth2/AuthorizationRoot.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@
88

99
namespace OAuth2
1010
{
11-
public class AuthorizationManager
11+
public class AuthorizationRoot
1212
{
1313
private readonly IRequestFactory requestFactory;
1414
private readonly OAuth2ConfigurationSection configurationSection;
1515

1616
/// <summary>
17-
/// Initializes a new instance of the <see cref="AuthorizationManager" /> class.
17+
/// Initializes a new instance of the <see cref="AuthorizationRoot" /> class.
1818
/// </summary>
1919
/// <remarks>
2020
/// Since this is boundary class, we decided to create
2121
/// parameterless constructor where default implementations of dependencies are used.
2222
/// So, despite we encourage you to employ IoC pattern,
2323
/// you are still able to just create instance of manager manually and then use it in your project.
2424
/// </remarks>
25-
public AuthorizationManager() :
25+
public AuthorizationRoot() :
2626
this(new ConfigurationManager(), "oauth2", new RequestFactory())
2727
{
2828
}
2929

3030
/// <summary>
31-
/// Initializes a new instance of the <see cref="AuthorizationManager" /> class.
31+
/// Initializes a new instance of the <see cref="AuthorizationRoot" /> class.
3232
/// </summary>
3333
/// <param name="configurationManager">The configuration manager.</param>
3434
/// <param name="configurationSectionName">Name of the configuration section.</param>
3535
/// <param name="requestFactory">The request factory.</param>
36-
public AuthorizationManager(
36+
public AuthorizationRoot(
3737
IConfigurationManager configurationManager,
3838
string configurationSectionName,
3939
IRequestFactory requestFactory)

OAuth2/OAuth2.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<Reference Include="System.Web" />
4747
</ItemGroup>
4848
<ItemGroup>
49-
<Compile Include="AuthorizationManager.cs" />
49+
<Compile Include="AuthorizationRoot.cs" />
5050
<Compile Include="Client\Impl\FacebookClient.cs" />
5151
<Compile Include="Client\Impl\FoursquareClient.cs" />
5252
<Compile Include="Client\Impl\GoogleClient.cs" />

0 commit comments

Comments
 (0)