Skip to content

Commit

Permalink
Merge pull request #31 from Authress/invite-statements
Browse files Browse the repository at this point in the history
Fix usage of invite statements.
  • Loading branch information
wparad authored Feb 14, 2024
2 parents fe4dd44 + 8080af4 commit b19991c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This is the changelog for [Authress SDK](readme.md).
## 1.5 ##
* Fix `DateTimeOffset` type assignments, properties that were incorrectly defined as `DateTime` are now correctly `DateTimeOffsets`.
* Add in `VerifyToken()` method to `AuthressClient`..
* Fix `Invite` Statement usage to use dedicated InviteStatement.

## 1.4 ##
* Support exponential back-off retries on unexpected failures.
Expand Down
16 changes: 16 additions & 0 deletions src/Authress.SDK/Model/AccessRecordStatements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,21 @@ public class AccessRecordStatements
[DataMember(Name = "resources", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "resources")]
public List<AccessRecordResource> Resources { get; set; }

/// <summary>
/// The list of users this record statement applies to
/// </summary>
/// <value>The list of users this record statement applies to</value>
[DataMember(Name = "users", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "users")]
public List<AccessRecordUsers> Users { get; set; }

/// <summary>
/// The list of groups this record statement applies to. Users in these groups will be receive access to the resources listed.
/// </summary>
/// <value>The list of groups this record statement applies to. Users in these groups will be receive access to the resources listed.</value>
[DataMember(Name = "groups", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "groups")]
public List<AccessRecordGroup> Groups { get; set; } = new List<AccessRecordGroup>();
}
}
31 changes: 30 additions & 1 deletion src/Authress.SDK/Model/Invite.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;

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

/// <summary>
/// Specify the tenant associated with the invite. The invited user must use this tenant's connection configuration to log in.
/// </summary>
/// <value>Specify the tenant associated with the invite. The invited user must use this tenant's connection configuration to log in.</value>
[DataMember(Name="tenantId", EmitDefaultValue=false)]
public string TenantId { get; private set; }

/// <summary>
/// A list of statements which match roles to resources. The invited user will all statements apply to them
/// </summary>
/// <value>A list of statements which match roles to resources. The invited user will all statements apply to them</value>
[DataMember(Name="statements", EmitDefaultValue=false)]
public List<AccessRecordStatements> Statements { get; set; }
public List<InviteStatement> Statements { get; set; }

/// <summary>
/// Gets or Sets Links
/// </summary>
[DataMember(Name="links", EmitDefaultValue=false)]
public Links Links { get; set; }
}

/// <summary>
///
/// </summary>
[DataContract]
public class InviteStatement
{
/// <summary>
/// Gets or Sets Roles
/// </summary>
[DataMember(Name = "roles", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "roles")]
public List<string> Roles { get; set; }

/// <summary>
/// Gets or Sets Resources
/// </summary>
[DataMember(Name = "resources", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "resources")]
public List<AccessRecordResource> Resources { get; set; }
}
}

0 comments on commit b19991c

Please sign in to comment.