Skip to content

Commit

Permalink
Merge branch 'main' of github.com:panoramicdata/LogicMonitor.Api
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnmbond committed Mar 6, 2024
2 parents c7d75c6 + f50e01c commit 9bda683
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 8 deletions.
8 changes: 4 additions & 4 deletions LogicMonitor.Api.Test/LogicMonitor.Api.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<PackageReference Include="Divergic.Logging.Xunit" Version="4.3.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.29.0">
<PackageReference Include="FluentAssertions.Analyzers" Version="0.30.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -24,10 +24,10 @@
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.2" />
<PackageReference Include="xunit" Version="2.6.5" />
<PackageReference Include="xunit.analyzers" Version="1.9.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.analyzers" Version="1.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
13 changes: 13 additions & 0 deletions LogicMonitor.Api.Test/Users/UserTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace LogicMonitor.Api.Test.Users;

public class UserTests(ITestOutputHelper iTestOutputHelper) : TestWithOutput(iTestOutputHelper)
{
[Fact]
public async Task GetAll()
{
var users = await LogicMonitorClient.GetAllAsync<User>(default).ConfigureAwait(true);

users.Should().NotBeNull();
users.Should().NotBeNullOrEmpty();
}
}
2 changes: 1 addition & 1 deletion LogicMonitor.Api/LogicMonitor.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<!-- Update the following before releasing to nuget -->
<PackageReleaseNotes>
Added logicMonitorClient.GetAllAsync() support for ApiTokens.
Added missing properties on various user-related objects.
</PackageReleaseNotes>
<UserSecretsId>57aaa0e7-815d-4065-9339-f3f070bed01e</UserSecretsId>

Expand Down
8 changes: 7 additions & 1 deletion LogicMonitor.Api/Users/PrivilegeObjectType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,11 @@ public enum PrivilegeObjectType
/// Dexda
/// </summary>
[DataMember(Name = "dexda")]
Dexda
Dexda,

/// <summary>
/// Module
/// </summary>
[DataMember(Name = "module")]
Module
}
8 changes: 7 additions & 1 deletion LogicMonitor.Api/Users/RolePrivilegeOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,11 @@ public enum RolePrivilegeOperation
/// NoPrivilege
/// </summary>
[EnumMember(Value = "noprivilege")]
NoPrivilege
NoPrivilege,

/// <summary>
/// Install
/// </summary>
[EnumMember(Value = "install")]
Install
}
6 changes: 6 additions & 0 deletions LogicMonitor.Api/Users/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ public class User : IdentifiedItem, IHasEndpoint
[IgnoreDataMember]
public DateTime? LastActionOnUtc => LastActionOnSeconds.ToNullableDateTimeUtc();

/// <summary>
/// Whether they should be forced to logout immediately
/// </summary>
[DataMember(Name = "immediateForceLogout")]
public bool ImmediateForceLogout { get; set; }

/// <summary>
/// The endpoint
/// </summary>
Expand Down
9 changes: 8 additions & 1 deletion LogicMonitor.Api/Users/ViewPermission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public class ViewPermission
[DataMember(Name = "Traces")]
public bool Traces { get; set; }

/// <summary>
/// Modules
/// </summary>
[DataMember(Name = "Modules")]
public bool Modules { get; set; }

/// <inheritdoc />
public override string ToString() =>
$"{nameof(Dashboards)}={Dashboards};" +
Expand All @@ -95,5 +101,6 @@ public override string ToString() =>
$"{nameof(Alerts)}={Alerts};" +
$"{nameof(Maps)}={Maps};" +
$"{nameof(Logs)}={Logs};" +
$"{nameof(Traces)}={Traces};";
$"{nameof(Traces)}={Traces};" +
$"{nameof(Modules)}={Modules};";
}

0 comments on commit 9bda683

Please sign in to comment.