mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-25 22:17:51 +01:00
Merge pull request #1359 from tgstation/DMAPIDesc [TGSDeploy]
Make the DMAPI didn't validate error more descriptive
This commit is contained in:
+3
-3
@@ -3,10 +3,10 @@
|
||||
<!-- Integration tests will ensure they match across the board -->
|
||||
<Import Project="ControlPanelVersion.props" />
|
||||
<PropertyGroup>
|
||||
<TgsCoreVersion>4.16.1</TgsCoreVersion>
|
||||
<TgsCoreVersion>4.16.2</TgsCoreVersion>
|
||||
<TgsConfigVersion>4.1.0</TgsConfigVersion>
|
||||
<TgsApiVersion>9.3.0</TgsApiVersion>
|
||||
<TgsApiLibraryVersion>9.3.1</TgsApiLibraryVersion>
|
||||
<TgsApiVersion>9.3.1</TgsApiVersion>
|
||||
<TgsApiLibraryVersion>9.3.2</TgsApiLibraryVersion>
|
||||
<TgsClientVersion>10.4.1</TgsClientVersion>
|
||||
<TgsDmapiVersion>6.0.4</TgsDmapiVersion>
|
||||
<TgsInteropVersion>5.3.0</TgsInteropVersion>
|
||||
|
||||
@@ -327,7 +327,7 @@ namespace Tgstation.Server.Api.Models
|
||||
/// <summary>
|
||||
/// The DMAPI never validated itself
|
||||
/// </summary>
|
||||
[Description("DreamDaemon did not validate the DMAPI!")]
|
||||
[Description("DreamDaemon did not validate the DMAPI! This can occur if your world is encountering runtime errors during startup.")]
|
||||
DreamMakerNeverValidated,
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -91,6 +91,11 @@ namespace Tgstation.Server.Host.Controllers
|
||||
if (model.AccessUser == null ^ model.AccessToken == null)
|
||||
return BadRequest(ErrorCode.RepoMismatchUserAndAccessToken);
|
||||
|
||||
var userRights = (RepositoryRights)AuthenticationContext.GetRight(RightsType.Repository);
|
||||
if (((model.AccessUser ?? model.AccessToken) != null && !userRights.HasFlag(RepositoryRights.ChangeCredentials))
|
||||
|| ((model.CommitterEmail ?? model.CommitterName) != null && !userRights.HasFlag(RepositoryRights.ChangeCommitter)))
|
||||
return Forbid();
|
||||
|
||||
#pragma warning disable CS0618 // Support for obsolete API field
|
||||
model.UpdateSubmodules ??= model.RecurseSubmodules;
|
||||
#pragma warning restore CS0618
|
||||
@@ -107,7 +112,11 @@ namespace Tgstation.Server.Host.Controllers
|
||||
|
||||
currentModel.UpdateSubmodules = model.UpdateSubmodules ?? true;
|
||||
currentModel.AccessToken = model.AccessToken;
|
||||
currentModel.AccessUser = model.AccessUser; // intentionally only these fields, user not allowed to change anything else atm
|
||||
currentModel.AccessUser = model.AccessUser;
|
||||
|
||||
currentModel.CommitterEmail = model.CommitterEmail ?? currentModel.CommitterEmail;
|
||||
currentModel.CommitterName = model.CommitterName ?? currentModel.CommitterName;
|
||||
|
||||
var cloneBranch = model.Reference;
|
||||
var origin = model.Origin;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Castle.Core.Logging;
|
||||
using Castle.Core.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Moq;
|
||||
@@ -60,7 +60,7 @@ namespace Tgstation.Server.Tests.Instance
|
||||
};
|
||||
var test = await byondClient.SetActiveVersion(newModel, null, cancellationToken).ConfigureAwait(false);
|
||||
Assert.IsNotNull(test.InstallJob);
|
||||
await WaitForJob(test.InstallJob, 120, false, null, cancellationToken).ConfigureAwait(false);
|
||||
await WaitForJob(test.InstallJob, 180, false, null, cancellationToken).ConfigureAwait(false);
|
||||
var currentShit = await byondClient.ActiveVersion(cancellationToken).ConfigureAwait(false);
|
||||
Assert.AreEqual(newModel.Version.Semver(), currentShit.Version);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -193,6 +193,17 @@ namespace Tgstation.Server.Tests
|
||||
Assert.AreEqual(1, group.Users.Count);
|
||||
Assert.AreEqual(testUser2.Id, group.Users.First().Id);
|
||||
Assert.IsNotNull(group.PermissionSet);
|
||||
|
||||
testUserUpdate.Group = null;
|
||||
testUserUpdate.PermissionSet = new PermissionSet
|
||||
{
|
||||
AdministrationRights = RightsHelper.AllRights<AdministrationRights>(),
|
||||
InstanceManagerRights = RightsHelper.AllRights<InstanceManagerRights>(),
|
||||
};
|
||||
|
||||
testUser2 = await serverClient.Users.Update(testUserUpdate, cancellationToken);
|
||||
Assert.IsNull(testUser2.Group);
|
||||
Assert.IsNotNull(testUser2.PermissionSet);
|
||||
}
|
||||
|
||||
async Task TestCreateSysUser(CancellationToken cancellationToken)
|
||||
|
||||
Reference in New Issue
Block a user