Skip to content

Commit 39394c9

Browse files
Merge pull request #1617 from TransactionProcessing/task/#1606_update_shared_nugets
Task/#1606 update shared nugets
2 parents 22e8dc3 + 6416b7a commit 39394c9

11 files changed

Lines changed: 29 additions & 207 deletions

File tree

SecurityService.Client/SecurityServiceClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public async Task<Result> CreateRole(CreateRoleRequest createRoleRequest,
162162
catch(Exception ex)
163163
{
164164
// An exception has occurred, add some additional information to the message
165-
Exception exception = new Exception($"Error creating role {createRoleRequest.Name}.", ex);
165+
Exception exception = new Exception($"Error creating role {createRoleRequest.RoleName}.", ex);
166166

167167
throw exception;
168168
}
Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,170 +1,93 @@
1-
using System.Text.Json.Serialization;
2-
using Newtonsoft.Json;
3-
41
namespace SecurityService.DataTransferObjects;
52

63
public sealed class CreateClientRequest
74
{
8-
[JsonProperty("client_id")]
9-
[JsonPropertyName("client_id")]
105
public string ClientId { get; set; } = string.Empty;
116

12-
[JsonPropertyName("secret")]
137
public string? Secret { get; set; }
148

15-
[JsonProperty("client_name")]
16-
[JsonPropertyName("client_name")]
179
public string ClientName { get; set; } = string.Empty;
1810

19-
[JsonProperty("client_description")]
20-
[JsonPropertyName("client_description")]
2111
public string? ClientDescription { get; set; }
2212

23-
[JsonProperty("allowed_scopes")]
24-
[JsonPropertyName("allowed_scopes")]
2513
public List<string> AllowedScopes { get; set; } = new();
2614

27-
[JsonProperty("allowed_grant_types")]
28-
[JsonPropertyName("allowed_grant_types")]
2915
public List<string> AllowedGrantTypes { get; set; } = new();
3016

31-
[JsonProperty("client_uri")]
32-
[JsonPropertyName("client_uri")]
3317
public string? ClientUri { get; set; }
3418

35-
[JsonProperty("client_redirect_uris")]
36-
[JsonPropertyName("client_redirect_uris")]
3719
public List<string> ClientRedirectUris { get; set; } = new();
3820

39-
[JsonProperty("client_post_logout_redirect_uris")]
40-
[JsonPropertyName("client_post_logout_redirect_uris")]
4121
public List<string> ClientPostLogoutRedirectUris { get; set; } = new();
4222

43-
[JsonProperty("require_consent")]
44-
[JsonPropertyName("require_consent")]
4523
public bool RequireConsent { get; set; }
4624

47-
[JsonProperty("allow_offline_access")]
48-
[JsonPropertyName("allow_offline_access")]
4925
public bool AllowOfflineAccess { get; set; }
5026
}
5127

5228
public sealed class CreateApiScopeRequest
5329
{
54-
[JsonProperty("name")]
55-
[JsonPropertyName("name")]
5630
public string Name { get; set; } = string.Empty;
5731

58-
[JsonProperty("display_name")]
59-
[JsonPropertyName("display_name")]
6032
public string? DisplayName { get; set; }
6133

62-
[JsonProperty("description")]
63-
[JsonPropertyName("description")]
6434
public string? Description { get; set; }
6535
}
6636

6737
public sealed class CreateApiResourceRequest
6838
{
69-
[JsonProperty("name")]
70-
[JsonPropertyName("name")]
7139
public string Name { get; set; } = string.Empty;
7240

73-
[JsonProperty("display_name")]
74-
[JsonPropertyName("display_name")]
7541
public string? DisplayName { get; set; }
7642

77-
[JsonProperty("description")]
78-
[JsonPropertyName("description")]
7943
public string? Description { get; set; }
8044

81-
[JsonProperty("secret")]
82-
[JsonPropertyName("secret")]
8345
public string? Secret { get; set; }
8446

85-
[JsonProperty("scopes")]
86-
[JsonPropertyName("scopes")]
8747
public List<string> Scopes { get; set; } = new();
8848

89-
[JsonProperty("user_claims")]
90-
[JsonPropertyName("user_claims")]
9149
public List<string> UserClaims { get; set; } = new();
9250
}
9351

9452
public sealed class CreateIdentityResourceRequest
9553
{
96-
[JsonProperty("name")]
97-
[JsonPropertyName("name")]
9854
public string Name { get; set; } = string.Empty;
99-
100-
[JsonProperty("display_name")]
101-
[JsonPropertyName("display_name")]
10255
public string? DisplayName { get; set; }
10356

104-
[JsonProperty("description")]
105-
[JsonPropertyName("description")]
10657
public string? Description { get; set; }
10758

108-
[JsonProperty("required")]
109-
[JsonPropertyName("required")]
11059
public bool Required { get; set; }
11160

112-
[JsonProperty("emphasize")]
113-
[JsonPropertyName("emphasize")]
11461
public bool Emphasize { get; set; }
11562

116-
[JsonProperty("show_in_discovery_document")]
117-
[JsonPropertyName("show_in_discovery_document")]
11863
public bool ShowInDiscoveryDocument { get; set; } = true;
11964

120-
[JsonProperty("claims")]
121-
[JsonPropertyName("claims")]
12265
public List<string> Claims { get; set; } = new();
12366
}
12467

12568
public sealed class CreateRoleRequest
12669
{
127-
[JsonProperty("role_name")]
128-
[JsonPropertyName("role_name")]
129-
public string Name { get; set; } = string.Empty;
70+
public string RoleName { get; set; } = string.Empty;
13071
}
13172

13273
public sealed class CreateUserRequest
13374
{
134-
[JsonProperty("given_name")]
135-
[JsonPropertyName("given_name")]
13675
public string? GivenName { get; set; }
13776

138-
[JsonProperty("middle_name")]
139-
[JsonPropertyName("middle_name")]
14077
public string? MiddleName { get; set; }
14178

142-
[JsonProperty("family_name")]
143-
[JsonPropertyName("family_name")]
14479
public string? FamilyName { get; set; }
14580

146-
[JsonProperty("user_name")]
147-
[JsonPropertyName("user_name")]
14881
public string UserName { get; set; } = string.Empty;
14982

150-
[JsonProperty("password")]
151-
[JsonPropertyName("password")]
15283
public string Password { get; set; } = string.Empty;
15384

154-
[JsonProperty("email_address")]
155-
[JsonPropertyName("email_address")]
15685
public string? EmailAddress { get; set; }
15786

158-
[JsonProperty("phone_number")]
159-
[JsonPropertyName("phone_number")]
16087
public string? PhoneNumber { get; set; }
16188

162-
[JsonProperty("claims")]
163-
[JsonPropertyName("claims")]
16489
public Dictionary<string, string> Claims { get; set; } = new();
16590

166-
[JsonProperty("roles")]
167-
[JsonPropertyName("roles")]
16891
public List<string> Roles { get; set; } = new();
16992
}
17093

SecurityService.DataTransferObjects/Responses.cs

Lines changed: 4 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -4,203 +4,102 @@
44
namespace SecurityService.DataTransferObjects;
55

66
public sealed class ApiResourceResponse {
7-
[JsonProperty("name")]
8-
[JsonPropertyName("name")]
97
public string Name { get; set; }
108

11-
[JsonProperty("display_name")]
12-
[JsonPropertyName("display_name")]
139
public string? DisplayName { get; set; }
1410

15-
[JsonProperty("description")]
16-
[JsonPropertyName("description")]
1711
public string? Description { get; set; }
1812

19-
[JsonProperty("scopes")]
20-
[JsonPropertyName("scopes")]
2113
public IReadOnlyCollection<string> Scopes { get; set; }
2214

23-
[JsonProperty("user_claims")]
24-
[JsonPropertyName("user_claims")]
2515
public IReadOnlyCollection<string> UserClaims { get; set; }
2616
}
2717

2818
public sealed record ApiScopeResponse {
29-
[JsonProperty("name")]
30-
[JsonPropertyName("name")]
3119
public string Name { get; set; }
3220

33-
[JsonProperty("display_name")]
34-
[JsonPropertyName("display_name")]
3521
public string? DisplayName { get; set; }
3622

37-
[JsonProperty("description")]
38-
[JsonPropertyName("description")]
3923
public string? Description { get; set; }
4024
}
4125

4226
public sealed record ClientResponse {
43-
[JsonProperty("client_id")]
44-
[JsonPropertyName("client_id")]
4527
public string ClientId { get; set; }
46-
[JsonProperty("client_name")]
47-
[JsonPropertyName("client_name")]
28+
4829
public string ClientName { get; set; }
4930

50-
[JsonProperty("client_description")]
51-
[JsonPropertyName("client_description")]
5231
public string? Description { get; set; }
5332

54-
[JsonProperty("client_uri")]
55-
[JsonPropertyName("client_uri")]
5633
public string? ClientUri { get; set; }
5734

58-
[JsonProperty("allowed_scopes")]
59-
[JsonPropertyName("allowed_scopes")]
6035
public IReadOnlyCollection<string> AllowedScopes { get; set; }
6136

62-
[JsonProperty("allowed_grant_types")]
63-
[JsonPropertyName("allowed_grant_types")]
6437
public IReadOnlyCollection<string> AllowedGrantTypes { get; set; }
6538

66-
[JsonProperty("client_redirect_uris")]
67-
[JsonPropertyName("client_redirect_uris")]
68-
public IReadOnlyCollection<string> RedirectUris { get; set; }
39+
public IReadOnlyCollection<string> ClientRedirectUris { get; set; }
6940

70-
[JsonProperty("client_post_logout_redirect_uris")]
71-
[JsonPropertyName("client_post_logout_redirect_uris")]
72-
public IReadOnlyCollection<string> PostLogoutRedirectUris { get; set; }
41+
public IReadOnlyCollection<string> ClientPostLogoutRedirectUris { get; set; }
7342

74-
[JsonProperty("require_consent")]
75-
[JsonPropertyName("require_consent")]
7643
public bool RequireConsent { get; set; }
7744

78-
[JsonProperty("allow_offline_access")]
79-
[JsonPropertyName("allow_offline_access")]
8045
public bool AllowOfflineAccess { get; set; }
8146

82-
[JsonProperty("client_type")]
83-
[JsonPropertyName("client_type")]
8447
public string ClientType { get; set; }
8548
}
8649

8750
public sealed record IdentityResourceResponse
8851
{
89-
[JsonProperty("name")]
90-
[JsonPropertyName("name")]
9152
public string Name { get; set; }
9253

93-
[JsonProperty("display_name")]
94-
[JsonPropertyName("display_name")]
9554
public string? DisplayName { get; set; }
9655

97-
[JsonProperty("description")]
98-
[JsonPropertyName("description")]
9956
public string? Description { get; set; }
10057

101-
[JsonProperty("required")]
102-
[JsonPropertyName("required")]
10358
public bool Required { get; set; }
10459

105-
[JsonProperty("emphasize")]
106-
[JsonPropertyName("emphasize")]
10760
public bool Emphasize { get; set; }
10861

109-
[JsonProperty("show_in_discovery_document")]
110-
[JsonPropertyName("show_in_discovery_document")]
11162
public bool ShowInDiscoveryDocument { get; set; }
11263

113-
[JsonProperty("claims")]
114-
[JsonPropertyName("claims")]
11564
public IReadOnlyCollection<string> Claims { get; set; }
11665
}
11766

11867

11968
public sealed record RoleResponse
12069
{
121-
[JsonProperty("role_id")]
122-
[JsonPropertyName("role_id")]
12370
public String RoleId { get; set; }
124-
125-
[JsonProperty("role_name")]
126-
[JsonPropertyName("role_name")]
127-
public string Name { get; set; }
71+
public string RoleName { get; set; }
12872
}
12973

13074
public sealed record UserResponse {
131-
[JsonProperty("user_id")]
132-
[JsonPropertyName("user_id")]
13375
public String UserId { get; set; }
13476

135-
[JsonProperty("user_name")]
136-
[JsonPropertyName("user_name")]
13777
public string UserName { get; set; }
13878

139-
[JsonProperty("email_address")]
140-
[JsonPropertyName("email_address")]
14179
public string? EmailAddress { get; set; }
14280

143-
[JsonProperty("phone_number")]
144-
[JsonPropertyName("phone_number")]
14581
public string? PhoneNumber { get; set; }
14682

147-
[JsonProperty("given_name")]
148-
[JsonPropertyName("given_name")]
14983
public string? GivenName { get; set; }
15084

151-
[JsonProperty("middle_name")]
152-
[JsonPropertyName("middle_name")]
15385
public string? MiddleName { get; set; }
15486

155-
[JsonProperty("family_name")]
156-
[JsonPropertyName("family_name")]
15787
public string? FamilyName { get; set; }
15888

159-
[JsonProperty("claims")]
160-
[JsonPropertyName("claims")]
16189
public IReadOnlyDictionary<string, string> Claims{ get; set; }
16290

163-
[JsonProperty("roles")]
164-
[JsonPropertyName("roles")]
16591
public IReadOnlyCollection<string> Roles { get; set; }
16692

167-
[JsonProperty("registration_date_time")]
168-
[JsonPropertyName("registration_date_time")]
16993
public DateTime RegistrationDateTime { get; set; }
17094
}
17195

17296
public class TokenResponse
17397
{
174-
/// <summary>
175-
/// The access token
176-
/// </summary>
177-
/// <value>The access token.</value>
17898
public String AccessToken { get; private set; }
179-
180-
/// <summary>
181-
/// Gets the expires.
182-
/// </summary>
183-
/// <value>The expires.</value>
18499
public DateTimeOffset Expires { get; private set; }
185-
186-
/// <summary>
187-
/// The expires
188-
/// </summary>
189-
/// <value>The expires in.</value>
190100
public Int64 ExpiresIn { get; private set; }
191-
192-
/// <summary>
193-
/// Gets the issued.
194-
/// </summary>
195-
/// <value>The issued.</value>
196101
public DateTimeOffset Issued { get; private set; }
197-
198-
/// <summary>
199-
/// The refresh token
200-
/// </summary>
201-
/// <value>The refresh token.</value>
202102
public String RefreshToken { get; private set; }
203-
204103
public static TokenResponse Create(String token)
205104
{
206105
dynamic auth = JsonConvert.DeserializeObject(token);

0 commit comments

Comments
 (0)