stable

Clone or download

Read-only

refactor: tie save token to a specific server

Follow-up to git #tuleap/stable/903399279500ac84c08646a4c34467d89dbf49f8 No everytime a user open a document in OO, the save token is linked to a server_id. This will allow later (when we will have more than one sever) to use the right key to verify the JWT. In order to not invalidate existing sessions during the platform upgrade, their token is not linked to a given server and in this case we will take the first server like before. This behavior should be removed after a bunch of releases to let time to admin to upgrade their platform. Part of story #29981: restrict an OnlyOffice server to some projects only Change-Id: Ibfb5072a39d59a52ee2d80fb94158b5d59f1f1bc

Modified Files

Name
M plugins/onlyoffice/db/install.sql +2 −1 Go to diff View file
A plugins/onlyoffice/db/mysql/2022/202212161400_add_server_id_to_save_token.php +38 −0 Go to diff View file
M plugins/onlyoffice/include/DocumentServer/DocumentServerDao.php +13 −0 Go to diff View file
A plugins/onlyoffice/include/DocumentServer/DocumentServerNotFoundException.php +27 −0 Go to diff View file
M plugins/onlyoffice/include/DocumentServer/IRetrieveDocumentServers.php +5 −0 Go to diff View file
A plugins/onlyoffice/include/Save/DocumentServerForSaveDocumentTokenRetriever.php +70 −0 Go to diff View file
A plugins/onlyoffice/include/Save/DocumentServerHasNoExistingSecretException.php +27 −0 Go to diff View file
A plugins/onlyoffice/include/Save/NoDocumentServerException.php +27 −0 Go to diff View file
M plugins/onlyoffice/include/Save/OnlyOfficeCallbackResponseJWTParser.php +99 −33 Go to diff View file
M plugins/onlyoffice/include/Save/OnlyOfficeCallbackResponseParser.php +4 −1 Go to diff View file
M plugins/onlyoffice/include/Save/OnlyOfficeSaveController.php +1 −1 Go to diff View file
M plugins/onlyoffice/include/Save/OnlyOfficeSaveDocumentTokenDAO.php +10 −4 Go to diff View file
M plugins/onlyoffice/include/Save/OnlyOfficeSaveDocumentTokenGeneratorDBStore.php +1 −0 Go to diff View file
M plugins/onlyoffice/include/Save/OnlyOfficeSaveDocumentTokenVerifier.php +1 −1 Go to diff View file
M plugins/onlyoffice/include/Save/SaveDocumentTokenData.php +1 −1 Go to diff View file
M plugins/onlyoffice/include/onlyofficePlugin.php +2 −1 Go to diff View file
M plugins/onlyoffice/tests/integration/DocumentServer/DocumentServerDaoTest.php +4 −0 Go to diff View file
M plugins/onlyoffice/tests/integration/Save/OnlyOfficeSaveDocumentTokenDAOTest.php +7 −4 Go to diff View file
A plugins/onlyoffice/tests/unit/Save/DocumentServerForSaveDocumentTokenRetrieverTest.php +128 −0 Go to diff View file
M plugins/onlyoffice/tests/unit/Save/OnlyOfficeCallbackDocumentSaverTest.php +11 −11 Go to diff View file
M plugins/onlyoffice/tests/unit/Save/OnlyOfficeCallbackResponseJWTParserTest.php +92 −20 Go to diff View file
M plugins/onlyoffice/tests/unit/Save/OnlyOfficeSaveControllerTest.php +20 −9 Go to diff View file
M plugins/onlyoffice/tests/unit/Save/OnlyOfficeSaveDocumentTokenGeneratorDBStoreTest.php +1 −1 Go to diff View file
M plugins/onlyoffice/tests/unit/Save/OnlyOfficeSaveDocumentTokenRefresherDBStoreTest.php +1 −1 Go to diff View file
M plugins/onlyoffice/tests/unit/Save/OnlyOfficeSaveDocumentTokenVerifierTest.php +15 −3 Go to diff View file
M plugins/onlyoffice/tests/unit/Stubs/IRetrieveDocumentServersStub.php +12 −0 Go to diff View file