Skip to content

Commit c978f0c

Browse files
committed
chore: fix test builds
- openapi instead of just api - reverted formated string in bundle.json
1 parent 1502976 commit c978f0c

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

src/AspNet.Security.OAuth.Etsy/EtsyAuthenticationOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public override void Validate()
8989

9090
if (IncludeDetailedUserInfo && !Scope.Contains(Scopes.EmailRead))
9191
{
92-
// EmailRead scope is required to access detailed user info
92+
// EmailRead scope is required to access detailed user info. As the post configure action should have added it, we need to ensure it's present.
9393
throw new ArgumentOutOfRangeException(nameof(Scope), string.Join(',', Scope), $"The '{Scopes.EmailRead}' scope must be specified when '{nameof(IncludeDetailedUserInfo)}' is enabled.");
9494
}
9595

test/AspNet.Security.OAuth.Providers.Tests/Etsy/EtsyAuthenticationOptionsTests.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,28 @@ public static void Validate_Throws_If_UserInformationEndpoint_Is_Null()
9696
{
9797
ClientId = "my-client-id",
9898
ClientSecret = "my-client-secret",
99-
TokenEndpoint = null!,
99+
UserInformationEndpoint = null!,
100100
};
101101

102102
// Act and Assert
103103
_ = Assert.Throws<ArgumentNullException>(nameof(options.UserInformationEndpoint), options.Validate);
104104
}
105105

106+
[Fact]
107+
public static void Validate_Dont_Throws_If_DetailedUserInformationEndpoint_Is_Null()
108+
{
109+
// Arrange
110+
var options = new EtsyAuthenticationOptions()
111+
{
112+
ClientId = "my-client-id",
113+
ClientSecret = "my-client-secret",
114+
DetailedUserInfoEndpoint = null!,
115+
};
116+
117+
// Act (no Assert)
118+
options.Validate();
119+
}
120+
106121
[Fact]
107122
public static void Validate_Throws_If_CallbackPath_Is_Null()
108123
{

test/AspNet.Security.OAuth.Providers.Tests/Etsy/bundle.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"$schema": "https://raw.githubusercontent.com/justeat/httpclient-interception/master/src/HttpClientInterception/Bundles/http-request-bundle-schema.json",
33
"items": [
44
{
5-
"comment": "Etsy OAuth 2.0 token exchange endpoint response - returns sample token values from Etsy API Docs",
6-
"uri": "https://api.etsy.com/v3/public/oauth/token",
5+
"comment": "Etsy OAuth 2.0 token exchange endpoint response - returns sample token values from Etsy API Docs (domain aligned to openapi.etsy.com to match provider defaults)",
6+
"uri": "https://openapi.etsy.com/v3/public/oauth/token",
77
"method": "POST",
88
"contentFormat": "json",
99
"contentJson": {
@@ -24,7 +24,7 @@
2424
},
2525
{
2626
"comment": "Etsy /v3/application/users/{user_id} endpoint - returns detailed user information",
27-
"uri": "https://openapi.etsy.com/v3/application/users/{0}",
27+
"uri": "https://openapi.etsy.com/v3/application/users/123456",
2828
"contentFormat": "json",
2929
"contentJson": {
3030
"user_id": 123456,

0 commit comments

Comments
 (0)