diff --git a/src/Api/Controllers/SsoCookieVendorController.cs b/src/Api/Platform/SsoCookieVendor/Controllers/SsoCookieVendorController.cs similarity index 97% rename from src/Api/Controllers/SsoCookieVendorController.cs rename to src/Api/Platform/SsoCookieVendor/Controllers/SsoCookieVendorController.cs index 4d45415a4f..9c5a637f43 100644 --- a/src/Api/Controllers/SsoCookieVendorController.cs +++ b/src/Api/Platform/SsoCookieVendor/Controllers/SsoCookieVendorController.cs @@ -3,7 +3,7 @@ using Bit.Core.Utilities; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -namespace Bit.Api.Controllers; +namespace Bit.Api.Platform.SsoCookieVendor; /// /// Provides an endpoint to read an SSO cookie and redirect to a custom URI @@ -114,6 +114,6 @@ public class SsoCookieVendorController(IGlobalSettings globalSettings) : Control // event a user agent decides the URI is too long. queryParams.Add("d=1"); - return $"bitwarden://sso_cookie_vendor?{string.Join("&", queryParams)}"; + return $"bitwarden://sso-cookie-vendor?{string.Join("&", queryParams)}"; } } diff --git a/test/Api.Test/Controllers/SsoCookieVendorControllerTests.cs b/test/Api.Test/Platform/SsoCookieVendor/Controllers/SsoCookieVendorControllerTests.cs similarity index 96% rename from test/Api.Test/Controllers/SsoCookieVendorControllerTests.cs rename to test/Api.Test/Platform/SsoCookieVendor/Controllers/SsoCookieVendorControllerTests.cs index 1e954e68ff..9cc23d7048 100644 --- a/test/Api.Test/Controllers/SsoCookieVendorControllerTests.cs +++ b/test/Api.Test/Platform/SsoCookieVendor/Controllers/SsoCookieVendorControllerTests.cs @@ -1,13 +1,13 @@ #nullable enable -using Bit.Api.Controllers; +using Bit.Api.Platform.SsoCookieVendor; using Bit.Core.Settings; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using NSubstitute; using Xunit; -namespace Bit.Api.Test.Controllers; +namespace Bit.Api.Test.Platform.SsoCookieVendor.Controllers; public class SsoCookieVendorControllerTests : IDisposable { @@ -129,7 +129,7 @@ public class SsoCookieVendorControllerTests : IDisposable // Assert var redirectResult = Assert.IsType(result); - Assert.Equal("bitwarden://sso_cookie_vendor?test-cookie=my-token-value-123&d=1", redirectResult.Url); + Assert.Equal("bitwarden://sso-cookie-vendor?test-cookie=my-token-value-123&d=1", redirectResult.Url); } [Fact] @@ -170,7 +170,7 @@ public class SsoCookieVendorControllerTests : IDisposable // Assert var redirectResult = Assert.IsType(result); - Assert.StartsWith("bitwarden://sso_cookie_vendor?", redirectResult.Url); + Assert.StartsWith("bitwarden://sso-cookie-vendor?", redirectResult.Url); Assert.Contains("test-cookie-0=part1", redirectResult.Url); Assert.Contains("test-cookie-1=part2", redirectResult.Url); Assert.Contains("test-cookie-2=part3", redirectResult.Url); @@ -256,7 +256,7 @@ public class SsoCookieVendorControllerTests : IDisposable public void Get_WhenUriExceedsMaxLength_Returns400() { // Arrange - create a very long cookie value that will exceed 8192 characters - // URI format: "bitwarden://sso_cookie_vendor?test-cookie={value}" + // URI format: "bitwarden://sso-cookie-vendor?test-cookie={value}" // Base URI length is about 43 characters, so we need value > 8149 var longValue = new string('a', 8200); var cookies = new Dictionary @@ -289,7 +289,7 @@ public class SsoCookieVendorControllerTests : IDisposable // Assert var redirectResult = Assert.IsType(result); - Assert.Equal("bitwarden://sso_cookie_vendor?test-cookie=single-value&d=1", redirectResult.Url); + Assert.Equal("bitwarden://sso-cookie-vendor?test-cookie=single-value&d=1", redirectResult.Url); } [Fact]