From b3f72d7a4dd988447bf402f6bd6ff7b7d80c0df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Thu, 24 Oct 2024 08:51:24 +0200 Subject: [PATCH] chore: typos and minor consistency changes for sonarcloud --- services/collaboration/pkg/config/wopi.go | 2 +- services/collaboration/pkg/middleware/wopicontext.go | 2 +- services/collaboration/pkg/server/grpc/option.go | 2 +- services/collaboration/pkg/server/http/option.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/collaboration/pkg/config/wopi.go b/services/collaboration/pkg/config/wopi.go index c00b1a1fa0..b13f34dfc1 100644 --- a/services/collaboration/pkg/config/wopi.go +++ b/services/collaboration/pkg/config/wopi.go @@ -7,5 +7,5 @@ type Wopi struct { DisableChat bool `yaml:"disable_chat" env:"COLLABORATION_WOPI_DISABLE_CHAT;OCIS_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"` ProxySecret string `yaml:"proxy_secret" env:"COLLABORATION_WOPI_PROXY_SECRET" desc:"Optional, the secret to authenticate against the ownCloud Office365 WOPI proxy. This secret can be obtained from ownCloud via the office365 proxy subscription." introductionVersion:"7.0.0"` - ShortTokens bool `yaml:"short_tokens" env:"COLLABORATION_WOPI_SHORTTOKENS" desc:"Use short access tokens for WOPI access. This is useful for Office Online, which has URL length restrictions." introductionVersion:"7.0.0"` + ShortTokens bool `yaml:"short_tokens" env:"COLLABORATION_WOPI_SHORTTOKENS" desc:"Use short access tokens for WOPI access. This is useful for office packages, like Office Online, which have URL length restrictions. If enabled, a persistent store must be configured." introductionVersion:"7.0.0"` } diff --git a/services/collaboration/pkg/middleware/wopicontext.go b/services/collaboration/pkg/middleware/wopicontext.go index 34378ae03f..d16df6c66b 100644 --- a/services/collaboration/pkg/middleware/wopicontext.go +++ b/services/collaboration/pkg/middleware/wopicontext.go @@ -221,7 +221,7 @@ func GenerateWopiToken(wopiContext WopiContext, cfg *config.Config, st microstor errWrite := st.Write(µstore.Record{ Key: shortAccessToken, Value: []byte(accessToken), - Expiry: claims.ExpiresAt.Sub(time.Now()), + Expiry: time.Until(claims.ExpiresAt.Time), }) return shortAccessToken, claims.ExpiresAt.UnixMilli(), errWrite diff --git a/services/collaboration/pkg/server/grpc/option.go b/services/collaboration/pkg/server/grpc/option.go index fc50b473f5..4fda3077e4 100644 --- a/services/collaboration/pkg/server/grpc/option.go +++ b/services/collaboration/pkg/server/grpc/option.go @@ -76,7 +76,7 @@ func TraceProvider(val trace.TracerProvider) Option { } } -// Store provides a funtion to set the Store option +// Store provides a function to set the Store option func Store(val microstore.Store) Option { return func(o *Options) { o.Store = val diff --git a/services/collaboration/pkg/server/http/option.go b/services/collaboration/pkg/server/http/option.go index 4f75c6b904..11491a2797 100644 --- a/services/collaboration/pkg/server/http/option.go +++ b/services/collaboration/pkg/server/http/option.go @@ -69,7 +69,7 @@ func TracerProvider(val trace.TracerProvider) Option { } } -// Store provides a funtion to set the Store option +// Store provides a function to set the Store option func Store(val microstore.Store) Option { return func(o *Options) { o.Store = val