Skip to content

Commit

Permalink
Remove nullable bools and web.spa
Browse files Browse the repository at this point in the history
  • Loading branch information
nbarbettini committed Mar 25, 2016
1 parent 659d7f7 commit 29c21fb
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 103 deletions.
6 changes: 0 additions & 6 deletions src/Stormpath.Configuration.Abstractions/Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,6 @@ public static class Default
Uri = "/me",
},

Spa = new WebSpaConfiguration()
{
Enabled = false,
View = "index",
},

Unauthorized = new WebUnauthorizedConfiguration()
{
View = "unauthorized",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public WebConfiguration(
WebIdSiteRouteConfiguration idSiteRoute = null,
IDictionary<string, WebSocialProviderConfiguration> social = null,
WebMeRouteConfiguration meRoute = null,
WebSpaConfiguration spa = null,
WebUnauthorizedConfiguration unauthorizedRoute = null)
{
this.BasePath = basePath ?? Default.Configuration.Web.BasePath;
Expand All @@ -57,7 +56,6 @@ public WebConfiguration(
this.IdSite = new WebIdSiteRouteConfiguration(idSiteRoute ?? Default.Configuration.Web.IdSite);
this.Social = new Dictionary<string, WebSocialProviderConfiguration>(social ?? Default.Configuration.Web.Social.ToDictionary(), StringComparer.OrdinalIgnoreCase);
this.Me = new WebMeRouteConfiguration(meRoute ?? Default.Configuration.Web.Me);
this.Spa = new WebSpaConfiguration(spa ?? Default.Configuration.Web.Spa);
this.Unauthorized = new WebUnauthorizedConfiguration(unauthorizedRoute ?? Default.Configuration.Web.Unauthorized);
}

Expand All @@ -76,7 +74,6 @@ public WebConfiguration(WebConfiguration existing)
existing?.IdSite,
existing?.Social.ToDictionary(),
existing?.Me,
existing?.Spa,
existing?.Unauthorized)
{
}
Expand Down Expand Up @@ -169,12 +166,6 @@ internal WebConfiguration()
/// <remarks>Configuration path: <c>stormpath.web.me</c></remarks>
public WebMeRouteConfiguration Me { get; internal set; }

/// <summary>
/// The Single-Page Application configuration.
/// </summary>
/// <remarks>Configuration path: <c>stormpath.web.spa</c></remarks>
public WebSpaConfiguration Spa { get; internal set; }

/// <summary>
/// The Unauthorized route configuration.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed class WebCookieConfiguration
{
public WebCookieConfiguration(
string name,
bool? httpOnly,
bool httpOnly,
bool? secure,
string path,
string domain)
Expand All @@ -37,7 +37,7 @@ public WebCookieConfiguration(

public WebCookieConfiguration(WebCookieConfiguration existing)
: this(name: existing?.Name,
httpOnly: existing?.HttpOnly,
httpOnly: existing?.HttpOnly ?? true,
secure: existing?.Secure,
path: existing?.Path,
domain: existing?.Domain)
Expand All @@ -58,7 +58,7 @@ internal WebCookieConfiguration()
/// The cookie's <c>HttpOnly</c>flag.
/// </summary>
/// <remarks>Configuration path: <c>stormpath.web.[*Cookie].httpOnly</c></remarks>
public bool? HttpOnly { get; internal set; }
public bool HttpOnly { get; internal set; }

/// <summary>
/// The cookie's <c>Secure</c> flag.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal WebIdSiteRouteConfiguration()
/// Determines whether ID Site is used for login, registration, and password reset.
/// </summary>
/// <remarks>Configuration path: <c>stormpath.web.idSite.enabled</c></remarks>
public bool? Enabled { get; internal set; }
public bool Enabled { get; internal set; }

/// <summary>
/// The URI for this route, or <see langword="null"/> to use the default URI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ internal WebLoginRouteConfiguration()
/// Determines whether the Login route is enabled.
/// </summary>
/// <remarks>Configuration path: <c>stormpath.web.login.enabled</c></remarks>
public bool? Enabled { get; internal set; }
public bool Enabled { get; internal set; }

/// <summary>
/// The URI for this route, or <see langword="null"/> to use the default URI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ internal WebLogoutRouteConfiguration()
/// Determines whether the Logout route is enabled.
/// </summary>
/// <remarks>Configuration path: <c>stormpath.web.logout.enabled</c></remarks>
public bool? Enabled { get; internal set; }
public bool Enabled { get; internal set; }

/// <summary>
/// The URI for this route, or <see langword="null"/> to use the default URI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal WebMeRouteConfiguration()
/// Determines whether the Me route is enabled.
/// </summary>
/// <remarks>Configuration path: <c>stormpath.web.me.enabled</c></remarks>
public bool? Enabled { get; internal set; }
public bool Enabled { get; internal set; }

/// <summary>
/// The URI for this route, or <see langword="null"/> to use the default URI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal WebOauth2ClientCredentialsGrantConfiguration()
/// Determines whether the <c>client_credentials</c> grant type is enabled.
/// </summary>
/// <remarks>Configuration path: <c>stormpath.web.oauth2.client_credentials.enabled</c></remarks>
public bool? Enabled { get; internal set; }
public bool Enabled { get; internal set; }

/// <summary>
/// The Access Token configuration options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal WebOauth2PasswordGrantConfiguration()
/// Determines whether the <c>password</c> grant type is enabled.
/// </summary>
/// <remarks>Configuration path: <c>stormpath.web.oauth2.password.enabled</c></remarks>
public bool? Enabled { get; internal set; }
public bool Enabled { get; internal set; }

/// <summary>
/// The selected validation strategy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal WebOauth2RouteConfiguration()
/// Determines whether the route is enabled.
/// </summary>
/// <remarks>Configuration path: <c>stormpath.web.oauth2.enabled</c></remarks>
public bool? Enabled { get; internal set; }
public bool Enabled { get; internal set; }

/// <summary>
/// The URI for this route, or <see langword="null"/> to use the default URI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ internal WebRegisterRouteConfiguration()
/// Determines whether the Register route is enabled.
/// </summary>
/// Configuration path: <c>stormpath.web.register.enabled</c>
public bool? Enabled { get; internal set; }
public bool Enabled { get; internal set; }

/// <summary>
/// The URI for this route, or <see langword="null"/> to use the default URI.
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion src/Stormpath.Configuration.Abstractions/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"tooling": {
"defaultNamespace": "Stormpath.Configuration.Abstractions"
},
"version": "2.0.0",
"version": "3.0.0",
"xmlDoc": true
}
8 changes: 4 additions & 4 deletions src/Stormpath.Configuration/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"authors": [ "Nate Barbettini" ],
"copyright": "(c) 2016 Stormpath, Inc.",
"dependencies": {
"FlexibleConfiguration": "1.0.0",
"Stormpath.Configuration.Abstractions": "2.0.0",
"Stormpath.SDK.Abstractions": "0.6.2"
"FlexibleConfiguration": "1.0.1",
"Stormpath.Configuration.Abstractions": "3.0.0",
"Stormpath.SDK.Abstractions": "0.7.1"
},
"description": "Load Stormpath configuration from various sources.",
"frameworks": {
Expand Down Expand Up @@ -40,5 +40,5 @@
"tooling": {
"defaultNamespace": "Stormpath.Configuration"
},
"version": "2.0.0"
"version": "3.0.0"
}
3 changes: 0 additions & 3 deletions test/Stormpath.Configuration.Test/Default_config_tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,6 @@ private static void ValidateConfig(StormpathConfiguration config)
config.Web.Me.Expand["providerData"].Should().BeFalse();
config.Web.Me.Expand["tenant"].Should().BeFalse();

config.Web.Spa.Enabled.Should().BeFalse();
config.Web.Spa.View.Should().Be("index");

config.Web.Unauthorized.View.Should().Be("unauthorized");

}
Expand Down
7 changes: 0 additions & 7 deletions test/Stormpath.Configuration.Test/Modified_config_tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ public void Supplied_by_instance()
enabled: false,
uri: "/myself"),

spa: new WebSpaConfiguration(
enabled: true,
view: "indexView"),

unauthorizedRoute: new WebUnauthorizedConfiguration(
view: "unauthorizedView")
);
Expand Down Expand Up @@ -630,9 +626,6 @@ private static void ValidateConfig(StormpathConfiguration config)
config.Web.Me.Expand.Should().HaveCount(1);
config.Web.Me.Expand["directory"].Should().BeTrue();

config.Web.Spa.Enabled.Should().BeTrue();
config.Web.Spa.View.Should().Be("indexView");

config.Web.Unauthorized.View.Should().Be("unauthorizedView");
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/Stormpath.Configuration.Test/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"copyright": "(c) 2016 Stormpath, Inc.",
"dependencies": {
"FluentAssertions": "4.2.1",
"Stormpath.Configuration": "2.0.0",
"Stormpath.Configuration": "3.0.0",
"xunit": "2.1.0",
"xunit.runner.dnx": "2.1.0-rc1-build204"
},
Expand All @@ -24,5 +24,5 @@
"tooling": {
"defaultNamespace": "Stormpath.Configuration.Test"
},
"version": "2.0.0"
"version": "3.0.0"
}

0 comments on commit 29c21fb

Please sign in to comment.