Skip to content

Commit b19991c

Browse files
authored
Merge pull request #31 from Authress/invite-statements
Fix usage of invite statements.
2 parents fe4dd44 + 8080af4 commit b19991c

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This is the changelog for [Authress SDK](readme.md).
1010
## 1.5 ##
1111
* Fix `DateTimeOffset` type assignments, properties that were incorrectly defined as `DateTime` are now correctly `DateTimeOffsets`.
1212
* Add in `VerifyToken()` method to `AuthressClient`..
13+
* Fix `Invite` Statement usage to use dedicated InviteStatement.
1314

1415
## 1.4 ##
1516
* Support exponential back-off retries on unexpected failures.

src/Authress.SDK/Model/AccessRecordStatements.cs

+16
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,21 @@ public class AccessRecordStatements
2323
[DataMember(Name = "resources", EmitDefaultValue = false)]
2424
[JsonProperty(PropertyName = "resources")]
2525
public List<AccessRecordResource> Resources { get; set; }
26+
27+
/// <summary>
28+
/// The list of users this record statement applies to
29+
/// </summary>
30+
/// <value>The list of users this record statement applies to</value>
31+
[DataMember(Name = "users", EmitDefaultValue = false)]
32+
[JsonProperty(PropertyName = "users")]
33+
public List<AccessRecordUsers> Users { get; set; }
34+
35+
/// <summary>
36+
/// The list of groups this record statement applies to. Users in these groups will be receive access to the resources listed.
37+
/// </summary>
38+
/// <value>The list of groups this record statement applies to. Users in these groups will be receive access to the resources listed.</value>
39+
[DataMember(Name = "groups", EmitDefaultValue = false)]
40+
[JsonProperty(PropertyName = "groups")]
41+
public List<AccessRecordGroup> Groups { get; set; } = new List<AccessRecordGroup>();
2642
}
2743
}

src/Authress.SDK/Model/Invite.cs

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using System.Runtime.Serialization;
3+
using Newtonsoft.Json;
34

45
namespace Authress.SDK.DTO
56
{
@@ -16,17 +17,45 @@ public class Invite
1617
[DataMember(Name="inviteId", EmitDefaultValue=false)]
1718
public string InviteId { get; private set; }
1819

20+
/// <summary>
21+
/// Specify the tenant associated with the invite. The invited user must use this tenant's connection configuration to log in.
22+
/// </summary>
23+
/// <value>Specify the tenant associated with the invite. The invited user must use this tenant's connection configuration to log in.</value>
24+
[DataMember(Name="tenantId", EmitDefaultValue=false)]
25+
public string TenantId { get; private set; }
26+
1927
/// <summary>
2028
/// A list of statements which match roles to resources. The invited user will all statements apply to them
2129
/// </summary>
2230
/// <value>A list of statements which match roles to resources. The invited user will all statements apply to them</value>
2331
[DataMember(Name="statements", EmitDefaultValue=false)]
24-
public List<AccessRecordStatements> Statements { get; set; }
32+
public List<InviteStatement> Statements { get; set; }
2533

2634
/// <summary>
2735
/// Gets or Sets Links
2836
/// </summary>
2937
[DataMember(Name="links", EmitDefaultValue=false)]
3038
public Links Links { get; set; }
3139
}
40+
41+
/// <summary>
42+
///
43+
/// </summary>
44+
[DataContract]
45+
public class InviteStatement
46+
{
47+
/// <summary>
48+
/// Gets or Sets Roles
49+
/// </summary>
50+
[DataMember(Name = "roles", EmitDefaultValue = false)]
51+
[JsonProperty(PropertyName = "roles")]
52+
public List<string> Roles { get; set; }
53+
54+
/// <summary>
55+
/// Gets or Sets Resources
56+
/// </summary>
57+
[DataMember(Name = "resources", EmitDefaultValue = false)]
58+
[JsonProperty(PropertyName = "resources")]
59+
public List<AccessRecordResource> Resources { get; set; }
60+
}
3261
}

0 commit comments

Comments
 (0)