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

cool#10630 doc electronic sign: moved esign settings out of UserPrivateInfo #10734

Merged
merged 2 commits into from
Dec 16, 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
19 changes: 9 additions & 10 deletions browser/src/control/Control.UIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1071,11 +1071,7 @@ L.Control.UIManager = L.Control.extend({
}

var userPrivateInfo = myViewData.userprivateinfo;
if (userPrivateInfo === undefined)
{
return;
}
if (window.zoteroEnabled) {
if (userPrivateInfo && window.zoteroEnabled) {
var apiKey = userPrivateInfo.ZoteroAPIKey;
if (apiKey !== undefined && !this.map.zotero) {
this.map.zotero = L.control.zotero(this.map);
Expand All @@ -1085,16 +1081,19 @@ L.Control.UIManager = L.Control.extend({
}
}
if (window.documentSigningEnabled) {
if (this.notebookbar) {
if (userPrivateInfo && this.notebookbar) {
const show = userPrivateInfo.SignatureCert && userPrivateInfo.SignatureKey;
// Show or hide the signature button on the notebookbar depending on if we
// have a signing cert/key specified.
this.showButton('signature', show);
}
const baseUrl = userPrivateInfo.ESignatureBaseUrl;
const clientId = userPrivateInfo.ESignatureClientId;
if (baseUrl !== undefined && !this.map.eSignature) {
this.map.eSignature = L.control.eSignature(baseUrl, clientId);
const serverPrivateInfo = myViewData.serverprivateinfo;
if (serverPrivateInfo) {
const baseUrl = serverPrivateInfo.ESignatureBaseUrl;
const clientId = serverPrivateInfo.ESignatureClientId;
if (baseUrl !== undefined && !this.map.eSignature) {
this.map.eSignature = L.control.eSignature(baseUrl, clientId);
}
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions common/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ void Session::parseDocOptions(const StringVector& tokens, int& part, std::string
_userPrivateInfo = Uri::decode(value);
++offset;
}
else if (name == "serverprivateinfo")
{
_serverPrivateInfo = Uri::decode(value);
++offset;
}
else if (name == "readonly")
{
_isReadOnly = value != "0";
Expand Down
7 changes: 7 additions & 0 deletions common/Session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ class Session : public MessageHandlerInterface

void setUserPrivateInfo(const std::string& userPrivateInfo) { _userPrivateInfo = userPrivateInfo; }

void setServerPrivateInfo(const std::string& serverPrivateInfo) { _serverPrivateInfo = serverPrivateInfo; }

void setUserName(const std::string& userName) { _userName = userName; }

const std::string& getUserName() const {return _userName; }
Expand Down Expand Up @@ -260,6 +262,8 @@ class Session : public MessageHandlerInterface

const std::string& getUserPrivateInfo() const { return _userPrivateInfo; }

const std::string& getServerPrivateInfo() const { return _serverPrivateInfo; }

const std::string& getDocURL() const { return _docURL; }

const std::string& getJailedFilePath() const { return _jailedFilePath; }
Expand Down Expand Up @@ -382,6 +386,9 @@ class Session : public MessageHandlerInterface
/// Private info per user, not shared with others.
std::string _userPrivateInfo;

/// Private info per server, shared with others.
std::string _serverPrivateInfo;

/// In case a watermark has to be rendered on each tile.
std::string _watermarkText;

Expand Down

This file was deleted.

7 changes: 7 additions & 0 deletions cypress_test/data/desktop/draw/esign.pdf.wopi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ServerPrivateInfo": {
"ESignatureBaseUrl": "https://test.eideasy.com",
"ESignatureSecret": "56RkLgZREDi1H0HZAvzOSAVlxu1Flx41",
"ESignatureClientId": "2IaeiZXbcKzlP1KvjZH9ghty2IJKM8Lg"
}
}

This file was deleted.

7 changes: 7 additions & 0 deletions cypress_test/data/desktop/writer/sign.odt.wopi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"UserPrivateInfo": {
"SignatureCert": "-----BEGIN CERTIFICATE-----\nMIIFGDCCAwCgAwIBAgICEAA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jD+bxGKkeBtYnieJpk7aMHh+DR4rkG7qfgcdzlaw5nEXZMbN\nJ5v1HNyN10JZRTWHAZUHkNJMf5/EruWTIOTQY8R2/ElGNVyVGo/4krXMdaOprUF6\nv3SgfBSAsfz08wjEc48NAmrQc+QIKB40sXquOAIm8FCt\n-----END CERTIFICATE-----\n"
}
}
2 changes: 1 addition & 1 deletion cypress_test/integration_tests/common/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function setupDocument(filePath, copyCertificates = false) {

copyFile(filePath, newFilePath);
if (copyCertificates) {
const suffix = '.user-private-info.json';
const suffix = '.wopi.json';
copyFile(filePath + suffix, newFilePath + suffix);
}
}
Expand Down
Loading
Loading