Skip to content

Commit

Permalink
Merge branch 'develop' into component-tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeySafronov committed Dec 27, 2021
2 parents f3ec8d4 + 5e088d3 commit a3e1d16
Show file tree
Hide file tree
Showing 29 changed files with 1,400 additions and 1,462 deletions.
8 changes: 4 additions & 4 deletions build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pipeline {
}
stage('Backend') {
steps {
sh 'dotnet build -c Release ASC.Web.sln'
sh 'dotnet build -c Release ASC.Web.slnf'
}
}
}
Expand All @@ -28,7 +28,7 @@ pipeline {
}
stage('Backend') {
steps {
bat 'dotnet build -c Release ASC.Web.sln'
bat 'dotnet build -c Release ASC.Web.slnf'
}
}
}
Expand Down Expand Up @@ -62,7 +62,7 @@ pipeline {
}
stage('Files') {
steps {
sh "git submodule update --progress --init -- products/ASC.Files/Server/DocStore && dotnet build ASC.Web.sln && cd ${env.WORKSPACE}/products/ASC.Files/Tests/ && dotnet test ASC.Files.Tests.csproj -r linux-x64 -l \"console;verbosity=detailed\""
sh "git submodule update --progress --init -- products/ASC.Files/Server/DocStore && dotnet build ASC.Web.slnf && cd ${env.WORKSPACE}/products/ASC.Files/Tests/ && dotnet test ASC.Files.Tests.csproj -r linux-x64 -l \"console;verbosity=detailed\""
}
}
}
Expand Down Expand Up @@ -90,7 +90,7 @@ pipeline {
}
stage('Files') {
steps {
bat "git submodule update --progress --init -- products\\ASC.Files\\Server\\DocStore && dotnet build ASC.Web.sln && cd ${env.WORKSPACE}\\products\\ASC.Files\\Tests\\ && dotnet test ASC.Files.Tests.csproj"
bat "git submodule update --progress --init -- products\\ASC.Files\\Server\\DocStore && dotnet build ASC.Web.slnf && cd ${env.WORKSPACE}\\products\\ASC.Files\\Tests\\ && dotnet test ASC.Files.Tests.csproj"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions build/install/docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ELK_VERSION=7.13.1
SERVICE_PORT=5050
CONTAINER_PREFIX=${PRODUCT}-
DOCUMENT_SERVER_IMAGE_NAME=onlyoffice/4testing-documentserver-ee:latest
DOCKER_TAG=latest
DOCKERFILE=Dockerfile.app

Expand Down
2 changes: 1 addition & 1 deletion build/install/docker/ds.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.6'
services:
onlyoffice-document-server:
image: "${REPO}/${STATUS}documentserver:latest"
image: "${DOCUMENT_SERVER_IMAGE_NAME}"
container_name: ${DOCUMENT_SERVER_HOST}
# Strings below enable the JSON Web Token validation.
environment:
Expand Down
16 changes: 9 additions & 7 deletions common/ASC.Api.Core/Middleware/WebhooksGlobalFilterAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ public override void OnResultExecuted(ResultExecutedContext context)
base.OnResultExecuted(context);
return;
}

var result = (ObjectResult)context.Result;
var resultContent = JsonSerializer.Serialize(result.Value, jsonSerializerOptions);

var eventName = $"method: {method}, route: {routePattern}";

WebhookPublisher.Publish(eventName, resultContent);

if (context.Result is ObjectResult objectResult)
{
var resultContent = JsonSerializer.Serialize(objectResult.Value, jsonSerializerOptions);

var eventName = $"method: {method}, route: {routePattern}";

WebhookPublisher.Publish(eventName, resultContent);
}

base.OnResultExecuted(context);
}
Expand Down
31 changes: 12 additions & 19 deletions common/ASC.Common/Security/Cryptography/InstanceCrypto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ namespace ASC.Security.Cryptography
[Singletone]
public class InstanceCrypto
{
private MachinePseudoKeys MachinePseudoKeys { get; }
private byte[] EKey { get; }

public InstanceCrypto(MachinePseudoKeys machinePseudoKeys)
{
MachinePseudoKeys = machinePseudoKeys;
EKey = machinePseudoKeys.GetMachineConstant(32);
}

public string Encrypt(string data)
Expand All @@ -50,8 +50,8 @@ public string Encrypt(string data)

public byte[] Encrypt(byte[] data)
{
var hasher = Aes.Create();
hasher.Key = EKey();
using var hasher = Aes.Create();
hasher.Key = EKey;
hasher.IV = new byte[hasher.BlockSize >> 3];

using var ms = new MemoryStream();
Expand All @@ -70,24 +70,17 @@ public string Decrypt(string data)

public string Decrypt(byte[] data)
{
var hasher = Aes.Create();
hasher.Key = EKey();
using var hasher = Aes.Create();
hasher.Key = EKey;
hasher.IV = new byte[hasher.BlockSize >> 3];

using (MemoryStream msDecrypt = new MemoryStream(data))
using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, hasher.CreateDecryptor(), CryptoStreamMode.Read))
using (StreamReader srDecrypt = new StreamReader(csDecrypt))
{
using var msDecrypt = new MemoryStream(data);
using var csDecrypt = new CryptoStream(msDecrypt, hasher.CreateDecryptor(), CryptoStreamMode.Read);
using var srDecrypt = new StreamReader(csDecrypt);

// Read the decrypted bytes from the decrypting stream
// and place them in a string.
return srDecrypt.ReadToEnd();
}
}

private byte[] EKey()
{
return MachinePseudoKeys.GetMachineConstant(32);
// Read the decrypted bytes from the decrypting stream
// and place them in a string.
return srDecrypt.ReadToEnd();
}
}
}

0 comments on commit a3e1d16

Please sign in to comment.