From 6a2e433d0b4ea3d01684d22d9c09f42e9d2e84d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 15 Jan 2025 10:43:02 +0100 Subject: [PATCH] collaboration test urls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- services/collaboration/pkg/config/wopi.go | 2 +- .../pkg/connector/fileconnector_test.go | 70 +++++++++---------- .../pkg/helpers/discovery_test.go | 46 ++++++------ .../collaboration/pkg/proofkeys/handler.go | 2 +- .../pkg/service/grpc/v0/service_test.go | 56 +++++++-------- 5 files changed, 88 insertions(+), 88 deletions(-) diff --git a/services/collaboration/pkg/config/wopi.go b/services/collaboration/pkg/config/wopi.go index 9a428a581..8888f22e0 100644 --- a/services/collaboration/pkg/config/wopi.go +++ b/services/collaboration/pkg/config/wopi.go @@ -2,7 +2,7 @@ package config // Wopi defines the available configuration for the WOPI endpoint. type Wopi struct { - WopiSrc string `yaml:"wopisrc" env:"COLLABORATION_WOPI_SRC" desc:"The WOPI source base URL containing schema, host and port. Set this to the schema and domain where the collaboration service is reachable for the wopi app, such as https://office.owncloud.test." introductionVersion:"6.0.0"` + WopiSrc string `yaml:"wopisrc" env:"COLLABORATION_WOPI_SRC" desc:"The WOPI source base URL containing schema, host and port. Set this to the schema and domain where the collaboration service is reachable for the wopi app, such as https://office.example.test." introductionVersion:"6.0.0"` Secret string `yaml:"secret" env:"COLLABORATION_WOPI_SECRET" desc:"Used to mint and verify WOPI JWT tokens and encrypt and decrypt the REVA JWT token embedded in the WOPI JWT token." introductionVersion:"6.0.0"` DisableChat bool `yaml:"disable_chat" env:"COLLABORATION_WOPI_DISABLE_CHAT;OC_WOPI_DISABLE_CHAT" desc:"Disable chat in the office web frontend. This feature applies to OnlyOffice and Microsoft." introductionVersion:"7.0.0"` ProxyURL string `yaml:"proxy_url" env:"COLLABORATION_WOPI_PROXY_URL" desc:"The URL to the ownCloud Office365 WOPI proxy. Optional. To use this feature, you need an office365 proxy subscription. If you become part of the Microsoft CSP program (https://learn.microsoft.com/en-us/partner-center/enroll/csp-overview), you can use WebOffice without a proxy." introductionVersion:"7.0.0"` diff --git a/services/collaboration/pkg/connector/fileconnector_test.go b/services/collaboration/pkg/connector/fileconnector_test.go index ba5cd04bf..a008c5d4e 100644 --- a/services/collaboration/pkg/connector/fileconnector_test.go +++ b/services/collaboration/pkg/connector/fileconnector_test.go @@ -46,14 +46,14 @@ var _ = Describe("FileConnector", func() { BeforeEach(func() { cfg = &config.Config{ Commons: &shared.Commons{ - OcisURL: "https://ocis.example.prv", + OcisURL: "https://cloud.opencloud.test", }, App: config.App{ Name: "test", Product: "Microsoft", }, Wopi: config.Wopi{ - WopiSrc: "https://ocis.server.prv", + WopiSrc: "https://wopi.opencloud.test", Secret: "topsecret", }, TokenManager: &config.TokenManager{JWTSecret: "secret"}, @@ -956,9 +956,9 @@ var _ = Describe("FileConnector", func() { Expect(response.Headers).To(BeNil()) rBody := response.Body.(map[string]interface{}) Expect(rBody["Name"]).To(Equal("newDocument.docx")) - Expect(rBody["Url"]).To(HavePrefix("https://ocis.server.prv/wopi/files/")) // skip checking the actual reference - Expect(rBody["HostEditUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/newDocument.docx?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) - Expect(rBody["HostViewUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/newDocument.docx?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) + Expect(rBody["Url"]).To(HavePrefix("https://wopi.opencloud.test/wopi/files/")) // skip checking the actual reference + Expect(rBody["HostEditUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/newDocument.docx?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) + Expect(rBody["HostViewUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/newDocument.docx?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) }) It("PutRelativeFileSuggested success only extension", func() { @@ -1011,9 +1011,9 @@ var _ = Describe("FileConnector", func() { Expect(response.Headers).To(BeNil()) rBody := response.Body.(map[string]interface{}) Expect(rBody["Name"]).To(Equal("file.pdf")) - Expect(rBody["Url"]).To(HavePrefix("https://ocis.server.prv/wopi/files/")) // skip checking the actual reference - Expect(rBody["HostEditUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/file.pdf?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) - Expect(rBody["HostViewUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/file.pdf?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) + Expect(rBody["Url"]).To(HavePrefix("https://wopi.opencloud.test/wopi/files/")) // skip checking the actual reference + Expect(rBody["HostEditUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/file.pdf?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) + Expect(rBody["HostViewUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/file.pdf?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) }) It("PutRelativeFileSuggested success conflict", func() { @@ -1083,9 +1083,9 @@ var _ = Describe("FileConnector", func() { Expect(response.Headers).To(BeNil()) rBody := response.Body.(map[string]interface{}) Expect(rBody["Name"]).To(MatchRegexp(`[a-zA-Z0-9_-] file\.pdf`)) - Expect(rBody["Url"]).To(HavePrefix("https://ocis.server.prv/wopi/files/")) // skip checking the actual reference - Expect(rBody["HostEditUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/" + url.PathEscape(path.Base(*newFilePath)) + "?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) - Expect(rBody["HostViewUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/" + url.PathEscape(path.Base(*newFilePath)) + "?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) + Expect(rBody["Url"]).To(HavePrefix("https://wopi.opencloud.test/wopi/files/")) // skip checking the actual reference + Expect(rBody["HostEditUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/" + url.PathEscape(path.Base(*newFilePath)) + "?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) + Expect(rBody["HostViewUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/" + url.PathEscape(path.Base(*newFilePath)) + "?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) }) It("PutRelativeFileSuggested put file fails", func() { @@ -1207,9 +1207,9 @@ var _ = Describe("FileConnector", func() { Expect(response.Headers).To(BeNil()) rBody := response.Body.(map[string]interface{}) Expect(rBody["Name"]).To(Equal("newDocument.docx")) - Expect(rBody["Url"]).To(HavePrefix("https://ocis.server.prv/wopi/files/")) // skip checking the actual reference - Expect(rBody["HostEditUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/newDocument.docx?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) - Expect(rBody["HostViewUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/newDocument.docx?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) + Expect(rBody["Url"]).To(HavePrefix("https://wopi.opencloud.test/wopi/files/")) // skip checking the actual reference + Expect(rBody["HostEditUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/newDocument.docx?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) + Expect(rBody["HostViewUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/newDocument.docx?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) }) It("PutRelativeFileRelative conflict", func() { @@ -1266,9 +1266,9 @@ var _ = Describe("FileConnector", func() { Expect(response.Headers[connector.HeaderWopiValidRT]).To(MatchRegexp(`[a-zA-Z0-9_-] convFile\.pdf`)) rBody := response.Body.(map[string]interface{}) Expect(rBody["Name"]).To(Equal("convFile.pdf")) - Expect(rBody["Url"]).To(HavePrefix("https://ocis.server.prv/wopi/files/")) // skip checking the actual reference - Expect(rBody["HostEditUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/convFile.pdf?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) - Expect(rBody["HostViewUrl"]).To(Equal("https://ocis.example.prv/external-test/personal/path/to/convFile.pdf?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) + Expect(rBody["Url"]).To(HavePrefix("https://wopi.opencloud.test/wopi/files/")) // skip checking the actual reference + Expect(rBody["HostEditUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/convFile.pdf?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=write")) + Expect(rBody["HostViewUrl"]).To(Equal("https://cloud.opencloud.test/external-test/personal/path/to/convFile.pdf?fileId=storageid%24spaceid%21opaqueid_newDoc&view_mode=view")) }) It("PutRelativeFileRelative put file fails", func() { @@ -1704,7 +1704,7 @@ var _ = Describe("FileConnector", func() { BaseFileName: "test.txt", BreadcrumbDocName: "test.txt", BreadcrumbFolderName: "/path/to", - BreadcrumbFolderURL: "https://ocis.example.prv/f/storageid$spaceid%21parentopaqueid", + BreadcrumbFolderURL: "https://cloud.opencloud.test/f/storageid$spaceid%21parentopaqueid", UserCanNotWriteRelative: false, SupportsExtendedLockLength: true, SupportsGetLock: true, @@ -1716,10 +1716,10 @@ var _ = Describe("FileConnector", func() { UserCanRename: true, UserID: "61646d696e40637573746f6d496470", // hex of admin@customIdp UserFriendlyName: "Pet Shaft", - FileSharingURL: "https://ocis.example.prv/f/storageid$spaceid%21opaqueid?details=sharing", - FileVersionURL: "https://ocis.example.prv/f/storageid$spaceid%21opaqueid?details=versions", - HostEditURL: "https://ocis.example.prv/external-test/path/to/test.txt?fileId=storageid%24spaceid%21opaqueid&view_mode=write", - HostViewURL: "https://ocis.example.prv/external-test/path/to/test.txt?fileId=storageid%24spaceid%21opaqueid&view_mode=view", + FileSharingURL: "https://cloud.opencloud.test/f/storageid$spaceid%21opaqueid?details=sharing", + FileVersionURL: "https://cloud.opencloud.test/f/storageid$spaceid%21opaqueid?details=versions", + HostEditURL: "https://cloud.opencloud.test/external-test/path/to/test.txt?fileId=storageid%24spaceid%21opaqueid&view_mode=write", + HostViewURL: "https://cloud.opencloud.test/external-test/path/to/test.txt?fileId=storageid%24spaceid%21opaqueid&view_mode=view", } response, err := fc.CheckFileInfo(ctx) @@ -1791,7 +1791,7 @@ var _ = Describe("FileConnector", func() { SupportsRename: true, UserCanRename: false, BreadcrumbDocName: "test.txt", - PostMessageOrigin: "https://ocis.example.prv", + PostMessageOrigin: "https://cloud.opencloud.test", } response, err := fc.CheckFileInfo(ctx) @@ -1879,7 +1879,7 @@ var _ = Describe("FileConnector", func() { BaseFileName: "test.txt", BreadcrumbDocName: "test.txt", BreadcrumbFolderName: "/path/to", - BreadcrumbFolderURL: "https://ocis.example.prv/s/ABC123", + BreadcrumbFolderURL: "https://cloud.opencloud.test/s/ABC123", DisablePrint: true, UserCanNotWriteRelative: false, SupportsLocks: true, @@ -1892,10 +1892,10 @@ var _ = Describe("FileConnector", func() { EnableInsertRemoteImage: false, UserID: "guest-zzz000", UserFriendlyName: "guest zzz000", - FileSharingURL: "https://ocis.example.prv/f/storageid$spaceid%21opaqueid?details=sharing", - FileVersionURL: "https://ocis.example.prv/f/storageid$spaceid%21opaqueid?details=versions", - HostEditURL: "https://ocis.example.prv/external-onlyoffice/path/to/test.txt?fileId=storageid%24spaceid%21opaqueid&view_mode=write", - PostMessageOrigin: "https://ocis.example.prv", + FileSharingURL: "https://cloud.opencloud.test/f/storageid$spaceid%21opaqueid?details=sharing", + FileVersionURL: "https://cloud.opencloud.test/f/storageid$spaceid%21opaqueid?details=versions", + HostEditURL: "https://cloud.opencloud.test/external-onlyoffice/path/to/test.txt?fileId=storageid%24spaceid%21opaqueid&view_mode=write", + PostMessageOrigin: "https://cloud.opencloud.test", } response, err := fc.CheckFileInfo(ctx) @@ -1974,7 +1974,7 @@ var _ = Describe("FileConnector", func() { SupportsRename: true, UserCanRename: false, BreadcrumbDocName: "test.txt", - PostMessageOrigin: "https://ocis.example.prv", + PostMessageOrigin: "https://cloud.opencloud.test", } response, err := fc.CheckFileInfo(ctx) @@ -2032,7 +2032,7 @@ var _ = Describe("FileConnector", func() { BaseFileName: "test.txt", BreadcrumbDocName: "test.txt", BreadcrumbFolderName: "/path/to", - BreadcrumbFolderURL: "https://ocis.example.prv/f/storageid$spaceid%21parentopaqueid", + BreadcrumbFolderURL: "https://cloud.opencloud.test/f/storageid$spaceid%21parentopaqueid", UserCanNotWriteRelative: false, SupportsLocks: true, SupportsUpdate: true, @@ -2041,10 +2041,10 @@ var _ = Describe("FileConnector", func() { UserCanRename: true, UserID: "61646d696e40637573746f6d496470", // hex of admin@customIdp UserFriendlyName: "Pet Shaft", - FileSharingURL: "https://ocis.example.prv/f/storageid$spaceid%21opaqueid?details=sharing", - FileVersionURL: "https://ocis.example.prv/f/storageid$spaceid%21opaqueid?details=versions", - HostEditURL: "https://ocis.example.prv/external-onlyoffice/path/to/test.txt?fileId=storageid%24spaceid%21opaqueid&view_mode=write", - PostMessageOrigin: "https://ocis.example.prv", + FileSharingURL: "https://cloud.opencloud.test/f/storageid$spaceid%21opaqueid?details=sharing", + FileVersionURL: "https://cloud.opencloud.test/f/storageid$spaceid%21opaqueid?details=versions", + HostEditURL: "https://cloud.opencloud.test/external-onlyoffice/path/to/test.txt?fileId=storageid%24spaceid%21opaqueid&view_mode=write", + PostMessageOrigin: "https://cloud.opencloud.test", } // change wopi app provider @@ -2057,7 +2057,7 @@ var _ = Describe("FileConnector", func() { returnedFileInfo := response.Body.(*fileinfo.OnlyOffice) templateSource := returnedFileInfo.TemplateSource - expectedTemplateSource := "https://ocis.server.prv/wopi/templates/a340d017568d0d579ee061a9ac02109e32fb07082d35c40aa175864303bd9107?access_token=" + expectedTemplateSource := "https://wopi.opencloud.test/wopi/templates/a340d017568d0d579ee061a9ac02109e32fb07082d35c40aa175864303bd9107?access_token=" // take TemplateSource out of the response for easier comparison returnedFileInfo.TemplateSource = "" diff --git a/services/collaboration/pkg/helpers/discovery_test.go b/services/collaboration/pkg/helpers/discovery_test.go index a9153bbec..2db298527 100644 --- a/services/collaboration/pkg/helpers/discovery_test.go +++ b/services/collaboration/pkg/helpers/discovery_test.go @@ -23,26 +23,26 @@ var _ = Describe("Discovery", func() { - - - - - - - - - + + + + + + + + + - - - - - - - + + + + + + + - + @@ -78,14 +78,14 @@ var _ = Describe("Discovery", func() { expectedAppUrls := map[string]map[string]string{ "view": map[string]string{ - ".pdf": "https://test.server.prv/hosting/wopi/word/view", - ".djvu": "https://test.server.prv/hosting/wopi/word/view", - ".docx": "https://test.server.prv/hosting/wopi/word/view", - ".xls": "https://test.server.prv/hosting/wopi/cell/view", - ".xlsb": "https://test.server.prv/hosting/wopi/cell/view", + ".pdf": "https://cloud.opencloud.test/hosting/wopi/word/view", + ".djvu": "https://cloud.opencloud.test/hosting/wopi/word/view", + ".docx": "https://cloud.opencloud.test/hosting/wopi/word/view", + ".xls": "https://cloud.opencloud.test/hosting/wopi/cell/view", + ".xlsb": "https://cloud.opencloud.test/hosting/wopi/cell/view", }, "edit": map[string]string{ - ".docx": "https://test.server.prv/hosting/wopi/word/edit", + ".docx": "https://cloud.opencloud.test/hosting/wopi/word/edit", }, } diff --git a/services/collaboration/pkg/proofkeys/handler.go b/services/collaboration/pkg/proofkeys/handler.go index 066f899fa..5e28fba9d 100644 --- a/services/collaboration/pkg/proofkeys/handler.go +++ b/services/collaboration/pkg/proofkeys/handler.go @@ -59,7 +59,7 @@ func NewVerifyHandler(discoveryURL string, insecure bool, cachedDur time.Duratio // All the provided parameters are strings: // * accessToken: The access token used for this request (targeting this collaboration service) // * url: The full url for this request, including scheme, host and all query parameters, -// something like "https://wopiserver.test.private/wopi/file/abcbcbd?access_token=oiuiu" or +// something like "https://wopi.opencloud.test/wopi/file/abcbcbd?access_token=oiuiu" or // "http://wopiserver:8888/wopi/file/abcdef?access_token=zzxxyy" // * timestamp: The timestamp provided by the WOPI app in the "X-WOPI-TimeStamp" header, as string // * sig64: The base64-encoded signature, which should come directly from the "X-WOPI-Proof" header diff --git a/services/collaboration/pkg/service/grpc/v0/service_test.go b/services/collaboration/pkg/service/grpc/v0/service_test.go index 61634f083..c7514047c 100644 --- a/services/collaboration/pkg/service/grpc/v0/service_test.go +++ b/services/collaboration/pkg/service/grpc/v0/service_test.go @@ -85,15 +85,15 @@ var _ = Describe("Discovery", func() { service.Config(cfg), service.AppURLs(map[string]map[string]string{ "view": { - ".pdf": "https://test.server.prv/hosting/wopi/word/view", - ".djvu": "https://test.server.prv/hosting/wopi/word/view", - ".docx": "https://test.server.prv/hosting/wopi/word/view", - ".xls": "https://test.server.prv/hosting/wopi/cell/view", - ".xlsb": "https://test.server.prv/hosting/wopi/cell/view", + ".pdf": "https://cloud.opencloud.test/hosting/wopi/word/view", + ".djvu": "https://cloud.opencloud.test/hosting/wopi/word/view", + ".docx": "https://cloud.opencloud.test/hosting/wopi/word/view", + ".xls": "https://cloud.opencloud.test/hosting/wopi/cell/view", + ".xlsb": "https://cloud.opencloud.test/hosting/wopi/cell/view", }, "edit": { - ".docx": "https://test.server.prv/hosting/wopi/word/edit", - ".invalid": "://test.server.prv/hosting/wopi/cell/edit", + ".docx": "https://cloud.opencloud.test/hosting/wopi/word/edit", + ".invalid": "://cloud.opencloud.test/hosting/wopi/cell/edit", }, }), service.GatewaySelector(gatewaySelector), @@ -108,7 +108,7 @@ var _ = Describe("Discovery", func() { It("Invalid access token", func() { ctx := context.Background() - cfg.Wopi.WopiSrc = "https://wopiserver.test.prv" + cfg.Wopi.WopiSrc = "https://wopi.opencloud.test" req := &appproviderv1beta1.OpenInAppRequest{ ResourceInfo: &providerv1beta1.ResourceInfo{ @@ -146,7 +146,7 @@ var _ = Describe("Discovery", func() { ctx := context.Background() nowTime := time.Now() - cfg.Wopi.WopiSrc = "https://wopiserver.test.prv" + cfg.Wopi.WopiSrc = "https://wopi.opencloud.test" cfg.Wopi.Secret = "my_supa_secret" cfg.Wopi.DisableChat = disableChat cfg.App.Name = appName @@ -189,26 +189,26 @@ var _ = Describe("Discovery", func() { Expect(resp.GetAppUrl().GetAppUrl()).To(Equal(expectedAppUrl)) Expect(resp.GetAppUrl().GetFormParameters()["access_token_ttl"]).To(Equal(strconv.FormatInt(nowTime.Add(5*time.Hour).Unix()*1000, 10))) }, - Entry("Microsoft chat no lang", "Microsoft", "", false, "https://test.server.prv/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e"), - Entry("Collabora chat no lang", "Collabora", "", false, "https://test.server.prv/hosting/wopi/word/view?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e"), - Entry("OnlyOffice chat no lang", "OnlyOffice", "", false, "https://test.server.prv/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e"), - Entry("Microsoft chat lang", "Microsoft", "de", false, "https://test.server.prv/hosting/wopi/word/edit?UI_LLCC=de-DE&WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e"), - Entry("Collabora chat lang", "Collabora", "de", false, "https://test.server.prv/hosting/wopi/word/view?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&lang=de-DE"), - Entry("OnlyOffice chat lang", "OnlyOffice", "de", false, "https://test.server.prv/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&ui=de-DE"), - Entry("Microsoft no chat no lang", "Microsoft", "", true, "https://test.server.prv/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1"), - Entry("Collabora no chat no lang", "Collabora", "", true, "https://test.server.prv/hosting/wopi/word/view?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1"), - Entry("OnlyOffice no chat no lang", "OnlyOffice", "", true, "https://test.server.prv/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1"), - Entry("Microsoft no chat lang", "Microsoft", "de", true, "https://test.server.prv/hosting/wopi/word/edit?UI_LLCC=de-DE&WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1"), - Entry("Collabora no chat lang", "Collabora", "de", true, "https://test.server.prv/hosting/wopi/word/view?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1&lang=de-DE"), - Entry("OnlyOffice no chat lang", "OnlyOffice", "de", true, "https://test.server.prv/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1&ui=de-DE"), + Entry("Microsoft chat no lang", "Microsoft", "", false, "https://cloud.opencloud.test/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e"), + Entry("Collabora chat no lang", "Collabora", "", false, "https://cloud.opencloud.test/hosting/wopi/word/view?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e"), + Entry("OnlyOffice chat no lang", "OnlyOffice", "", false, "https://cloud.opencloud.test/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e"), + Entry("Microsoft chat lang", "Microsoft", "de", false, "https://cloud.opencloud.test/hosting/wopi/word/edit?UI_LLCC=de-DE&WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e"), + Entry("Collabora chat lang", "Collabora", "de", false, "https://cloud.opencloud.test/hosting/wopi/word/view?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&lang=de-DE"), + Entry("OnlyOffice chat lang", "OnlyOffice", "de", false, "https://cloud.opencloud.test/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&ui=de-DE"), + Entry("Microsoft no chat no lang", "Microsoft", "", true, "https://cloud.opencloud.test/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1"), + Entry("Collabora no chat no lang", "Collabora", "", true, "https://cloud.opencloud.test/hosting/wopi/word/view?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1"), + Entry("OnlyOffice no chat no lang", "OnlyOffice", "", true, "https://cloud.opencloud.test/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1"), + Entry("Microsoft no chat lang", "Microsoft", "de", true, "https://cloud.opencloud.test/hosting/wopi/word/edit?UI_LLCC=de-DE&WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1"), + Entry("Collabora no chat lang", "Collabora", "de", true, "https://cloud.opencloud.test/hosting/wopi/word/view?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1&lang=de-DE"), + Entry("OnlyOffice no chat lang", "OnlyOffice", "de", true, "https://cloud.opencloud.test/hosting/wopi/word/edit?WOPISrc=https%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&dchat=1&ui=de-DE"), ) It("Success with Wopi Proxy", func() { ctx := context.Background() nowTime := time.Now() - cfg.Wopi.WopiSrc = "https://wopiserver.test.prv" + cfg.Wopi.WopiSrc = "https://wopi.opencloud.test" cfg.Wopi.Secret = "my_supa_secret" - cfg.Wopi.ProxyURL = "https://office.proxy.test.prv" + cfg.Wopi.ProxyURL = "https://office.proxy.opencloud.test" cfg.Wopi.ProxySecret = "your_supa_secret" cfg.App.Name = "Microsoft" @@ -244,14 +244,14 @@ var _ = Describe("Discovery", func() { Expect(err).To(Succeed()) Expect(resp.GetStatus().GetCode()).To(Equal(rpcv1beta1.Code_CODE_OK)) Expect(resp.GetAppUrl().GetMethod()).To(Equal("POST")) - Expect(resp.GetAppUrl().GetAppUrl()).To(Equal("https://test.server.prv/hosting/wopi/word/edit?UI_LLCC=en-US&WOPISrc=https%3A%2F%2Foffice.proxy.test.prv%2Fwopi%2Ffiles%2FeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1IjoiaHR0cHM6Ly93b3Bpc2VydmVyLnRlc3QucHJ2L3dvcGkvZmlsZXMvIiwiZiI6IjJmNmVjMTg2OTZkZDEwMDgxMDY3NDliZDk0MTA2ZTVjZmFkNWMwOWUxNWRlN2I3NzA4OGQwMzg0M2U3MWI0M2UifQ.yfyLHZ18Z1MFOa6u7AP0LqfIiQ9X5AMkYauEZGhbCNs")) + Expect(resp.GetAppUrl().GetAppUrl()).To(Equal("https://cloud.opencloud.test/hosting/wopi/word/edit?UI_LLCC=en-US&WOPISrc=https%3A%2F%2Foffice.proxy.opencloud.test%2Fwopi%2Ffiles%2FeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1IjoiaHR0cHM6Ly93b3BpLm9wZW5jbG91ZC50ZXN0L3dvcGkvZmlsZXMvIiwiZiI6IjJmNmVjMTg2OTZkZDEwMDgxMDY3NDliZDk0MTA2ZTVjZmFkNWMwOWUxNWRlN2I3NzA4OGQwMzg0M2U3MWI0M2UifQ.j873xu7TkqtIokSIQXW5y7-BRRrHgIURqAx4WY_zxTA")) Expect(resp.GetAppUrl().GetFormParameters()["access_token_ttl"]).To(Equal(strconv.FormatInt(nowTime.Add(5*time.Hour).Unix()*1000, 10))) }) It("Fail with invalid app url", func() { ctx := context.Background() nowTime := time.Now() - cfg.Wopi.WopiSrc = "htttps://wopiserver.test.prv" + cfg.Wopi.WopiSrc = "htttps://wopi.opencloud.test" cfg.Wopi.Secret = "my_supa_secret" cfg.App.Name = "Microsoft" @@ -292,7 +292,7 @@ var _ = Describe("Discovery", func() { ctx := context.Background() nowTime := time.Now() - cfg.Wopi.WopiSrc = "htttps://wopiserver.test.prv" + cfg.Wopi.WopiSrc = "htttps://wopi.opencloud.test" cfg.Wopi.Secret = "my_supa_secret" cfg.App.Name = "Microsoft" @@ -334,7 +334,7 @@ var _ = Describe("Discovery", func() { ctx := context.Background() nowTime := time.Now() - cfg.Wopi.WopiSrc = "htttps://wopiserver.test.prv" + cfg.Wopi.WopiSrc = "htttps://wopi.opencloud.test" cfg.Wopi.Secret = "my_supa_secret" cfg.App.Name = "OnlyOffice" cfg.App.Product = "OnlyOffice" @@ -372,7 +372,7 @@ var _ = Describe("Discovery", func() { Expect(err).To(Succeed()) Expect(resp.GetStatus().GetCode()).To(Equal(rpcv1beta1.Code_CODE_OK)) Expect(resp.GetAppUrl().GetMethod()).To(Equal("POST")) - Expect(resp.GetAppUrl().GetAppUrl()).To(Equal("https://test.server.prv/hosting/wopi/word/edit?WOPISrc=htttps%3A%2F%2Fwopiserver.test.prv%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&ui=en-US")) + Expect(resp.GetAppUrl().GetAppUrl()).To(Equal("https://cloud.opencloud.test/hosting/wopi/word/edit?WOPISrc=htttps%3A%2F%2Fwopi.opencloud.test%2Fwopi%2Ffiles%2F2f6ec18696dd1008106749bd94106e5cfad5c09e15de7b77088d03843e71b43e&ui=en-US")) Expect(resp.GetAppUrl().GetFormParameters()["access_token_ttl"]).To(Equal(strconv.FormatInt(nowTime.Add(5*time.Hour).Unix()*1000, 10))) }) })