Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of invite statements. #31

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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; }
}
}
Loading