From eb5e9675d68d8dbfa4abd913dc4497eba1bec0b7 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 9 Aug 2022 07:28:03 +0000 Subject: [PATCH 001/103] Add `ocis idm resetpassword` subcommand This allows resetting the ocis admin user's password (when ocis is not running) when running with the builtin LDAP server. Fixes #4084 --- .../unreleased/enhancment-admin-pwreset.md | 8 ++ docs/services/idm/admin_password_reset.md | 24 ++++ go.mod | 3 +- go.sum | 1 + services/idm/pkg/command/resetpw.go | 118 ++++++++++++++++++ services/idm/pkg/command/root.go | 1 + 6 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/enhancment-admin-pwreset.md create mode 100644 docs/services/idm/admin_password_reset.md create mode 100644 services/idm/pkg/command/resetpw.go diff --git a/changelog/unreleased/enhancment-admin-pwreset.md b/changelog/unreleased/enhancment-admin-pwreset.md new file mode 100644 index 0000000000..87931228b4 --- /dev/null +++ b/changelog/unreleased/enhancment-admin-pwreset.md @@ -0,0 +1,8 @@ +Enhancement: added command to reset administrator password + +The new command `ocis idm resetpassword` allows to reset the administrator +password when ocis is not running. So it is possible to recover setups +where the admin password was lost. + +https://github.com/owncloud/ocis/issues/4084 +https://github.com/owncloud/ocis/pull/4365 diff --git a/docs/services/idm/admin_password_reset.md b/docs/services/idm/admin_password_reset.md new file mode 100644 index 0000000000..1e3065c37c --- /dev/null +++ b/docs/services/idm/admin_password_reset.md @@ -0,0 +1,24 @@ +--- +title: Resetting a lost administrator password +date: 2022-08-29:00:00+00:00 +weight: 10 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/services/idm +geekdocFilePath: admin_password_reset.md +geekdocCollapseSection: true +--- + +## Resetting a lost administrator password +By default, when using oCIS with the builtin IDM an ad generates the +user `admin` (DN `uid=admin,ou=users,o=libregraph-idm`) if, for any +reason, the password of that user is lost, it can be reset using +the `resetpassword` sub-command: + +``` +ocis idm resetpassword +``` + +It will prompt for a new password and set the password of that user +accordingly. Note: As this command is accessing the idm database directly +will only work while ocis is not running and nothing else is accessing +database. diff --git a/go.mod b/go.mod index 4c8a52b587..64a5dbfa03 100644 --- a/go.mod +++ b/go.mod @@ -63,6 +63,7 @@ require ( github.com/urfave/cli/v2 v2.11.1 github.com/xhit/go-simple-mail/v2 v2.11.0 go-micro.dev/v4 v4.8.0 + go.etcd.io/bbolt v1.3.6 go.opencensus.io v0.23.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 go.opentelemetry.io/otel v1.9.0 @@ -74,6 +75,7 @@ require ( golang.org/x/image v0.0.0-20220321031419-a8550c1d254a golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c + golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 @@ -254,7 +256,6 @@ require ( github.com/wk8/go-ordered-map v1.0.0 // indirect github.com/xanzy/ssh-agent v0.3.1 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - go.etcd.io/bbolt v1.3.6 // indirect go.etcd.io/etcd/api/v3 v3.5.2 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.2 // indirect go.etcd.io/etcd/client/v3 v3.5.2 // indirect diff --git a/go.sum b/go.sum index 67022a4c84..fe2f216869 100644 --- a/go.sum +++ b/go.sum @@ -1568,6 +1568,7 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= +golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/services/idm/pkg/command/resetpw.go b/services/idm/pkg/command/resetpw.go new file mode 100644 index 0000000000..7fd5c52eba --- /dev/null +++ b/services/idm/pkg/command/resetpw.go @@ -0,0 +1,118 @@ +package command + +import ( + "context" + "errors" + "fmt" + "os" + "syscall" + "time" + + "github.com/go-ldap/ldap/v3" + "github.com/libregraph/idm/pkg/ldbbolt" + "github.com/libregraph/idm/server" + "github.com/owncloud/ocis/v2/ocis-pkg/log" + "github.com/owncloud/ocis/v2/services/idm/pkg/config" + "github.com/owncloud/ocis/v2/services/idm/pkg/config/parser" + "github.com/owncloud/ocis/v2/services/idm/pkg/logging" + "github.com/urfave/cli/v2" + bolt "go.etcd.io/bbolt" + "golang.org/x/term" +) + +// ResetPassword is the entrypoint for the resetpassword command +func ResetPassword(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "resetpassword", + Usage: fmt.Sprintf("Reset admin password"), + Category: "password reset", + Before: func(c *cli.Context) error { + err := parser.ParseConfig(cfg) + if err != nil { + fmt.Printf("%v", err) + os.Exit(1) + } + return err + }, + Action: func(c *cli.Context) error { + logger := logging.Configure(cfg.Service.Name, cfg.Log) + ctx, cancel := func() (context.Context, context.CancelFunc) { + if cfg.Context == nil { + return context.WithCancel(context.Background()) + } + return context.WithCancel(cfg.Context) + }() + + defer cancel() + return resetPassword(ctx, logger, cfg) + }, + } +} + +func resetPassword(ctx context.Context, logger log.Logger, cfg *config.Config) error { + servercfg := server.Config{ + Logger: log.LogrusWrap(logger.Logger), + LDAPHandler: "boltdb", + LDAPBaseDN: "o=libregraph-idm", + + BoltDBFile: cfg.IDM.DatabasePath, + } + + adminUserDN := "uid=admin,ou=users," + servercfg.LDAPBaseDN + fmt.Printf("Resetting password for user '%s'.\n", adminUserDN) + if _, err := os.Stat(servercfg.BoltDBFile); errors.Is(err, os.ErrNotExist) { + fmt.Fprintf(os.Stderr, "IDM database does not exist.\n") + return err + } + + newPw, err := getPassword() + if err != nil { + fmt.Fprintf(os.Stderr, "Error reading password: %v\n", err) + return err + } + + bdb := &ldbbolt.LdbBolt{} + + opts := bolt.Options{ + Timeout: 1 * time.Millisecond, + } + if err := bdb.Configure(servercfg.Logger, servercfg.LDAPBaseDN, servercfg.BoltDBFile, &opts); err != nil { + fmt.Fprintf(os.Stderr, "Failed to open database: '%s'. Please stop any running ocis/idm instance, as this tool requires exclusive access to the database.\n", err) + return err + } + defer bdb.Close() + + if err := bdb.Initialize(); err != nil { + return err + } + + pwRequest := ldap.NewPasswordModifyRequest(adminUserDN, "", newPw) + if err := bdb.UpdatePassword(pwRequest); err != nil { + fmt.Fprintf(os.Stderr, "Failed to update admin password: %v\n", err) + } + fmt.Printf("Password for user '%s' updated.\n", adminUserDN) + return nil +} + +func getPassword() (string, error) { + fmt.Print("Enter new password: ") + bytePassword, err := term.ReadPassword(int(syscall.Stdin)) + if err != nil { + return "", err + } + fmt.Println("") + fmt.Print("Re-enter new password: ") + bytePasswordVerify, err := term.ReadPassword(int(syscall.Stdin)) + if err != nil { + return "", err + } + fmt.Println("") + + password := string(bytePassword) + passwordVerify := string(bytePasswordVerify) + + if password != passwordVerify { + return "", errors.New("Passwords do not match") + } + return password, nil +} diff --git a/services/idm/pkg/command/root.go b/services/idm/pkg/command/root.go index 84208cba84..ee1ccb95d9 100644 --- a/services/idm/pkg/command/root.go +++ b/services/idm/pkg/command/root.go @@ -18,6 +18,7 @@ func GetCommands(cfg *config.Config) cli.Commands { Server(cfg), // interaction with this service + ResetPassword(cfg), // infos about this service Health(cfg), From f37ca15a1b52dc4a84b8dfa55f4a55718b53302d Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Tue, 9 Aug 2022 10:16:22 +0200 Subject: [PATCH 002/103] Bump libregraph/idm to include latest logging fixes --- go.mod | 3 ++- go.sum | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 64a5dbfa03..3620bd50d8 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.2 github.com/justinas/alice v1.2.0 - github.com/libregraph/idm v0.3.1-0.20220718103124-c4f6613dce2b + github.com/libregraph/idm v0.3.1-0.20220808071235-17bb032176de github.com/libregraph/lico v0.54.1-0.20220325072321-31efc3995d63 github.com/mitchellh/mapstructure v1.5.0 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 @@ -121,6 +121,7 @@ require ( github.com/blevesearch/zapx/v15 v15.3.4 // indirect github.com/bluele/gcache v0.0.2 // indirect github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect + github.com/bombsimon/logrusr/v3 v3.0.0 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/ceph/go-ceph v0.15.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect diff --git a/go.sum b/go.sum index fe2f216869..c69c24a5d5 100644 --- a/go.sum +++ b/go.sum @@ -83,7 +83,6 @@ github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvd github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= -github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e h1:NeAW1fUYUEWhft7pkxDf6WoUvEZJ/uOKsvtpjLnn8MU= github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -224,6 +223,8 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dR github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f h1:gOO/tNZMjjvTKZWpY7YnXC72ULNLErRtp94LountVE8= github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= +github.com/bombsimon/logrusr/v3 v3.0.0 h1:tcAoLfuAhKP9npBxWzSdpsvKPQt1XV02nSf2lZA82TQ= +github.com/bombsimon/logrusr/v3 v3.0.0/go.mod h1:PksPPgSFEL2I52pla2glgCyyd2OqOHAnFF5E+g8Ixco= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/c-bata/go-prompt v0.2.5/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -400,7 +401,6 @@ github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-ldap/ldap/v3 v3.1.7/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q= github.com/go-ldap/ldap/v3 v3.4.2/go.mod h1:iYS1MdmrmceOJ1QOTnRXrIs7i3kloqtmGQjRvjKpyMg= -github.com/go-ldap/ldap/v3 v3.4.3/go.mod h1:7LdHfVt6iIOESVEe3Bs4Jp2sHEKgDeduAhgM1/f9qmo= github.com/go-ldap/ldap/v3 v3.4.4 h1:qPjipEpt+qDa6SI/h1fzuGWoRUY+qqQ9sOZq67/PYUs= github.com/go-ldap/ldap/v3 v3.4.4/go.mod h1:fe1MsuN5eJJ1FeLT/LEBVdWfNWKh459R7aXgXtJC+aI= github.com/go-ldap/ldif v0.0.0-20200320164324-fd88d9b715b3 h1:sfz1YppV05y4sYaW7kXZtrocU/+vimnIWt4cxAYh7+o= @@ -809,8 +809,8 @@ github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/libregraph/idm v0.3.1-0.20220718103124-c4f6613dce2b h1:/BNTnfP6lqixKUP2kP9gKWiPRaBWvE5BJcFcIVd2Ekg= -github.com/libregraph/idm v0.3.1-0.20220718103124-c4f6613dce2b/go.mod h1:ggVmYkaK5fu680QOnxkuyCRW5Wl5qzaYXgIiieNBOJE= +github.com/libregraph/idm v0.3.1-0.20220808071235-17bb032176de h1:iDKkd+RQt/sddvPNQrfFQkExbyt4gxDyTQyi9DkP/c0= +github.com/libregraph/idm v0.3.1-0.20220808071235-17bb032176de/go.mod h1:syzZjsjzpnjGibVayqnIywXSvvGanU8cDd9uotqoPcw= github.com/libregraph/lico v0.54.1-0.20220325072321-31efc3995d63 h1:oPqyRePmq+59YF1tAur7WXuM/z/epRd+HGGyPPx2Vv8= github.com/libregraph/lico v0.54.1-0.20220325072321-31efc3995d63/go.mod h1:KZ4X+bEbOQMSV6iPysZEqVO/Pa5Mvo7xhhcLwUNPjmw= github.com/linode/linodego v0.25.3/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE= @@ -1014,7 +1014,6 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1308,7 +1307,6 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -1449,6 +1447,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1558,6 +1557,7 @@ golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From c41cf352cde711721e473af261507d46d2b3d217 Mon Sep 17 00:00:00 2001 From: "sagargurung1001@gmail.com" Date: Thu, 11 Aug 2022 10:02:27 +0545 Subject: [PATCH 003/103] Select Available role only while sharing space --- tests/acceptance/features/apiSpaces/copySpaces.feature | 4 ++-- tests/acceptance/features/apiSpaces/moveSpaces.feature | 2 +- tests/acceptance/features/bootstrap/SpacesContext.php | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/features/apiSpaces/copySpaces.feature b/tests/acceptance/features/apiSpaces/copySpaces.feature index 3d0cfa13d0..5f2768fe27 100644 --- a/tests/acceptance/features/apiSpaces/copySpaces.feature +++ b/tests/acceptance/features/apiSpaces/copySpaces.feature @@ -437,7 +437,7 @@ Feature: copy file Scenario Outline: User copies a folder from space shares jail with different role to space project with role viewer Given the administrator has given "Brian" the role "Space Admin" using the settings api And user "Brian" has created a space "Project" with the default quota using the GraphApi - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" to user "Alice" with role "viewer" And user "Brian" has created folder "/testshare" And user "Brian" has created folder "/testshare/folder1" And user "Brian" has uploaded file with content "testshare content" to "/testshare/folder1/testshare.txt" @@ -450,4 +450,4 @@ Feature: copy file Examples: | permissions | | 31 | - | 17 | \ No newline at end of file + | 17 | diff --git a/tests/acceptance/features/apiSpaces/moveSpaces.feature b/tests/acceptance/features/apiSpaces/moveSpaces.feature index 355dbe2435..6d34fd37fa 100644 --- a/tests/acceptance/features/apiSpaces/moveSpaces.feature +++ b/tests/acceptance/features/apiSpaces/moveSpaces.feature @@ -33,7 +33,7 @@ Feature: move (rename) file And user "Brian" has created a space "Project" with the default quota using the GraphApi And user "Brian" has created a folder "newfolder" in space "Project" And user "Brian" has uploaded a file inside space "Project" with content "some content" to "insideSpace.txt" - And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared a space "Project" to user "Alice" with role "viewer" When user "Alice" moves file "insideSpace.txt" to "newfolder/insideSpace.txt" in space "Project" using the WebDAV API Then the HTTP status code should be "403" And for user "Alice" the space "Project" should not contain these entries: diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 9548d0f637..4af9251cf1 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -1989,6 +1989,10 @@ class SpacesContext implements Context { string $role ): void { $space = $this->getSpaceByName($user, $spaceName); + $availableRoleToAssignToShareSpace = ['manager', 'editor', 'viewer']; + if (!\in_array(\strtolower($role), $availableRoleToAssignToShareSpace)) { + throw new Error("The Selected " . $role . " Cannot be Found"); + } $body = [ "space_ref" => $space['id'], "shareType" => 7, @@ -1997,7 +2001,6 @@ class SpacesContext implements Context { ]; $fullUrl = $this->baseUrl . $this->ocsApiUrl; - $this->featureContext->setResponse( $this->sendPostRequestToUrl( $fullUrl, @@ -2111,7 +2114,6 @@ class SpacesContext implements Context { string $role ): void { $this->sendShareSpaceRequest($user, $spaceName, $userRecipient, $role); - $expectedHTTPStatus = "200"; $this->featureContext->theHTTPStatusCodeShouldBe( $expectedHTTPStatus, From 7c9ecac6fc94d9870ec67ae0ae6ded0010eadbae Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Tue, 9 Aug 2022 14:00:02 +0545 Subject: [PATCH 004/103] Add tests removed by core PR-40275 update core commit id update expected to fail file --- .drone.env | 2 +- .../expected-failures-API-on-OCIS-storage.md | 75 ++---- .../apiSpaces/shareOperations.feature | 227 ++++++++++++++++++ .../features/bootstrap/SpacesContext.php | 96 +++++++- 4 files changed, 340 insertions(+), 60 deletions(-) create mode 100644 tests/acceptance/features/apiSpaces/shareOperations.feature diff --git a/.drone.env b/.drone.env index fb638d1514..4cc690e098 100644 --- a/.drone.env +++ b/.drone.env @@ -1,5 +1,5 @@ # The test runner source for API tests -CORE_COMMITID=dc5c1f5ce58b63ba9cf799ad81fe5cc50421f6da +CORE_COMMITID=76048f490ac50af03594d181c5baf49f87c18b6e CORE_BRANCH=master # The test runner source for UI tests diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index eef202227c..7da96c76e1 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -8,10 +8,10 @@ Basic file management like up and download, move, copy, properties, trash, versi #### [Getting information about a folder overwritten by a file gives 500 error instead of 404](https://github.com/owncloud/ocis/issues/1239) -- [apiWebdavProperties1/copyFile.feature:286](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L286) -- [apiWebdavProperties1/copyFile.feature:287](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L287) -- [apiWebdavProperties1/copyFile.feature:309](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L309) -- [apiWebdavProperties1/copyFile.feature:310](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L310) +- [apiWebdavProperties1/copyFile.feature:276](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L276) +- [apiWebdavProperties1/copyFile.feature:277](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L277) +- [apiWebdavProperties1/copyFile.feature:294](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L294) +- [apiWebdavProperties1/copyFile.feature:295](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L295) #### [Custom dav properties with namespaces are rendered incorrectly](https://github.com/owncloud/ocis/issues/2140) @@ -55,8 +55,8 @@ Synchronization features like etag propagation, setting mtime and locking files #### [Uploading an old method chunked file with checksum should fail using new DAV path](https://github.com/owncloud/ocis/issues/2323) -- [apiMain/checksums.feature:381](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L381) -- [apiMain/checksums.feature:386](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L386) +- [apiMain/checksums.feature:371](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L371) +- [apiMain/checksums.feature:376](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L376) #### [Webdav LOCK operations](https://github.com/owncloud/ocis/issues/1284) @@ -581,9 +581,8 @@ cannot share a folder with create permission #### [changing user quota gives ocs status 103 / Cannot set quota](https://github.com/owncloud/product/issues/247) -- [apiShareOperationsToShares2/uploadToShare.feature:245](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L245) -- [apiShareOperationsToShares2/uploadToShare.feature:246](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L246) -- [apiShareOperationsToShares2/uploadToShare.feature:251](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L251) +- [apiShareOperationsToShares2/uploadToShare.feature:210](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L210) +- [apiShareOperationsToShares2/uploadToShare.feature:211](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L211) #### [not possible to move file into a received folder](https://github.com/owncloud/ocis/issues/764) @@ -943,42 +942,6 @@ And other missing implementation of favorites - [apiFavorites/favoritesSharingToShares.feature:67](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L67) - [apiFavorites/favoritesSharingToShares.feature:83](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L83) - [apiFavorites/favoritesSharingToShares.feature:108](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L108) -- [apiMain/checksums.feature:211](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L211) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:51](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L51) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:78](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L78) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L98) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:125](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L125) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:145](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L145) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:172](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L172) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:212](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L212) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:238](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L238) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:258](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L258) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:285](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L285) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:305](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L305) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:332](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L332) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:352](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L352) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:379](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L379) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:399](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L399) -- [apiShareOperationsToShares2/getWebDAVSharePermissions.feature:426](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/getWebDAVSharePermissions.feature#L426) -- [apiShareOperationsToShares2/uploadToShare.feature:47](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L47) -- [apiShareOperationsToShares2/uploadToShare.feature:78](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L78) -- [apiShareOperationsToShares2/uploadToShare.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L111) -- [apiShareOperationsToShares2/uploadToShare.feature:140](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L140) -- [apiShareOperationsToShares2/uploadToShare.feature:171](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L171) -- [apiShareOperationsToShares2/uploadToShare.feature:346](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L346) -- [apiShareOperationsToShares2/uploadToShare.feature:347](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L347) -- [apiWebdavProperties1/copyFile.feature:89](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L89) -- [apiWebdavProperties1/copyFile.feature:116](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L116) -- [apiWebdavProperties1/copyFile.feature:292](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L292) -- [apiWebdavProperties1/copyFile.feature:315](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L315) -- [apiWebdavProperties1/copyFile.feature:343](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L343) -- [apiWebdavProperties1/copyFile.feature:373](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L373) -- [apiWebdavProperties1/copyFile.feature:402](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L402) -- [apiWebdavProperties1/copyFile.feature:431](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L431) -- [apiWebdavProperties1/copyFile.feature:515](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L515) -- [apiWebdavProperties1/copyFile.feature:548](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L548) -- [apiWebdavProperties1/copyFile.feature:580](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L580) -- [apiWebdavProperties1/copyFile.feature:612](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L612) - [apiWebdavUploadTUS/uploadToShare.feature:31](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L31) - [apiWebdavUploadTUS/uploadToShare.feature:50](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L50) - [apiWebdavUploadTUS/uploadToShare.feature:72](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L72) @@ -1187,12 +1150,12 @@ And other missing implementation of favorites #### [copying the file inside Shares folder returns 404](https://github.com/owncloud/ocis/issues/3874) -- [apiWebdavProperties1/copyFile.feature:452](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L452) -- [apiWebdavProperties1/copyFile.feature:453](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L453) -- [apiWebdavProperties1/copyFile.feature:458](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L458) -- [apiWebdavProperties1/copyFile.feature:478](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L478) -- [apiWebdavProperties1/copyFile.feature:479](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L479) -- [apiWebdavProperties1/copyFile.feature:484](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L484) +- [apiWebdavProperties1/copyFile.feature:412](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L412) +- [apiWebdavProperties1/copyFile.feature:413](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L413) +- [apiWebdavProperties1/copyFile.feature:418](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L418) +- [apiWebdavProperties1/copyFile.feature:438](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L438) +- [apiWebdavProperties1/copyFile.feature:439](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L439) +- [apiWebdavProperties1/copyFile.feature:444](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L444) ### Won't fix @@ -1215,9 +1178,9 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers #### [Blacklist files extensions](https://github.com/owncloud/ocis/issues/2177) -- [apiWebdavProperties1/copyFile.feature:132](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L132) -- [apiWebdavProperties1/copyFile.feature:133](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L133) -- [apiWebdavProperties1/copyFile.feature:138](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L138) +- [apiWebdavProperties1/copyFile.feature:122](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L122) +- [apiWebdavProperties1/copyFile.feature:123](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L123) +- [apiWebdavProperties1/copyFile.feature:128](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L128) - [apiWebdavProperties1/createFolder.feature:95](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/createFolder.feature#L95) - [apiWebdavProperties1/createFolder.feature:96](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/createFolder.feature#L96) - [apiWebdavProperties1/createFolder.feature:101](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/createFolder.feature#L101) @@ -1375,10 +1338,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiWebdavOperations/listFiles.feature:256](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/listFiles.feature#L256) - [apiWebdavOperations/listFiles.feature:293](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/listFiles.feature#L293) -#### [Trying to modify a shared file using spaces end-point returns 409 HTTP status code](https://github.com/owncloud/ocis/issues/3241) - -- [apiMain/checksums.feature:233](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L233) - ### [graph/users: enable/disable users](https://github.com/owncloud/ocis/issues/3064) - [apiWebdavOperations/refuseAccess.feature:35](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/refuseAccess.feature#L35) diff --git a/tests/acceptance/features/apiSpaces/shareOperations.feature b/tests/acceptance/features/apiSpaces/shareOperations.feature new file mode 100644 index 0000000000..e536f3d394 --- /dev/null +++ b/tests/acceptance/features/apiSpaces/shareOperations.feature @@ -0,0 +1,227 @@ +@api @skipOnOcV10 +Feature: sharing + + Background: + Given using OCS API version "1" + And these users have been created with default attributes and without skeleton files: + | username | + | Alice | + | Brian | + And using spaces DAV path + + + Scenario: Correct webdav share-permissions for received file with edit and reshare permissions + Given user "Alice" has uploaded file with content "foo" to "/tmp.txt" + And user "Alice" has shared file "/tmp.txt" with user "Brian" + And user "Brian" has accepted share "/tmp.txt" offered by user "Alice" + When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "19" + + + Scenario: Correct webdav share-permissions for received group shared file with edit and reshare permissions + Given group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has uploaded file with content "foo" to "/tmp.txt" + And user "Alice" has created a share with settings + | path | /tmp.txt | + | shareType | group | + | permissions | share,update,read | + | shareWith | grp1 | + And user "Brian" has accepted share "/tmp.txt" offered by user "Alice" + When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "19" + + + Scenario: Correct webdav share-permissions for received file with edit permissions but no reshare permissions + Given user "Alice" has uploaded file with content "foo" to "/tmp.txt" + And user "Alice" has shared file "tmp.txt" with user "Brian" + And user "Brian" has accepted share "/tmp.txt" offered by user "Alice" + When user "Alice" updates the last share using the sharing API with + | permissions | update,read | + Then the HTTP status code should be "200" + And as user "Brian" file "/tmp.txt" inside space "Shares Jail" should contain a property "ocs:share-permissions" with value "3" + + + Scenario: Correct webdav share-permissions for received group shared file with edit permissions but no reshare permissions + Given group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has uploaded file with content "foo" to "/tmp.txt" + And user "Alice" has created a share with settings + | path | /tmp.txt | + | shareType | group | + | permissions | update,read | + | shareWith | grp1 | + And user "Brian" has accepted share "/tmp.txt" offered by user "Alice" + When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "3" + + + Scenario: Correct webdav share-permissions for received file with reshare permissions but no edit permissions + Given user "Alice" has uploaded file with content "foo" to "/tmp.txt" + And user "Alice" has shared file "tmp.txt" with user "Brian" + And user "Brian" has accepted share "/tmp.txt" offered by user "Alice" + When user "Alice" updates the last share using the sharing API with + | permissions | share,read | + Then the HTTP status code should be "200" + And as user "Brian" file "/tmp.txt" inside space "Shares Jail" should contain a property "ocs:share-permissions" with value "17" + + + Scenario: Correct webdav share-permissions for received group shared file with reshare permissions but no edit permissions + Given group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has uploaded file with content "foo" to "/tmp.txt" + And user "Alice" has created a share with settings + | path | /tmp.txt | + | shareType | group | + | permissions | share,read | + | shareWith | grp1 | + And user "Brian" has accepted share "/tmp.txt" offered by user "Alice" + When user "Brian" gets the following properties of file "/tmp.txt" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "17" + + + Scenario: Correct webdav share-permissions for received folder with all permissions + Given user "Alice" has created folder "/tmp" + And user "Alice" has shared file "/tmp" with user "Brian" + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "31" + + + Scenario: Correct webdav share-permissions for received group shared folder with all permissions + Given group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has created folder "/tmp" + And user "Alice" has created a share with settings + | path | tmp | + | shareType | group | + | shareWith | grp1 | + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "31" + + + Scenario: Correct webdav share-permissions for received folder with all permissions but edit + Given user "Alice" has created folder "/tmp" + And user "Alice" has shared file "/tmp" with user "Brian" + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Alice" updates the last share using the sharing API with + | permissions | share,delete,create,read | + Then the HTTP status code should be "200" + And as user "Brian" folder "/tmp" inside space "Shares Jail" should contain a property "ocs:share-permissions" with value "29" + + + Scenario: Correct webdav share-permissions for received group shared folder with all permissions but edit + Given group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has created folder "/tmp" + And user "Alice" has created a share with settings + | path | tmp | + | shareType | group | + | shareWith | grp1 | + | permissions | share,delete,create,read | + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "29" + + + Scenario: Correct webdav share-permissions for received folder with all permissions but create + Given user "Alice" has created folder "/tmp" + And user "Alice" has shared file "/tmp" with user "Brian" + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Alice" updates the last share using the sharing API with + | permissions | share,delete,update,read | + Then the HTTP status code should be "200" + And as user "Brian" folder "/tmp" inside space "Shares Jail" should contain a property "ocs:share-permissions" with value "27" + + + Scenario: Correct webdav share-permissions for received group shared folder with all permissions but create + Given group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has created folder "/tmp" + And user "Alice" has created a share with settings + | path | tmp | + | shareType | group | + | shareWith | grp1 | + | permissions | share,delete,update,read | + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "27" + + + Scenario: Correct webdav share-permissions for received folder with all permissions but delete + Given user "Alice" has created folder "/tmp" + And user "Alice" has shared file "/tmp" with user "Brian" + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Alice" updates the last share using the sharing API with + | permissions | share,create,update,read | + Then the HTTP status code should be "200" + And as user "Brian" folder "/tmp" inside space "Shares Jail" should contain a property "ocs:share-permissions" with value "23" + + + Scenario: Correct webdav share-permissions for received group shared folder with all permissions but delete + Given group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has created folder "/tmp" + And user "Alice" has created a share with settings + | path | tmp | + | shareType | group | + | shareWith | grp1 | + | permissions | share,create,update,read | + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "23" + + + Scenario: Correct webdav share-permissions for received folder with all permissions but share + Given user "Alice" has created folder "/tmp" + And user "Alice" has shared file "/tmp" with user "Brian" + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Alice" updates the last share using the sharing API with + | permissions | change | + Then the HTTP status code should be "200" + And as user "Brian" folder "/tmp" inside space "Shares Jail" should contain a property "ocs:share-permissions" with value "15" + + + Scenario: Correct webdav share-permissions for received group shared folder with all permissions but share + Given group "grp1" has been created + And user "Brian" has been added to group "grp1" + And user "Alice" has created folder "/tmp" + And user "Alice" has created a share with settings + | path | tmp | + | shareType | group | + | shareWith | grp1 | + | permissions | change | + And user "Brian" has accepted share "/tmp" offered by user "Alice" + When user "Brian" gets the following properties of folder "/tmp" inside space "Shares Jail" using the WebDAV API + | propertyName | + | ocs:share-permissions | + Then the HTTP status code should be "207" + And the single response should contain a property "ocs:share-permissions" with value "15" \ No newline at end of file diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 9548d0f637..6e5207cf88 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -28,6 +28,7 @@ use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Exception\GuzzleException; use Psr\Http\Message\ResponseInterface; use TestHelpers\HttpRequestHelper; +use TestHelpers\WebDavHelper; use TestHelpers\SetupHelper; use TestHelpers\GraphHelper; use PHPUnit\Framework\Assert; @@ -54,6 +55,11 @@ class SpacesContext implements Context { */ private TrashbinContext $trashbinContext; + /** + * @var WebDavPropertiesContext + */ + private WebDavPropertiesContext $webDavPropertiesContext; + /** * @var string */ @@ -386,6 +392,7 @@ class SpacesContext implements Context { $this->featureContext = $environment->getContext('FeatureContext'); $this->ocsContext = $environment->getContext('OCSContext'); $this->trashbinContext = $environment->getContext('TrashbinContext'); + $this->webDavPropertiesContext = $environment->getContext('WebDavPropertiesContext'); // Run the BeforeScenario function in OCSContext to set it up correctly $this->ocsContext->before($scope); $this->baseUrl = \trim($this->featureContext->getBaseUrl(), "/"); @@ -1318,7 +1325,7 @@ class SpacesContext implements Context { ): array { $spaceId = $this->getResponseSpaceId(); //if we are using that step the second time in a scenario e.g. 'But ... should not' - //then don't parse the result again, because the result in a ResponseInterface + //then don't parse the result again, because the result is in a ResponseInterface if (empty($this->getResponseXml())) { $this->setResponseXml( HttpRequestHelper::parseResponseAsXml($this->featureContext->getResponse()) @@ -2979,4 +2986,91 @@ class SpacesContext implements Context { Assert::assertEmpty($responseArray, __METHOD__ . ' Response should be empty'); } } + + /** + * @When /^user "([^"]*)" gets the following properties of (?:file|folder|entry|resource) "([^"]*)" inside space "([^"]*)" using the WebDAV API$/ + * + * @param string $user + * @param string $resourceName + * @param string $spaceName + * @param TableNode|null $propertiesTable + * + * @return void + * + * @throws Exception|GuzzleException + */ + public function userGetsTheFollowingPropertiesOfFileInsideSpaceUsingTheWebdavApi( + string $user, + string $resourceName, + string $spaceName, + TableNode $propertiesTable + ):void { + $space = $this->getSpaceByName($user, $spaceName); + $properties = null; + $fullUrl = $space["root"]["webDavUrl"] . '/' . ltrim($resourceName, "/"); + $this->featureContext->verifyTableNodeColumns($propertiesTable, ["propertyName"]); + $this->featureContext->verifyTableNodeColumnsCount($propertiesTable, 1); + if ($propertiesTable instanceof TableNode) { + foreach ($propertiesTable->getColumnsHash() as $row) { + $properties[] = $row["propertyName"]; + } + } + $body = WebDavHelper::getBodyForPropfind($properties); + $headers['Depth'] = '1'; + $this->featureContext->setResponse( + $this->sendPropfindRequestToUrl( + $fullUrl, + $user, + $this->featureContext->getPasswordForUser($user), + '', + $headers, + $body + ) + ); + $responseXml = $this->featureContext->getResponseXml(null, __METHOD__); + $this->featureContext->setResponseXmlObject($responseXml); + } + + /** + * @Then /^as user "([^"]*)" (?:file|folder|entry|resource) "([^"]*)" inside space "([^"]*)" should contain a property "([^"]*)" with value "([^"]*)"$/ + * + * @param string $user + * @param string $resourceName + * @param string $spaceName + * @param string $property + * @param string $expectedValue + * + * @return void + * + * @throws Exception|GuzzleException + */ + public function asUserFileInsideSpaceShouldContainAPropertyWithValue( + string $user, + string $resourceName, + string $spaceName, + string $property, + string $expectedValue + ):void { + $space = $this->getSpaceByName($user, $spaceName); + $fullUrl = $space["root"]["webDavUrl"] . '/' . ltrim($resourceName, "/"); + $body = WebDavHelper::getBodyForPropfind([$property]); + $headers['Depth'] = '1'; + $this->featureContext->setResponse( + $this->sendPropfindRequestToUrl( + $fullUrl, + $user, + $this->featureContext->getPasswordForUser($user), + '', + $headers, + $body + ) + ); + $responseXml = $this->featureContext->getResponseXml(null, __METHOD__); + $this->featureContext->setResponseXmlObject($responseXml); + $this->webDavPropertiesContext->checkSingleResponseContainsAPropertyWithValueAndAlternative( + $property, + $expectedValue, + $expectedValue + ); + } } From 7c31082ed5f872e1378540f81fdd24fd33e42b16 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Thu, 11 Aug 2022 15:25:46 +0200 Subject: [PATCH 005/103] prepare release, bump version --- .../add-aliaslink-capability.md | 0 .../add-drives-endpoint-and-userfilter.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/add-resharing-env.md | 0 .../add-total-to-search-results.md | 0 .../align-service-naming.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/audit-service.md | 0 .../bump-libregraph-idm.md | 0 .../bump-ocis-package-v2.md | 0 .../change-load-config-from-only-one-dir.md | 0 .../change-ocis-docker-volume-permissions.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/change-ocis-init.md | 0 .../change-remove-runtime-kill-run-commands.md | 0 .../container-created-audit.md | 0 .../default-role-assignments.md | 0 .../deleteSpacePermissions.md | 0 .../enhancement-access-token-validation.md | 0 .../enhancement-error-by-claim.md | 0 .../enhancement-registry-cache.md | 0 .../enhancement-user-autoprovision.md | 0 .../example-deployments.md | 0 .../{unreleased => 2.0.0_2022-08-11}/exclude-services-option.md | 0 .../{unreleased => 2.0.0_2022-08-11}/feature-mail-insecure.md | 0 .../feature-optional-events-in-graph-service.md | 0 .../feature-rewrite-well-known-openid-configuration.md | 0 .../fix-align-login-attr.md | 0 .../fix-allow-empty-environment-variables | 0 .../fix-app-provider-unused-transfer-secret.md | 0 .../fix-configure-idp-secrets-env.md | 0 .../fix-csp-silent-refresh.md | 0 .../fix-debug-config-enable-by-default.md | 0 .../fix-default-role-assign.md | 0 .../fix-index-integrity.md | 0 .../fix-ldap-filter-envvar.md | 0 .../fix-ldap-insecure-options.md | 0 .../fix-ldap-invalid-users-groups.md | 0 .../fix-logging-levels.md | 0 .../fix-ocis-run-services.md | 0 .../fix-public-link-defaultname-capability | 0 .../fix-remove-legacy-accounts-routes.md | 0 .../fix-remove-unused-GRAPH_SPACES_INSECURE.md | 0 .../fix-remove-unused-config-options.md | 0 .../fix-remove-unused-ocs-backend-config.md | 0 .../fix-remove-unused-ocs-storage-config.md | 0 .../fix-search-command-server-command.md | 0 .../fix-search-grpc-addr-env.md | 0 .../fix-search-in-received-shares.md | 0 .../fix-sensitive-values-proxy-debug-config.md | 0 .../fix-settings-idm-adminuserid.md | 0 .../fix-sharee-substring-search.md | 0 .../fix-skip-validate-for-non-fullstack.md | 0 .../fix-startup-error-logging.md | 0 .../fix-storage-users-config.md | 0 .../fix-thumbnails-dav.md | 0 .../{unreleased => 2.0.0_2022-08-11}/fix-unrestricted-quota.md | 0 .../fix-user-autoprovision.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-version-info | 0 changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-version.md | 0 .../glauth-accounts-rm.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/graph-cacert.md | 0 .../graph-explorer-env-doc.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/graph-me-changepw.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/graph-me-drives.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/graph-webdav-url.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/idp-cert-wait.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/idp-default-files.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/idp-ui-update.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/improve-graph.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/ldap-escape-dn.md | 0 .../libregraph-idm-switch.md | 0 .../make-idp-only-wait-for-certs-when-using-ldap.md | 0 .../make-ocdav-service-behave.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/metadata-gateway.md | 0 .../metadatauserid-systemuserid.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/migrate-command.md | 0 .../new-space-id-functions.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/ocs-cs3-fatal.md | 0 .../ocs-version-product-field.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/polish-search.md | 0 .../prevent-access-to-disabled-space.md | 0 .../refactor-extensions-to-services.md | 0 changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/resharing.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/save-katherine.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/search-extension.md | 0 .../serviceUser-systemUser.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/share-jail-fixes.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/single-file-edit.md | 0 changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/space-id.md | 0 changelog/{unreleased => 2.0.0_2022-08-11}/space-owner.md | 0 .../spaces-capabilities.md | 0 .../special-items-improvements.md | 0 .../split-machineauth-and-systemuserauth.md | 0 .../thumbnails-env-doc.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/thumbnails-log.md | 0 .../update-linkshare-capabilities.md | 0 .../update-reva-beta.4.md | 0 .../update-reva-beta.5.md | 0 .../{unreleased => 2.0.0_2022-08-11}/update-reva-beta.6.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-reva-beta2.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-reva-beta3.md | 0 changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-reva.md | 0 .../update-web-5.5.0-beta2.md | 0 .../update-web-5.5.0-beta3.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-web-5.5.0.md | 0 .../update-web-5.7.0-rc.1-beta.4.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-web-beta.5.md | 0 changelog/{unreleased => 2.0.0_2022-08-11}/update-web-beta.6.md | 0 .../urlencoding-graph-api.md | 0 .../use-ldappassword-exop.md | 0 changelog/{unreleased => 2.0.0_2022-08-11}/user-expand-drive.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/webdav-env-doc.md | 0 .../{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/webdav-search.md | 0 changelog/CHANGELOG.tmpl | 2 +- .../continuous-deployment-config/ocis_keycloak/released.yml | 2 +- deployments/continuous-deployment-config/ocis_ldap/released.yml | 2 +- .../continuous-deployment-config/ocis_traefik/released.yml | 2 +- deployments/continuous-deployment-config/ocis_wopi/released.yml | 2 +- ocis-pkg/version/version.go | 2 +- sonar-project.properties | 2 +- 118 files changed, 7 insertions(+), 7 deletions(-) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/add-aliaslink-capability.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/add-drives-endpoint-and-userfilter.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/add-resharing-env.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/add-total-to-search-results.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/align-service-naming.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/audit-service.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/bump-libregraph-idm.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/bump-ocis-package-v2.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/change-load-config-from-only-one-dir.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/change-ocis-docker-volume-permissions.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/change-ocis-init.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/change-remove-runtime-kill-run-commands.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/container-created-audit.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/default-role-assignments.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/deleteSpacePermissions.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/enhancement-access-token-validation.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/enhancement-error-by-claim.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/enhancement-registry-cache.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/enhancement-user-autoprovision.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/example-deployments.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/exclude-services-option.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/feature-mail-insecure.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/feature-optional-events-in-graph-service.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/feature-rewrite-well-known-openid-configuration.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-align-login-attr.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-allow-empty-environment-variables (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-app-provider-unused-transfer-secret.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-configure-idp-secrets-env.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-csp-silent-refresh.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-debug-config-enable-by-default.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-default-role-assign.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-index-integrity.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-ldap-filter-envvar.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-ldap-insecure-options.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/fix-ldap-invalid-users-groups.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-logging-levels.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-ocis-run-services.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-public-link-defaultname-capability (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-remove-legacy-accounts-routes.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-remove-unused-GRAPH_SPACES_INSECURE.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-remove-unused-config-options.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-remove-unused-ocs-backend-config.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-remove-unused-ocs-storage-config.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-search-command-server-command.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-search-grpc-addr-env.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/fix-search-in-received-shares.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-sensitive-values-proxy-debug-config.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-settings-idm-adminuserid.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/fix-sharee-substring-search.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-skip-validate-for-non-fullstack.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-startup-error-logging.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-storage-users-config.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-thumbnails-dav.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/fix-unrestricted-quota.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-user-autoprovision.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-version-info (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/fix-version.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/glauth-accounts-rm.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/graph-cacert.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/graph-explorer-env-doc.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/graph-me-changepw.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/graph-me-drives.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/graph-webdav-url.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/idp-cert-wait.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/idp-default-files.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/idp-ui-update.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/improve-graph.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/ldap-escape-dn.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/libregraph-idm-switch.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/make-idp-only-wait-for-certs-when-using-ldap.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/make-ocdav-service-behave.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/metadata-gateway.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/metadatauserid-systemuserid.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/migrate-command.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/new-space-id-functions.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/ocs-cs3-fatal.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/ocs-version-product-field.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/polish-search.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/prevent-access-to-disabled-space.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/refactor-extensions-to-services.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/resharing.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/save-katherine.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/search-extension.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/serviceUser-systemUser.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/share-jail-fixes.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/single-file-edit.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/space-id.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/space-owner.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/spaces-capabilities.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/special-items-improvements.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/split-machineauth-and-systemuserauth.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/thumbnails-env-doc.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/thumbnails-log.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-linkshare-capabilities.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-reva-beta.4.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-reva-beta.5.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/update-reva-beta.6.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-reva-beta2.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-reva-beta3.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-reva.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-web-5.5.0-beta2.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-web-5.5.0-beta3.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-web-5.5.0.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-web-5.7.0-rc.1-beta.4.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/update-web-beta.5.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/update-web-beta.6.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/urlencoding-graph-api.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/use-ldappassword-exop.md (100%) rename changelog/{unreleased => 2.0.0_2022-08-11}/user-expand-drive.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/webdav-env-doc.md (100%) rename changelog/{2.0.0_2022-07-19 => 2.0.0_2022-08-11}/webdav-search.md (100%) diff --git a/changelog/2.0.0_2022-07-19/add-aliaslink-capability.md b/changelog/2.0.0_2022-08-11/add-aliaslink-capability.md similarity index 100% rename from changelog/2.0.0_2022-07-19/add-aliaslink-capability.md rename to changelog/2.0.0_2022-08-11/add-aliaslink-capability.md diff --git a/changelog/unreleased/add-drives-endpoint-and-userfilter.md b/changelog/2.0.0_2022-08-11/add-drives-endpoint-and-userfilter.md similarity index 100% rename from changelog/unreleased/add-drives-endpoint-and-userfilter.md rename to changelog/2.0.0_2022-08-11/add-drives-endpoint-and-userfilter.md diff --git a/changelog/2.0.0_2022-07-19/add-resharing-env.md b/changelog/2.0.0_2022-08-11/add-resharing-env.md similarity index 100% rename from changelog/2.0.0_2022-07-19/add-resharing-env.md rename to changelog/2.0.0_2022-08-11/add-resharing-env.md diff --git a/changelog/2.0.0_2022-07-19/add-total-to-search-results.md b/changelog/2.0.0_2022-08-11/add-total-to-search-results.md similarity index 100% rename from changelog/2.0.0_2022-07-19/add-total-to-search-results.md rename to changelog/2.0.0_2022-08-11/add-total-to-search-results.md diff --git a/changelog/2.0.0_2022-07-19/align-service-naming.md b/changelog/2.0.0_2022-08-11/align-service-naming.md similarity index 100% rename from changelog/2.0.0_2022-07-19/align-service-naming.md rename to changelog/2.0.0_2022-08-11/align-service-naming.md diff --git a/changelog/2.0.0_2022-07-19/audit-service.md b/changelog/2.0.0_2022-08-11/audit-service.md similarity index 100% rename from changelog/2.0.0_2022-07-19/audit-service.md rename to changelog/2.0.0_2022-08-11/audit-service.md diff --git a/changelog/2.0.0_2022-07-19/bump-libregraph-idm.md b/changelog/2.0.0_2022-08-11/bump-libregraph-idm.md similarity index 100% rename from changelog/2.0.0_2022-07-19/bump-libregraph-idm.md rename to changelog/2.0.0_2022-08-11/bump-libregraph-idm.md diff --git a/changelog/2.0.0_2022-07-19/bump-ocis-package-v2.md b/changelog/2.0.0_2022-08-11/bump-ocis-package-v2.md similarity index 100% rename from changelog/2.0.0_2022-07-19/bump-ocis-package-v2.md rename to changelog/2.0.0_2022-08-11/bump-ocis-package-v2.md diff --git a/changelog/2.0.0_2022-07-19/change-load-config-from-only-one-dir.md b/changelog/2.0.0_2022-08-11/change-load-config-from-only-one-dir.md similarity index 100% rename from changelog/2.0.0_2022-07-19/change-load-config-from-only-one-dir.md rename to changelog/2.0.0_2022-08-11/change-load-config-from-only-one-dir.md diff --git a/changelog/2.0.0_2022-07-19/change-ocis-docker-volume-permissions.md b/changelog/2.0.0_2022-08-11/change-ocis-docker-volume-permissions.md similarity index 100% rename from changelog/2.0.0_2022-07-19/change-ocis-docker-volume-permissions.md rename to changelog/2.0.0_2022-08-11/change-ocis-docker-volume-permissions.md diff --git a/changelog/2.0.0_2022-07-19/change-ocis-init.md b/changelog/2.0.0_2022-08-11/change-ocis-init.md similarity index 100% rename from changelog/2.0.0_2022-07-19/change-ocis-init.md rename to changelog/2.0.0_2022-08-11/change-ocis-init.md diff --git a/changelog/2.0.0_2022-07-19/change-remove-runtime-kill-run-commands.md b/changelog/2.0.0_2022-08-11/change-remove-runtime-kill-run-commands.md similarity index 100% rename from changelog/2.0.0_2022-07-19/change-remove-runtime-kill-run-commands.md rename to changelog/2.0.0_2022-08-11/change-remove-runtime-kill-run-commands.md diff --git a/changelog/2.0.0_2022-07-19/container-created-audit.md b/changelog/2.0.0_2022-08-11/container-created-audit.md similarity index 100% rename from changelog/2.0.0_2022-07-19/container-created-audit.md rename to changelog/2.0.0_2022-08-11/container-created-audit.md diff --git a/changelog/2.0.0_2022-07-19/default-role-assignments.md b/changelog/2.0.0_2022-08-11/default-role-assignments.md similarity index 100% rename from changelog/2.0.0_2022-07-19/default-role-assignments.md rename to changelog/2.0.0_2022-08-11/default-role-assignments.md diff --git a/changelog/2.0.0_2022-07-19/deleteSpacePermissions.md b/changelog/2.0.0_2022-08-11/deleteSpacePermissions.md similarity index 100% rename from changelog/2.0.0_2022-07-19/deleteSpacePermissions.md rename to changelog/2.0.0_2022-08-11/deleteSpacePermissions.md diff --git a/changelog/unreleased/enhancement-access-token-validation.md b/changelog/2.0.0_2022-08-11/enhancement-access-token-validation.md similarity index 100% rename from changelog/unreleased/enhancement-access-token-validation.md rename to changelog/2.0.0_2022-08-11/enhancement-access-token-validation.md diff --git a/changelog/unreleased/enhancement-error-by-claim.md b/changelog/2.0.0_2022-08-11/enhancement-error-by-claim.md similarity index 100% rename from changelog/unreleased/enhancement-error-by-claim.md rename to changelog/2.0.0_2022-08-11/enhancement-error-by-claim.md diff --git a/changelog/2.0.0_2022-07-19/enhancement-registry-cache.md b/changelog/2.0.0_2022-08-11/enhancement-registry-cache.md similarity index 100% rename from changelog/2.0.0_2022-07-19/enhancement-registry-cache.md rename to changelog/2.0.0_2022-08-11/enhancement-registry-cache.md diff --git a/changelog/2.0.0_2022-07-19/enhancement-user-autoprovision.md b/changelog/2.0.0_2022-08-11/enhancement-user-autoprovision.md similarity index 100% rename from changelog/2.0.0_2022-07-19/enhancement-user-autoprovision.md rename to changelog/2.0.0_2022-08-11/enhancement-user-autoprovision.md diff --git a/changelog/2.0.0_2022-07-19/example-deployments.md b/changelog/2.0.0_2022-08-11/example-deployments.md similarity index 100% rename from changelog/2.0.0_2022-07-19/example-deployments.md rename to changelog/2.0.0_2022-08-11/example-deployments.md diff --git a/changelog/unreleased/exclude-services-option.md b/changelog/2.0.0_2022-08-11/exclude-services-option.md similarity index 100% rename from changelog/unreleased/exclude-services-option.md rename to changelog/2.0.0_2022-08-11/exclude-services-option.md diff --git a/changelog/unreleased/feature-mail-insecure.md b/changelog/2.0.0_2022-08-11/feature-mail-insecure.md similarity index 100% rename from changelog/unreleased/feature-mail-insecure.md rename to changelog/2.0.0_2022-08-11/feature-mail-insecure.md diff --git a/changelog/2.0.0_2022-07-19/feature-optional-events-in-graph-service.md b/changelog/2.0.0_2022-08-11/feature-optional-events-in-graph-service.md similarity index 100% rename from changelog/2.0.0_2022-07-19/feature-optional-events-in-graph-service.md rename to changelog/2.0.0_2022-08-11/feature-optional-events-in-graph-service.md diff --git a/changelog/unreleased/feature-rewrite-well-known-openid-configuration.md b/changelog/2.0.0_2022-08-11/feature-rewrite-well-known-openid-configuration.md similarity index 100% rename from changelog/unreleased/feature-rewrite-well-known-openid-configuration.md rename to changelog/2.0.0_2022-08-11/feature-rewrite-well-known-openid-configuration.md diff --git a/changelog/2.0.0_2022-07-19/fix-align-login-attr.md b/changelog/2.0.0_2022-08-11/fix-align-login-attr.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-align-login-attr.md rename to changelog/2.0.0_2022-08-11/fix-align-login-attr.md diff --git a/changelog/2.0.0_2022-07-19/fix-allow-empty-environment-variables b/changelog/2.0.0_2022-08-11/fix-allow-empty-environment-variables similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-allow-empty-environment-variables rename to changelog/2.0.0_2022-08-11/fix-allow-empty-environment-variables diff --git a/changelog/2.0.0_2022-07-19/fix-app-provider-unused-transfer-secret.md b/changelog/2.0.0_2022-08-11/fix-app-provider-unused-transfer-secret.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-app-provider-unused-transfer-secret.md rename to changelog/2.0.0_2022-08-11/fix-app-provider-unused-transfer-secret.md diff --git a/changelog/2.0.0_2022-07-19/fix-configure-idp-secrets-env.md b/changelog/2.0.0_2022-08-11/fix-configure-idp-secrets-env.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-configure-idp-secrets-env.md rename to changelog/2.0.0_2022-08-11/fix-configure-idp-secrets-env.md diff --git a/changelog/2.0.0_2022-07-19/fix-csp-silent-refresh.md b/changelog/2.0.0_2022-08-11/fix-csp-silent-refresh.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-csp-silent-refresh.md rename to changelog/2.0.0_2022-08-11/fix-csp-silent-refresh.md diff --git a/changelog/2.0.0_2022-07-19/fix-debug-config-enable-by-default.md b/changelog/2.0.0_2022-08-11/fix-debug-config-enable-by-default.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-debug-config-enable-by-default.md rename to changelog/2.0.0_2022-08-11/fix-debug-config-enable-by-default.md diff --git a/changelog/2.0.0_2022-07-19/fix-default-role-assign.md b/changelog/2.0.0_2022-08-11/fix-default-role-assign.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-default-role-assign.md rename to changelog/2.0.0_2022-08-11/fix-default-role-assign.md diff --git a/changelog/2.0.0_2022-07-19/fix-index-integrity.md b/changelog/2.0.0_2022-08-11/fix-index-integrity.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-index-integrity.md rename to changelog/2.0.0_2022-08-11/fix-index-integrity.md diff --git a/changelog/2.0.0_2022-07-19/fix-ldap-filter-envvar.md b/changelog/2.0.0_2022-08-11/fix-ldap-filter-envvar.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-ldap-filter-envvar.md rename to changelog/2.0.0_2022-08-11/fix-ldap-filter-envvar.md diff --git a/changelog/2.0.0_2022-07-19/fix-ldap-insecure-options.md b/changelog/2.0.0_2022-08-11/fix-ldap-insecure-options.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-ldap-insecure-options.md rename to changelog/2.0.0_2022-08-11/fix-ldap-insecure-options.md diff --git a/changelog/unreleased/fix-ldap-invalid-users-groups.md b/changelog/2.0.0_2022-08-11/fix-ldap-invalid-users-groups.md similarity index 100% rename from changelog/unreleased/fix-ldap-invalid-users-groups.md rename to changelog/2.0.0_2022-08-11/fix-ldap-invalid-users-groups.md diff --git a/changelog/2.0.0_2022-07-19/fix-logging-levels.md b/changelog/2.0.0_2022-08-11/fix-logging-levels.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-logging-levels.md rename to changelog/2.0.0_2022-08-11/fix-logging-levels.md diff --git a/changelog/2.0.0_2022-07-19/fix-ocis-run-services.md b/changelog/2.0.0_2022-08-11/fix-ocis-run-services.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-ocis-run-services.md rename to changelog/2.0.0_2022-08-11/fix-ocis-run-services.md diff --git a/changelog/2.0.0_2022-07-19/fix-public-link-defaultname-capability b/changelog/2.0.0_2022-08-11/fix-public-link-defaultname-capability similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-public-link-defaultname-capability rename to changelog/2.0.0_2022-08-11/fix-public-link-defaultname-capability diff --git a/changelog/2.0.0_2022-07-19/fix-remove-legacy-accounts-routes.md b/changelog/2.0.0_2022-08-11/fix-remove-legacy-accounts-routes.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-remove-legacy-accounts-routes.md rename to changelog/2.0.0_2022-08-11/fix-remove-legacy-accounts-routes.md diff --git a/changelog/2.0.0_2022-07-19/fix-remove-unused-GRAPH_SPACES_INSECURE.md b/changelog/2.0.0_2022-08-11/fix-remove-unused-GRAPH_SPACES_INSECURE.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-remove-unused-GRAPH_SPACES_INSECURE.md rename to changelog/2.0.0_2022-08-11/fix-remove-unused-GRAPH_SPACES_INSECURE.md diff --git a/changelog/2.0.0_2022-07-19/fix-remove-unused-config-options.md b/changelog/2.0.0_2022-08-11/fix-remove-unused-config-options.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-remove-unused-config-options.md rename to changelog/2.0.0_2022-08-11/fix-remove-unused-config-options.md diff --git a/changelog/2.0.0_2022-07-19/fix-remove-unused-ocs-backend-config.md b/changelog/2.0.0_2022-08-11/fix-remove-unused-ocs-backend-config.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-remove-unused-ocs-backend-config.md rename to changelog/2.0.0_2022-08-11/fix-remove-unused-ocs-backend-config.md diff --git a/changelog/2.0.0_2022-07-19/fix-remove-unused-ocs-storage-config.md b/changelog/2.0.0_2022-08-11/fix-remove-unused-ocs-storage-config.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-remove-unused-ocs-storage-config.md rename to changelog/2.0.0_2022-08-11/fix-remove-unused-ocs-storage-config.md diff --git a/changelog/2.0.0_2022-07-19/fix-search-command-server-command.md b/changelog/2.0.0_2022-08-11/fix-search-command-server-command.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-search-command-server-command.md rename to changelog/2.0.0_2022-08-11/fix-search-command-server-command.md diff --git a/changelog/2.0.0_2022-07-19/fix-search-grpc-addr-env.md b/changelog/2.0.0_2022-08-11/fix-search-grpc-addr-env.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-search-grpc-addr-env.md rename to changelog/2.0.0_2022-08-11/fix-search-grpc-addr-env.md diff --git a/changelog/unreleased/fix-search-in-received-shares.md b/changelog/2.0.0_2022-08-11/fix-search-in-received-shares.md similarity index 100% rename from changelog/unreleased/fix-search-in-received-shares.md rename to changelog/2.0.0_2022-08-11/fix-search-in-received-shares.md diff --git a/changelog/2.0.0_2022-07-19/fix-sensitive-values-proxy-debug-config.md b/changelog/2.0.0_2022-08-11/fix-sensitive-values-proxy-debug-config.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-sensitive-values-proxy-debug-config.md rename to changelog/2.0.0_2022-08-11/fix-sensitive-values-proxy-debug-config.md diff --git a/changelog/2.0.0_2022-07-19/fix-settings-idm-adminuserid.md b/changelog/2.0.0_2022-08-11/fix-settings-idm-adminuserid.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-settings-idm-adminuserid.md rename to changelog/2.0.0_2022-08-11/fix-settings-idm-adminuserid.md diff --git a/changelog/unreleased/fix-sharee-substring-search.md b/changelog/2.0.0_2022-08-11/fix-sharee-substring-search.md similarity index 100% rename from changelog/unreleased/fix-sharee-substring-search.md rename to changelog/2.0.0_2022-08-11/fix-sharee-substring-search.md diff --git a/changelog/2.0.0_2022-07-19/fix-skip-validate-for-non-fullstack.md b/changelog/2.0.0_2022-08-11/fix-skip-validate-for-non-fullstack.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-skip-validate-for-non-fullstack.md rename to changelog/2.0.0_2022-08-11/fix-skip-validate-for-non-fullstack.md diff --git a/changelog/2.0.0_2022-07-19/fix-startup-error-logging.md b/changelog/2.0.0_2022-08-11/fix-startup-error-logging.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-startup-error-logging.md rename to changelog/2.0.0_2022-08-11/fix-startup-error-logging.md diff --git a/changelog/2.0.0_2022-07-19/fix-storage-users-config.md b/changelog/2.0.0_2022-08-11/fix-storage-users-config.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-storage-users-config.md rename to changelog/2.0.0_2022-08-11/fix-storage-users-config.md diff --git a/changelog/2.0.0_2022-07-19/fix-thumbnails-dav.md b/changelog/2.0.0_2022-08-11/fix-thumbnails-dav.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-thumbnails-dav.md rename to changelog/2.0.0_2022-08-11/fix-thumbnails-dav.md diff --git a/changelog/unreleased/fix-unrestricted-quota.md b/changelog/2.0.0_2022-08-11/fix-unrestricted-quota.md similarity index 100% rename from changelog/unreleased/fix-unrestricted-quota.md rename to changelog/2.0.0_2022-08-11/fix-unrestricted-quota.md diff --git a/changelog/2.0.0_2022-07-19/fix-user-autoprovision.md b/changelog/2.0.0_2022-08-11/fix-user-autoprovision.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-user-autoprovision.md rename to changelog/2.0.0_2022-08-11/fix-user-autoprovision.md diff --git a/changelog/2.0.0_2022-07-19/fix-version-info b/changelog/2.0.0_2022-08-11/fix-version-info similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-version-info rename to changelog/2.0.0_2022-08-11/fix-version-info diff --git a/changelog/2.0.0_2022-07-19/fix-version.md b/changelog/2.0.0_2022-08-11/fix-version.md similarity index 100% rename from changelog/2.0.0_2022-07-19/fix-version.md rename to changelog/2.0.0_2022-08-11/fix-version.md diff --git a/changelog/2.0.0_2022-07-19/glauth-accounts-rm.md b/changelog/2.0.0_2022-08-11/glauth-accounts-rm.md similarity index 100% rename from changelog/2.0.0_2022-07-19/glauth-accounts-rm.md rename to changelog/2.0.0_2022-08-11/glauth-accounts-rm.md diff --git a/changelog/2.0.0_2022-07-19/graph-cacert.md b/changelog/2.0.0_2022-08-11/graph-cacert.md similarity index 100% rename from changelog/2.0.0_2022-07-19/graph-cacert.md rename to changelog/2.0.0_2022-08-11/graph-cacert.md diff --git a/changelog/2.0.0_2022-07-19/graph-explorer-env-doc.md b/changelog/2.0.0_2022-08-11/graph-explorer-env-doc.md similarity index 100% rename from changelog/2.0.0_2022-07-19/graph-explorer-env-doc.md rename to changelog/2.0.0_2022-08-11/graph-explorer-env-doc.md diff --git a/changelog/2.0.0_2022-07-19/graph-me-changepw.md b/changelog/2.0.0_2022-08-11/graph-me-changepw.md similarity index 100% rename from changelog/2.0.0_2022-07-19/graph-me-changepw.md rename to changelog/2.0.0_2022-08-11/graph-me-changepw.md diff --git a/changelog/2.0.0_2022-07-19/graph-me-drives.md b/changelog/2.0.0_2022-08-11/graph-me-drives.md similarity index 100% rename from changelog/2.0.0_2022-07-19/graph-me-drives.md rename to changelog/2.0.0_2022-08-11/graph-me-drives.md diff --git a/changelog/2.0.0_2022-07-19/graph-webdav-url.md b/changelog/2.0.0_2022-08-11/graph-webdav-url.md similarity index 100% rename from changelog/2.0.0_2022-07-19/graph-webdav-url.md rename to changelog/2.0.0_2022-08-11/graph-webdav-url.md diff --git a/changelog/2.0.0_2022-07-19/idp-cert-wait.md b/changelog/2.0.0_2022-08-11/idp-cert-wait.md similarity index 100% rename from changelog/2.0.0_2022-07-19/idp-cert-wait.md rename to changelog/2.0.0_2022-08-11/idp-cert-wait.md diff --git a/changelog/2.0.0_2022-07-19/idp-default-files.md b/changelog/2.0.0_2022-08-11/idp-default-files.md similarity index 100% rename from changelog/2.0.0_2022-07-19/idp-default-files.md rename to changelog/2.0.0_2022-08-11/idp-default-files.md diff --git a/changelog/2.0.0_2022-07-19/idp-ui-update.md b/changelog/2.0.0_2022-08-11/idp-ui-update.md similarity index 100% rename from changelog/2.0.0_2022-07-19/idp-ui-update.md rename to changelog/2.0.0_2022-08-11/idp-ui-update.md diff --git a/changelog/2.0.0_2022-07-19/improve-graph.md b/changelog/2.0.0_2022-08-11/improve-graph.md similarity index 100% rename from changelog/2.0.0_2022-07-19/improve-graph.md rename to changelog/2.0.0_2022-08-11/improve-graph.md diff --git a/changelog/2.0.0_2022-07-19/ldap-escape-dn.md b/changelog/2.0.0_2022-08-11/ldap-escape-dn.md similarity index 100% rename from changelog/2.0.0_2022-07-19/ldap-escape-dn.md rename to changelog/2.0.0_2022-08-11/ldap-escape-dn.md diff --git a/changelog/2.0.0_2022-07-19/libregraph-idm-switch.md b/changelog/2.0.0_2022-08-11/libregraph-idm-switch.md similarity index 100% rename from changelog/2.0.0_2022-07-19/libregraph-idm-switch.md rename to changelog/2.0.0_2022-08-11/libregraph-idm-switch.md diff --git a/changelog/2.0.0_2022-07-19/make-idp-only-wait-for-certs-when-using-ldap.md b/changelog/2.0.0_2022-08-11/make-idp-only-wait-for-certs-when-using-ldap.md similarity index 100% rename from changelog/2.0.0_2022-07-19/make-idp-only-wait-for-certs-when-using-ldap.md rename to changelog/2.0.0_2022-08-11/make-idp-only-wait-for-certs-when-using-ldap.md diff --git a/changelog/2.0.0_2022-07-19/make-ocdav-service-behave.md b/changelog/2.0.0_2022-08-11/make-ocdav-service-behave.md similarity index 100% rename from changelog/2.0.0_2022-07-19/make-ocdav-service-behave.md rename to changelog/2.0.0_2022-08-11/make-ocdav-service-behave.md diff --git a/changelog/2.0.0_2022-07-19/metadata-gateway.md b/changelog/2.0.0_2022-08-11/metadata-gateway.md similarity index 100% rename from changelog/2.0.0_2022-07-19/metadata-gateway.md rename to changelog/2.0.0_2022-08-11/metadata-gateway.md diff --git a/changelog/2.0.0_2022-07-19/metadatauserid-systemuserid.md b/changelog/2.0.0_2022-08-11/metadatauserid-systemuserid.md similarity index 100% rename from changelog/2.0.0_2022-07-19/metadatauserid-systemuserid.md rename to changelog/2.0.0_2022-08-11/metadatauserid-systemuserid.md diff --git a/changelog/2.0.0_2022-07-19/migrate-command.md b/changelog/2.0.0_2022-08-11/migrate-command.md similarity index 100% rename from changelog/2.0.0_2022-07-19/migrate-command.md rename to changelog/2.0.0_2022-08-11/migrate-command.md diff --git a/changelog/2.0.0_2022-07-19/new-space-id-functions.md b/changelog/2.0.0_2022-08-11/new-space-id-functions.md similarity index 100% rename from changelog/2.0.0_2022-07-19/new-space-id-functions.md rename to changelog/2.0.0_2022-08-11/new-space-id-functions.md diff --git a/changelog/2.0.0_2022-07-19/ocs-cs3-fatal.md b/changelog/2.0.0_2022-08-11/ocs-cs3-fatal.md similarity index 100% rename from changelog/2.0.0_2022-07-19/ocs-cs3-fatal.md rename to changelog/2.0.0_2022-08-11/ocs-cs3-fatal.md diff --git a/changelog/2.0.0_2022-07-19/ocs-version-product-field.md b/changelog/2.0.0_2022-08-11/ocs-version-product-field.md similarity index 100% rename from changelog/2.0.0_2022-07-19/ocs-version-product-field.md rename to changelog/2.0.0_2022-08-11/ocs-version-product-field.md diff --git a/changelog/2.0.0_2022-07-19/polish-search.md b/changelog/2.0.0_2022-08-11/polish-search.md similarity index 100% rename from changelog/2.0.0_2022-07-19/polish-search.md rename to changelog/2.0.0_2022-08-11/polish-search.md diff --git a/changelog/2.0.0_2022-07-19/prevent-access-to-disabled-space.md b/changelog/2.0.0_2022-08-11/prevent-access-to-disabled-space.md similarity index 100% rename from changelog/2.0.0_2022-07-19/prevent-access-to-disabled-space.md rename to changelog/2.0.0_2022-08-11/prevent-access-to-disabled-space.md diff --git a/changelog/2.0.0_2022-07-19/refactor-extensions-to-services.md b/changelog/2.0.0_2022-08-11/refactor-extensions-to-services.md similarity index 100% rename from changelog/2.0.0_2022-07-19/refactor-extensions-to-services.md rename to changelog/2.0.0_2022-08-11/refactor-extensions-to-services.md diff --git a/changelog/2.0.0_2022-07-19/resharing.md b/changelog/2.0.0_2022-08-11/resharing.md similarity index 100% rename from changelog/2.0.0_2022-07-19/resharing.md rename to changelog/2.0.0_2022-08-11/resharing.md diff --git a/changelog/2.0.0_2022-07-19/save-katherine.md b/changelog/2.0.0_2022-08-11/save-katherine.md similarity index 100% rename from changelog/2.0.0_2022-07-19/save-katherine.md rename to changelog/2.0.0_2022-08-11/save-katherine.md diff --git a/changelog/2.0.0_2022-07-19/search-extension.md b/changelog/2.0.0_2022-08-11/search-extension.md similarity index 100% rename from changelog/2.0.0_2022-07-19/search-extension.md rename to changelog/2.0.0_2022-08-11/search-extension.md diff --git a/changelog/2.0.0_2022-07-19/serviceUser-systemUser.md b/changelog/2.0.0_2022-08-11/serviceUser-systemUser.md similarity index 100% rename from changelog/2.0.0_2022-07-19/serviceUser-systemUser.md rename to changelog/2.0.0_2022-08-11/serviceUser-systemUser.md diff --git a/changelog/2.0.0_2022-07-19/share-jail-fixes.md b/changelog/2.0.0_2022-08-11/share-jail-fixes.md similarity index 100% rename from changelog/2.0.0_2022-07-19/share-jail-fixes.md rename to changelog/2.0.0_2022-08-11/share-jail-fixes.md diff --git a/changelog/2.0.0_2022-07-19/single-file-edit.md b/changelog/2.0.0_2022-08-11/single-file-edit.md similarity index 100% rename from changelog/2.0.0_2022-07-19/single-file-edit.md rename to changelog/2.0.0_2022-08-11/single-file-edit.md diff --git a/changelog/2.0.0_2022-07-19/space-id.md b/changelog/2.0.0_2022-08-11/space-id.md similarity index 100% rename from changelog/2.0.0_2022-07-19/space-id.md rename to changelog/2.0.0_2022-08-11/space-id.md diff --git a/changelog/unreleased/space-owner.md b/changelog/2.0.0_2022-08-11/space-owner.md similarity index 100% rename from changelog/unreleased/space-owner.md rename to changelog/2.0.0_2022-08-11/space-owner.md diff --git a/changelog/2.0.0_2022-07-19/spaces-capabilities.md b/changelog/2.0.0_2022-08-11/spaces-capabilities.md similarity index 100% rename from changelog/2.0.0_2022-07-19/spaces-capabilities.md rename to changelog/2.0.0_2022-08-11/spaces-capabilities.md diff --git a/changelog/unreleased/special-items-improvements.md b/changelog/2.0.0_2022-08-11/special-items-improvements.md similarity index 100% rename from changelog/unreleased/special-items-improvements.md rename to changelog/2.0.0_2022-08-11/special-items-improvements.md diff --git a/changelog/2.0.0_2022-07-19/split-machineauth-and-systemuserauth.md b/changelog/2.0.0_2022-08-11/split-machineauth-and-systemuserauth.md similarity index 100% rename from changelog/2.0.0_2022-07-19/split-machineauth-and-systemuserauth.md rename to changelog/2.0.0_2022-08-11/split-machineauth-and-systemuserauth.md diff --git a/changelog/2.0.0_2022-07-19/thumbnails-env-doc.md b/changelog/2.0.0_2022-08-11/thumbnails-env-doc.md similarity index 100% rename from changelog/2.0.0_2022-07-19/thumbnails-env-doc.md rename to changelog/2.0.0_2022-08-11/thumbnails-env-doc.md diff --git a/changelog/2.0.0_2022-07-19/thumbnails-log.md b/changelog/2.0.0_2022-08-11/thumbnails-log.md similarity index 100% rename from changelog/2.0.0_2022-07-19/thumbnails-log.md rename to changelog/2.0.0_2022-08-11/thumbnails-log.md diff --git a/changelog/2.0.0_2022-07-19/update-linkshare-capabilities.md b/changelog/2.0.0_2022-08-11/update-linkshare-capabilities.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-linkshare-capabilities.md rename to changelog/2.0.0_2022-08-11/update-linkshare-capabilities.md diff --git a/changelog/2.0.0_2022-07-19/update-reva-beta.4.md b/changelog/2.0.0_2022-08-11/update-reva-beta.4.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-reva-beta.4.md rename to changelog/2.0.0_2022-08-11/update-reva-beta.4.md diff --git a/changelog/2.0.0_2022-07-19/update-reva-beta.5.md b/changelog/2.0.0_2022-08-11/update-reva-beta.5.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-reva-beta.5.md rename to changelog/2.0.0_2022-08-11/update-reva-beta.5.md diff --git a/changelog/unreleased/update-reva-beta.6.md b/changelog/2.0.0_2022-08-11/update-reva-beta.6.md similarity index 100% rename from changelog/unreleased/update-reva-beta.6.md rename to changelog/2.0.0_2022-08-11/update-reva-beta.6.md diff --git a/changelog/2.0.0_2022-07-19/update-reva-beta2.md b/changelog/2.0.0_2022-08-11/update-reva-beta2.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-reva-beta2.md rename to changelog/2.0.0_2022-08-11/update-reva-beta2.md diff --git a/changelog/2.0.0_2022-07-19/update-reva-beta3.md b/changelog/2.0.0_2022-08-11/update-reva-beta3.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-reva-beta3.md rename to changelog/2.0.0_2022-08-11/update-reva-beta3.md diff --git a/changelog/2.0.0_2022-07-19/update-reva.md b/changelog/2.0.0_2022-08-11/update-reva.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-reva.md rename to changelog/2.0.0_2022-08-11/update-reva.md diff --git a/changelog/2.0.0_2022-07-19/update-web-5.5.0-beta2.md b/changelog/2.0.0_2022-08-11/update-web-5.5.0-beta2.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-web-5.5.0-beta2.md rename to changelog/2.0.0_2022-08-11/update-web-5.5.0-beta2.md diff --git a/changelog/2.0.0_2022-07-19/update-web-5.5.0-beta3.md b/changelog/2.0.0_2022-08-11/update-web-5.5.0-beta3.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-web-5.5.0-beta3.md rename to changelog/2.0.0_2022-08-11/update-web-5.5.0-beta3.md diff --git a/changelog/2.0.0_2022-07-19/update-web-5.5.0.md b/changelog/2.0.0_2022-08-11/update-web-5.5.0.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-web-5.5.0.md rename to changelog/2.0.0_2022-08-11/update-web-5.5.0.md diff --git a/changelog/2.0.0_2022-07-19/update-web-5.7.0-rc.1-beta.4.md b/changelog/2.0.0_2022-08-11/update-web-5.7.0-rc.1-beta.4.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-web-5.7.0-rc.1-beta.4.md rename to changelog/2.0.0_2022-08-11/update-web-5.7.0-rc.1-beta.4.md diff --git a/changelog/2.0.0_2022-07-19/update-web-beta.5.md b/changelog/2.0.0_2022-08-11/update-web-beta.5.md similarity index 100% rename from changelog/2.0.0_2022-07-19/update-web-beta.5.md rename to changelog/2.0.0_2022-08-11/update-web-beta.5.md diff --git a/changelog/unreleased/update-web-beta.6.md b/changelog/2.0.0_2022-08-11/update-web-beta.6.md similarity index 100% rename from changelog/unreleased/update-web-beta.6.md rename to changelog/2.0.0_2022-08-11/update-web-beta.6.md diff --git a/changelog/2.0.0_2022-07-19/urlencoding-graph-api.md b/changelog/2.0.0_2022-08-11/urlencoding-graph-api.md similarity index 100% rename from changelog/2.0.0_2022-07-19/urlencoding-graph-api.md rename to changelog/2.0.0_2022-08-11/urlencoding-graph-api.md diff --git a/changelog/2.0.0_2022-07-19/use-ldappassword-exop.md b/changelog/2.0.0_2022-08-11/use-ldappassword-exop.md similarity index 100% rename from changelog/2.0.0_2022-07-19/use-ldappassword-exop.md rename to changelog/2.0.0_2022-08-11/use-ldappassword-exop.md diff --git a/changelog/unreleased/user-expand-drive.md b/changelog/2.0.0_2022-08-11/user-expand-drive.md similarity index 100% rename from changelog/unreleased/user-expand-drive.md rename to changelog/2.0.0_2022-08-11/user-expand-drive.md diff --git a/changelog/2.0.0_2022-07-19/webdav-env-doc.md b/changelog/2.0.0_2022-08-11/webdav-env-doc.md similarity index 100% rename from changelog/2.0.0_2022-07-19/webdav-env-doc.md rename to changelog/2.0.0_2022-08-11/webdav-env-doc.md diff --git a/changelog/2.0.0_2022-07-19/webdav-search.md b/changelog/2.0.0_2022-08-11/webdav-search.md similarity index 100% rename from changelog/2.0.0_2022-07-19/webdav-search.md rename to changelog/2.0.0_2022-08-11/webdav-search.md diff --git a/changelog/CHANGELOG.tmpl b/changelog/CHANGELOG.tmpl index 1452f7f480..dd0a2dd573 100644 --- a/changelog/CHANGELOG.tmpl +++ b/changelog/CHANGELOG.tmpl @@ -3,7 +3,7 @@ {{ $version := .Version -}} {{/* ocis beta program */ -}} {{ if eq .Version "2.0.0" -}} -{{ $version = (printf "%v-%v" $version "beta.5") -}} +{{ $version = (printf "%v-%v" $version "beta.6") -}} {{ end -}} {{ if gt (len $allVersions) 1 -}} # Changelog for [{{ $version }}] ({{ .Date }}) diff --git a/deployments/continuous-deployment-config/ocis_keycloak/released.yml b/deployments/continuous-deployment-config/ocis_keycloak/released.yml index d5d69cb820..06882388cd 100644 --- a/deployments/continuous-deployment-config/ocis_keycloak/released.yml +++ b/deployments/continuous-deployment-config/ocis_keycloak/released.yml @@ -32,7 +32,7 @@ env: INSECURE: "false" TRAEFIK_ACME_MAIL: wkloucek@owncloud.com - OCIS_DOCKER_TAG: 2.0.0-beta.5 + OCIS_DOCKER_TAG: 2.0.0-beta.6 OCIS_DOMAIN: ocis.ocis-keycloak.released.owncloud.works KEYCLOAK_DOMAIN: keycloak.ocis-keycloak.released.owncloud.works COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/continuous-deployment-config/ocis_ldap/released.yml b/deployments/continuous-deployment-config/ocis_ldap/released.yml index 6f4f5c2786..d805c280dc 100644 --- a/deployments/continuous-deployment-config/ocis_ldap/released.yml +++ b/deployments/continuous-deployment-config/ocis_ldap/released.yml @@ -32,7 +32,7 @@ env: INSECURE: "false" TRAEFIK_ACME_MAIL: wkloucek@owncloud.com - OCIS_DOCKER_TAG: 2.0.0-beta.5 + OCIS_DOCKER_TAG: 2.0.0-beta.6 OCIS_DOMAIN: ocis.ocis-ldap.released.owncloud.works LDAP_MANAGER_DOMAIN: ldap.ocis-ldap.released.owncloud.works COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/continuous-deployment-config/ocis_traefik/released.yml b/deployments/continuous-deployment-config/ocis_traefik/released.yml index 3aad41f506..2d111a3527 100644 --- a/deployments/continuous-deployment-config/ocis_traefik/released.yml +++ b/deployments/continuous-deployment-config/ocis_traefik/released.yml @@ -32,7 +32,7 @@ env: INSECURE: "false" TRAEFIK_ACME_MAIL: wkloucek@owncloud.com - OCIS_DOCKER_TAG: 2.0.0-beta.5 + OCIS_DOCKER_TAG: 2.0.0-beta.6 OCIS_DOMAIN: ocis.ocis-traefik.released.owncloud.works DEMO_USERS: "true" INBUCKET_DOMAIN: mail.ocis-traefik.released.owncloud.works diff --git a/deployments/continuous-deployment-config/ocis_wopi/released.yml b/deployments/continuous-deployment-config/ocis_wopi/released.yml index dda29e4ef9..b2fd4ad4d6 100644 --- a/deployments/continuous-deployment-config/ocis_wopi/released.yml +++ b/deployments/continuous-deployment-config/ocis_wopi/released.yml @@ -32,7 +32,7 @@ env: INSECURE: "false" TRAEFIK_ACME_MAIL: wkloucek@owncloud.com - OCIS_DOCKER_TAG: 2.0.0-beta.5 + OCIS_DOCKER_TAG: 2.0.0-beta.6 OCIS_DOMAIN: ocis.ocis-wopi.released.owncloud.works WOPISERVER_DOMAIN: wopiserver.ocis-wopi.released.owncloud.works COLLABORA_DOMAIN: collabora.ocis-wopi.released.owncloud.works diff --git a/ocis-pkg/version/version.go b/ocis-pkg/version/version.go index b506bf2778..3bec98f9d6 100644 --- a/ocis-pkg/version/version.go +++ b/ocis-pkg/version/version.go @@ -16,7 +16,7 @@ var ( // LatestTag is the latest released version plus the dev meta version. // Will be overwritten by the release pipeline // Needs a manual change for every tagged release - LatestTag = "2.0.0-beta.5+dev" + LatestTag = "2.0.0-beta.6+dev" // Date indicates the build date. Date = time.Now().Format("20060102") diff --git a/sonar-project.properties b/sonar-project.properties index 3b8fe3f80d..e3ccc2ac9d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,7 +2,7 @@ sonar.projectKey=owncloud_ocis sonar.organization=owncloud-1 sonar.projectName=ocis -sonar.projectVersion=2.0.0-beta.5 +sonar.projectVersion=2.0.0-beta.6 sonar.host.url=https://sonarcloud.io # ===================================================== From 1484849303f6cbeaf0e6a283ed8ef7ce76eaa699 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Thu, 11 Aug 2022 16:18:10 +0200 Subject: [PATCH 006/103] fix release pipeline (skip-ci) --- .drone.star | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.star b/.drone.star index c0638c2fd7..ad8af2a553 100644 --- a/.drone.star +++ b/.drone.star @@ -891,6 +891,8 @@ def e2eTests(ctx): "volumes": e2e_volumes, }] + return [] + def uploadTracingResult(ctx): return [{ "name": "upload-tracing-result", From da16182e26015facd9ef9692eac06badb47c0b7a Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Thu, 11 Aug 2022 15:52:11 +0000 Subject: [PATCH 007/103] Automated changelog update [skip ci] --- CHANGELOG.md | 434 +++++++++++++++++++++++++-------------------------- 1 file changed, 212 insertions(+), 222 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9508d71e9..38857ac2be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,227 +1,8 @@ -# Changelog for [unreleased] (UNRELEASED) +# Changelog for [2.0.0-beta.6] (2022-08-11) -The following sections list the changes for unreleased. +The following sections list the changes for 2.0.0-beta.6. -[unreleased]: https://github.com/owncloud/ocis/compare/v2.0.0...master - -## Summary - -* Bugfix - Fix handling of invalid LDAP users and groups: [#4274](https://github.com/owncloud/ocis/issues/4274) -* Bugfix - Fix search in received shares: [#4308](https://github.com/owncloud/ocis/issues/4308) -* Bugfix - Substring search for sharees: [#547](https://github.com/owncloud/ocis/issues/547) -* Bugfix - Fix unrestricted quota on the graphAPI: [#4363](https://github.com/owncloud/ocis/pull/4363) -* Bugfix - Space Creators can hand over spaces: [#4244](https://github.com/owncloud/ocis/pull/4244) -* Enhancement - Add drives field to users endpoint: [#4072](https://github.com/owncloud/ocis/pull/4072) -* Enhancement - Improve validation of OIDC access tokens: [#3841](https://github.com/owncloud/ocis/issues/3841) -* Enhancement - Improve error log for "could not get user by claim" error: [#4227](https://github.com/owncloud/ocis/pull/4227) -* Enhancement - Allow providing list of services NOT to start: [#4254](https://github.com/owncloud/ocis/pull/4254) -* Enhancement - Introduce insecure flag for smtp email notifications: [#4279](https://github.com/owncloud/ocis/pull/4279) -* Enhancement - Fix behavior for foobar (in present tense): [#4346](https://github.com/owncloud/ocis/pull/4346) -* Enhancement - Use storageID when requesting special items: [#4356](https://github.com/owncloud/ocis/pull/4356) -* Enhancement - Update reva to v2.7.4: [#4294](https://github.com/owncloud/ocis/pull/4294) -* Enhancement - Update ownCloud Web to v5.7.0-rc.8: [#4314](https://github.com/owncloud/ocis/pull/4314) -* Enhancement - Expand personal drive on the graph user: [#4357](https://github.com/owncloud/ocis/pull/4357) - -## Details - -* Bugfix - Fix handling of invalid LDAP users and groups: [#4274](https://github.com/owncloud/ocis/issues/4274) - - We fixed an issue where ocis would exit with a panic when LDAP users or groups where missing - required attributes (e.g. the id) - - https://github.com/owncloud/ocis/issues/4274 - -* Bugfix - Fix search in received shares: [#4308](https://github.com/owncloud/ocis/issues/4308) - - We fixed a problem where items in received shares were not found. - - https://github.com/owncloud/ocis/issues/4308 - -* Bugfix - Substring search for sharees: [#547](https://github.com/owncloud/ocis/issues/547) - - We fixed searching for sharees to be no longer case-sensitive. With this we introduced two new - settings for the users and groups services: "group_substring_filter_type" for the group - services and "user_substring_filter_type" for the users service. They allow to set the type - of LDAP filter that is used for substring user searches. Possible values are: "initial", - "final" and "any" to do either prefix, suffix or full substring searches. Both settings - default to "initial". - - Also a new option "search_min_length" was added for the "frontend" service. It allows to - configure the minimum number of characters to enter before a search for Sharees is started. - This setting is e.g. evaluated by the web ui via the capabilities endpoint. - - https://github.com/owncloud/ocis/issues/547 - -* Bugfix - Fix unrestricted quota on the graphAPI: [#4363](https://github.com/owncloud/ocis/pull/4363) - - Unrestricted quota needs to show 0 on the API. It is not good for clients when the property is - missing. - - https://github.com/owncloud/ocis/pull/4363 - -* Bugfix - Space Creators can hand over spaces: [#4244](https://github.com/owncloud/ocis/pull/4244) - - Set no owner on non personal spaces to be able to pass the space manager role to a new user. - - https://github.com/owncloud/ocis/pull/4244 - -* Enhancement - Add drives field to users endpoint: [#4072](https://github.com/owncloud/ocis/pull/4072) - - We have added `$expand=drives` to the `/users/{id}/` endpoint using the user filter - implemented in reva. - - https://github.com/owncloud/ocis/pull/4072 - https://github.com/cs3org/reva/pull/3046 - https://github.com/owncloud/ocis/pull/4323 - -* Enhancement - Improve validation of OIDC access tokens: [#3841](https://github.com/owncloud/ocis/issues/3841) - - Previously OIDC access tokes were only validated by requesting the userinfo from the IDP. It is - now possible to enable additional verification if the IDP issues access tokens in JWT format. - In that case the oCIS proxy service will now verify the signature of the token using the public - keys provided by jwks_uri endpoint of the IDP. It will also verify if the issuer claim (iss) - matches the expected values. - - The new validation is enabled by setting `PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD` to - "jwt". Which is also the default. Setting it to "none" will disable the feature. - - https://github.com/owncloud/ocis/issues/3841 - https://github.com/owncloud/ocis/pull/4227 - -* Enhancement - Improve error log for "could not get user by claim" error: [#4227](https://github.com/owncloud/ocis/pull/4227) - - We've improved the error log for "could not get user by claim" error where previously only the - "nil" error has been logged. Now we're logging the message from the transport. - - https://github.com/owncloud/ocis/pull/4227 - -* Enhancement - Allow providing list of services NOT to start: [#4254](https://github.com/owncloud/ocis/pull/4254) - - Until now if one wanted to use a custom version of a service, one needed to provide - `OCIS_RUN_SERVICES` which is a list of all services to start. Now one can provide - `OCIS_EXCLUDE_RUN_SERVICES` which is a list of only services not to start - - https://github.com/owncloud/ocis/pull/4254 - -* Enhancement - Introduce insecure flag for smtp email notifications: [#4279](https://github.com/owncloud/ocis/pull/4279) - - We've introduced the `NOTIFICATIONS_SMTP_INSECURE` configuration option, that let's you - skip certificate verification for smtp email servers. - - https://github.com/owncloud/ocis/pull/4279 - -* Enhancement - Fix behavior for foobar (in present tense): [#4346](https://github.com/owncloud/ocis/pull/4346) - - We've added the configuration option `PROXY_OIDC_REWRITE_WELLKNOWN` to rewrite the - `/.well-known/openid-configuration` endpoint. If active, it serves the - `/.well-known/openid-configuration` response of the original IDP configured in - `OCIS_OIDC_ISSUER` / `PROXY_OIDC_ISSUER`. This is needed so that the Desktop Client, - Android Client and iOS Client can discover the OIDC identity provider. - - Previously this rewrite needed to be performed with an external proxy as NGINX or Traefik if an - external IDP was used. - - https://github.com/owncloud/ocis/issues/2819 - https://github.com/owncloud/ocis/issues/3280 - https://github.com/owncloud/ocis/pull/4346 - -* Enhancement - Use storageID when requesting special items: [#4356](https://github.com/owncloud/ocis/pull/4356) - - We need to use the storageID when requesting the special items of a space to spare a registry - lookup and improve the performance - - https://github.com/owncloud/ocis/pull/4356 - -* Enhancement - Update reva to v2.7.4: [#4294](https://github.com/owncloud/ocis/pull/4294) - - Updated reva to version 2.7.4 This update includes: - - * Bugfix [cs3org/reva#3141](https://github.com/cs3org/reva/pull/3141): Check ListGrants permission when listing shares - - Updated reva to version 2.7.3 This update includes: - - * Bugfix [cs3org/reva#3109](https://github.com/cs3org/reva/pull/3109): Bugfix missing check in MustCheckNodePermissions - * Bugfix [cs3org/reva#3086](https://github.com/cs3org/reva/pull/3086): Bugfix crash in ldap authprovider - * Bugfix [cs3org/reva#3094](https://github.com/cs3org/reva/pull/3094): Allow removing password from public links - * Bugfix [cs3org/reva#3096](https://github.com/cs3org/reva/pull/3096): Bugfix user filter - * Bugfix [cs3org/reva#3091](https://github.com/cs3org/reva/pull/3091): Project spaces need no real owner - * Bugfix [cs3org/reva#3088](https://github.com/cs3org/reva/pull/3088): Use correct sublogger - * Enhancement [cs3org/reva#3123](https://github.com/cs3org/reva/pull/3123): Allow stating links that have no permissions - * Enhancement [cs3org/reva#3087](https://github.com/cs3org/reva/pull/3087): Allow to set LDAP substring filter type - * Enhancement [cs3org/reva#3098](https://github.com/cs3org/reva/pull/3098): App provider http endpoint uses Form instead of Query - * Enhancement [cs3org/reva#3133](https://github.com/cs3org/reva/pull/3133): Admins can set quota on all spaces - * Enhancement [cs3org/reva#3117](https://github.com/cs3org/reva/pull/3117): Update go-ldap to v3.4.4 - * Enhancement [cs3org/reva#3095](https://github.com/cs3org/reva/pull/3095): Upload expiration and cleanup - - Https://github.com/owncloud/ocis/pull/4272 - https://github.com/cs3org/reva/pull/3096 https://github.com/cs3org/reva/pull/4315 - - https://github.com/owncloud/ocis/pull/4294 - https://github.com/owncloud/ocis/pull/4330 - https://github.com/owncloud/ocis/pull/4369 - -* Enhancement - Update ownCloud Web to v5.7.0-rc.8: [#4314](https://github.com/owncloud/ocis/pull/4314) - - Tags: web - - We updated ownCloud Web to v5.7.0-rc.9. Please refer to the changelog (linked) for details on - the web release. - - * Bugfix [owncloud/web#7080](https://github.com/owncloud/web/issues/7080): Add Droparea again - * Bugfix [owncloud/web#7357](https://github.com/owncloud/web/pull/7357): Batch deleting multiple files - * Bugfix [owncloud/web#7379](https://github.com/owncloud/web/pull/7379): Decline share not possible - * Bugfix [owncloud/web#7322](https://github.com/owncloud/web/pull/7322): Files pagination scroll to top - * Bugfix [owncloud/web#7348](https://github.com/owncloud/web/pull/7348): Left sidebar active navigation item has wrong cursor - * Bugfix [owncloud/web#7355](https://github.com/owncloud/web/pull/7355): Link indicator on "Shared via link"-page - * Bugfix [owncloud/web#7325](https://github.com/owncloud/web/pull/7325): Loading state in views - * Bugfix [owncloud/web#7344](https://github.com/owncloud/web/pull/7344): Missing file icon in details panel - * Bugfix [owncloud/web#7321](https://github.com/owncloud/web/pull/7321): Missing scroll bar in user management app - * Bugfix [owncloud/web#7334](https://github.com/owncloud/web/pull/7334): No redirect after disabling space - * Bugfix [owncloud/web#3071](https://github.com/owncloud/web/issues/3071): Don't leak oidc callback url into browser history - * Bugfix [owncloud/web#7379](https://github.com/owncloud/web/pull/7379): Open file on shared space resource not possible - * Bugfix [owncloud/web#7268](https://github.com/owncloud/web/issues/7268): Personal shares leaked into project space - * Bugfix [owncloud/web#7359](https://github.com/owncloud/web/pull/7359): Fix infinite loading spinner on invalid preview links - * Bugfix [owncloud/web#7272](https://github.com/owncloud/web/issues/7272): Print backend version - * Bugfix [owncloud/web#7424](https://github.com/owncloud/web/pull/7424): Quicklinks not shown - * Bugfix [owncloud/web#7379](https://github.com/owncloud/web/pull/7379): Rename shared space resource not possible - * Bugfix [owncloud/web#7210](https://github.com/owncloud/web/pull/7210): Repair navigation highlighter - * Bugfix [owncloud/web#7393](https://github.com/owncloud/web/pull/7393): Selected item bottom glue - * Bugfix [owncloud/web#7308](https://github.com/owncloud/web/pull/7308): "Shared with others" and "Shared via Link" resource links not working - * Bugfix [owncloud/web#7400](https://github.com/owncloud/web/issues/7400): Respect space quota permission - * Bugfix [owncloud/web#7349](https://github.com/owncloud/web/pull/7349): Missing quick actions in spaces file list - * Bugfix [owncloud/web#7396](https://github.com/owncloud/web/pull/7396): Add storage ID when navigating to a shared parent directory - * Bugfix [owncloud/web#7394](https://github.com/owncloud/web/pull/7394): Suppress active panel error log - * Bugfix [owncloud/web#7038](https://github.com/owncloud/web/issues/7038): File list render performance - * Bugfix [owncloud/web#7240](https://github.com/owncloud/web/issues/7240): Access token renewal during upload - * Bugfix [owncloud/web#7376](https://github.com/owncloud/web/pull/7376): Tooltips not shown on disabled create and upload button - * Bugfix [owncloud/web#7297](https://github.com/owncloud/web/pull/7297): Upload overlay progress bar spacing - * Bugfix [owncloud/web#7332](https://github.com/owncloud/web/pull/7332): Users list not loading if user has no role - * Bugfix [owncloud/web#7313](https://github.com/owncloud/web/pull/7313): Versions of shared files not visible - * Enhancement [owncloud/web#7404](https://github.com/owncloud/web/pull/7404): Adjust helper texts - * Enhancement [owncloud/web#7350](https://github.com/owncloud/web/pull/7350): Change file loading mechanism in `preview` app - * Enhancement [owncloud/web#7356](https://github.com/owncloud/web/pull/7356): Declined shares are now easily accessible - * Enhancement [owncloud/web#7365](https://github.com/owncloud/web/pull/7365): Drop menu styling in right sidebar - * Enhancement [owncloud/web#7252](https://github.com/owncloud/web/pull/7252): Redesign shared with list - * Enhancement [owncloud/web#7371](https://github.com/owncloud/web/pull/7371): Use fixed width for the right sidebar - * Enhancement [owncloud/web#7267](https://github.com/owncloud/web/pull/7267): Search all files announce limit - * Enhancement [owncloud/web#7364](https://github.com/owncloud/web/pull/7364): Sharing panel show label instead of description for links - * Enhancement [owncloud/web#7355](https://github.com/owncloud/web/pull/7355): Update ODS to v14.0.0-alpha.12 - * Enhancement [owncloud/web#7375](https://github.com/owncloud/web/pull/7375): User management app saved dialog - - https://github.com/owncloud/ocis/pull/4314 - https://github.com/owncloud/web/releases/tag/v5.7.0-rc.8 - -* Enhancement - Expand personal drive on the graph user: [#4357](https://github.com/owncloud/ocis/pull/4357) - - We can now list the personal drive on the users endpoint via the graph API. A user can add an - `$expand=drive` query to list the personal drive of the requested user. - - https://github.com/owncloud/ocis/pull/4357 -# Changelog for [2.0.0-beta.5] (2022-07-19) - -The following sections list the changes for 2.0.0-beta.5. - -[2.0.0-beta.5]: https://github.com/owncloud/ocis/compare/v1.20.0...v2.0.0-beta.5 +[2.0.0-beta.6]: https://github.com/owncloud/ocis/compare/v1.20.0...v2.0.0-beta.6 ## Summary @@ -238,6 +19,7 @@ The following sections list the changes for 2.0.0-beta.5. * Bugfix - Fix search index getting out of sync: [#3851](https://github.com/owncloud/ocis/pull/3851) * Bugfix - Inconsistency env var naming for LDAP filter configuration: [#3890](https://github.com/owncloud/ocis/issues/3890) * Bugfix - Fix LDAP insecure options: [#3897](https://github.com/owncloud/ocis/pull/3897) +* Bugfix - Fix handling of invalid LDAP users and groups: [#4274](https://github.com/owncloud/ocis/issues/4274) * Bugfix - Fix logging levels: [#4102](https://github.com/owncloud/ocis/pull/4102) * Bugfix - Fix `OCIS_RUN_SERVICES`: [#4133](https://github.com/owncloud/ocis/pull/4133) * Bugfix - Set default name for public link via capabilities: [#3834](https://github.com/owncloud/ocis/pull/3834) @@ -248,12 +30,15 @@ The following sections list the changes for 2.0.0-beta.5. * Bugfix - Remove unused OCS storage configuration: [#3955](https://github.com/owncloud/ocis/pull/3955) * Bugfix - Fix the `ocis search` command: [#3796](https://github.com/owncloud/ocis/pull/3796) * Bugfix - Rename search env variable for the grpc server address: [#3800](https://github.com/owncloud/ocis/pull/3800) +* Bugfix - Fix search in received shares: [#4308](https://github.com/owncloud/ocis/issues/4308) * Bugfix - Fix make sensitive config values in the proxy's debug server: [#4086](https://github.com/owncloud/ocis/pull/4086) * Bugfix - Fix the idm and settings extensions' admin user id configuration option: [#3799](https://github.com/owncloud/ocis/pull/3799) +* Bugfix - Substring search for sharees: [#547](https://github.com/owncloud/ocis/issues/547) * Bugfix - Fix configuration validation for extensions' server commands: [#3911](https://github.com/owncloud/ocis/pull/3911) * Bugfix - Fix startup error logging: [#4093](https://github.com/owncloud/ocis/pull/4093) * Bugfix - Fix multiple storage-users env variables: [#3802](https://github.com/owncloud/ocis/pull/3802) * Bugfix - Thumbnails for `/dav/xxx?preview=1` requests: [#3567](https://github.com/owncloud/ocis/pull/3567) +* Bugfix - Fix unrestricted quota on the graphAPI: [#4363](https://github.com/owncloud/ocis/pull/4363) * Bugfix - Fix user autoprovisioning: [#3893](https://github.com/owncloud/ocis/issues/3893) * Bugfix - Fix version info: [#3953](https://github.com/owncloud/ocis/pull/3953) * Bugfix - Fix version number in status page: [#3788](https://github.com/owncloud/ocis/issues/3788) @@ -267,6 +52,7 @@ The following sections list the changes for 2.0.0-beta.5. * Bugfix - Polish search: [#4094](https://github.com/owncloud/ocis/pull/4094) * Bugfix - Save Katherine: [#3823](https://github.com/owncloud/ocis/issues/3823) * Bugfix - Fix Thumbnails for IDs without a trailing path: [#3791](https://github.com/owncloud/ocis/pull/3791) +* Bugfix - Space Creators can hand over spaces: [#4244](https://github.com/owncloud/ocis/pull/4244) * Bugfix - URL encode the webdav url in the graph API: [#3597](https://github.com/owncloud/ocis/pull/3597) * Bugfix - Store user passwords hashed in idm: [#3778](https://github.com/owncloud/ocis/issues/3778) * Change - Update ocis packages and imports to V2: [#3678](https://github.com/owncloud/ocis/pull/3678) @@ -283,16 +69,22 @@ The following sections list the changes for 2.0.0-beta.5. * Change - Use the spaceID on the cs3 resource: [#4748](https://github.com/owncloud/ocis/pull/4748) * Change - Split MachineAuth from SystemUser: [#3672](https://github.com/owncloud/ocis/pull/3672) * Enhancement - Add capability for alias links: [#3983](https://github.com/owncloud/ocis/issues/3983) +* Enhancement - Add drives field to users endpoint: [#4072](https://github.com/owncloud/ocis/pull/4072) * Enhancement - Add FRONTEND_ENABLE_RESHARING env variable: [#4023](https://github.com/owncloud/ocis/pull/4023) * Enhancement - Add number of total matches to the search result: [#4189](https://github.com/owncloud/ocis/issues/4189) * Enhancement - Align service naming: [#3606](https://github.com/owncloud/ocis/pull/3606) * Enhancement - Add acting user to the audit log: [#3753](https://github.com/owncloud/ocis/issues/3753) * Enhancement - Add audit events for created containers: [#3941](https://github.com/owncloud/ocis/pull/3941) * Enhancement - Don't setup demo role assignments on default: [#3661](https://github.com/owncloud/ocis/issues/3661) +* Enhancement - Improve validation of OIDC access tokens: [#3841](https://github.com/owncloud/ocis/issues/3841) +* Enhancement - Improve error log for "could not get user by claim" error: [#4227](https://github.com/owncloud/ocis/pull/4227) * Enhancement - Introduce service registry cache: [#3833](https://github.com/owncloud/ocis/pull/3833) * Enhancement - Reintroduce user autoprovisioning in proxy: [#3860](https://github.com/owncloud/ocis/pull/3860) * Enhancement - Disable the color logging in docker compose examples: [#871](https://github.com/owncloud/ocis/issues/871) +* Enhancement - Allow providing list of services NOT to start: [#4254](https://github.com/owncloud/ocis/pull/4254) +* Enhancement - Introduce insecure flag for smtp email notifications: [#4279](https://github.com/owncloud/ocis/pull/4279) * Enhancement - Optional events in graph service: [#55555](https://github.com/owncloud/ocis/pull/55555) +* Enhancement - Fix behavior for foobar (in present tense): [#4346](https://github.com/owncloud/ocis/pull/4346) * Enhancement - Add config option to provide TLS certificate: [#3818](https://github.com/owncloud/ocis/issues/3818) * Enhancement - Add descriptions for graph-explorer config: [#3759](https://github.com/owncloud/ocis/pull/3759) * Enhancement - Add /me/changePassword endpoint to GraphAPI: [#3063](https://github.com/owncloud/ocis/issues/3063) @@ -306,11 +98,13 @@ The following sections list the changes for 2.0.0-beta.5. * Enhancement - Add initial version of the search extensions: [#3635](https://github.com/owncloud/ocis/pull/3635) * Enhancement - Add capability for public link single file edit: [#6787](https://github.com/owncloud/web/pull/6787) * Enhancement - Added `share_jail` and `projects` feature flags in spaces capability: [#3626](https://github.com/owncloud/ocis/pull/3626) +* Enhancement - Use storageID when requesting special items: [#4356](https://github.com/owncloud/ocis/pull/4356) * Enhancement - Add description tags to the thumbnails config structs: [#3752](https://github.com/owncloud/ocis/pull/3752) * Enhancement - Make thumbnails service log less noisy: [#3959](https://github.com/owncloud/ocis/pull/3959) * Enhancement - Update linkshare capabilities: [#3579](https://github.com/owncloud/ocis/pull/3579) * Enhancement - Update reva: [#3944](https://github.com/owncloud/ocis/pull/3944) * Enhancement - Update reva to version 2.7.2: [#4115](https://github.com/owncloud/ocis/pull/4115) +* Enhancement - Update reva to v2.7.4: [#4294](https://github.com/owncloud/ocis/pull/4294) * Enhancement - Update reva to version 2.4.1: [#3746](https://github.com/owncloud/ocis/pull/3746) * Enhancement - Update reva to version 2.5.1: [#3932](https://github.com/owncloud/ocis/pull/3932) * Enhancement - Update reva to v2.3.1: [#3552](https://github.com/owncloud/ocis/pull/3552) @@ -319,6 +113,8 @@ The following sections list the changes for 2.0.0-beta.5. * Enhancement - Update ownCloud Web to v5.5.0-rc.6: [#6854](https://github.com/owncloud/web/pull/6854) * Enhancement - Update ownCloud Web to v5.7.0-rc.1: [#4005](https://github.com/owncloud/ocis/pull/4005) * Enhancement - Update ownCloud Web to v5.7.0-rc.4: [#4140](https://github.com/owncloud/ocis/pull/4140) +* Enhancement - Update ownCloud Web to v5.7.0-rc.8: [#4314](https://github.com/owncloud/ocis/pull/4314) +* Enhancement - Expand personal drive on the graph user: [#4357](https://github.com/owncloud/ocis/pull/4357) * Enhancement - Add descriptions to webdav configuration: [#3755](https://github.com/owncloud/ocis/pull/3755) * Enhancement - Search service at the old webdav endpoint: [#4118](https://github.com/owncloud/ocis/pull/4118) @@ -437,6 +233,13 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/pull/3897 +* Bugfix - Fix handling of invalid LDAP users and groups: [#4274](https://github.com/owncloud/ocis/issues/4274) + + We fixed an issue where ocis would exit with a panic when LDAP users or groups where missing + required attributes (e.g. the id) + + https://github.com/owncloud/ocis/issues/4274 + * Bugfix - Fix logging levels: [#4102](https://github.com/owncloud/ocis/pull/4102) We've fixed the configuration of logging levels. Previously it was not possible to configure a @@ -532,6 +335,12 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/pull/3800 +* Bugfix - Fix search in received shares: [#4308](https://github.com/owncloud/ocis/issues/4308) + + We fixed a problem where items in received shares were not found. + + https://github.com/owncloud/ocis/issues/4308 + * Bugfix - Fix make sensitive config values in the proxy's debug server: [#4086](https://github.com/owncloud/ocis/pull/4086) We've fixed a security issue of the proxy's debug server config report endpoint. Previously @@ -548,6 +357,21 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/pull/3799 +* Bugfix - Substring search for sharees: [#547](https://github.com/owncloud/ocis/issues/547) + + We fixed searching for sharees to be no longer case-sensitive. With this we introduced two new + settings for the users and groups services: "group_substring_filter_type" for the group + services and "user_substring_filter_type" for the users service. They allow to set the type + of LDAP filter that is used for substring user searches. Possible values are: "initial", + "final" and "any" to do either prefix, suffix or full substring searches. Both settings + default to "initial". + + Also a new option "search_min_length" was added for the "frontend" service. It allows to + configure the minimum number of characters to enter before a search for Sharees is started. + This setting is e.g. evaluated by the web ui via the capabilities endpoint. + + https://github.com/owncloud/ocis/issues/547 + * Bugfix - Fix configuration validation for extensions' server commands: [#3911](https://github.com/owncloud/ocis/pull/3911) We've fixed the configuration validation for the extensions' server commands. Before this @@ -587,6 +411,13 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/pull/3567 +* Bugfix - Fix unrestricted quota on the graphAPI: [#4363](https://github.com/owncloud/ocis/pull/4363) + + Unrestricted quota needs to show 0 on the API. It is not good for clients when the property is + missing. + + https://github.com/owncloud/ocis/pull/4363 + * Bugfix - Fix user autoprovisioning: [#3893](https://github.com/owncloud/ocis/issues/3893) We've fixed the autoprovsioning feature that was introduced in beta2. Due to a bug the role @@ -681,6 +512,12 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/pull/3791 +* Bugfix - Space Creators can hand over spaces: [#4244](https://github.com/owncloud/ocis/pull/4244) + + Set no owner on non personal spaces to be able to pass the space manager role to a new user. + + https://github.com/owncloud/ocis/pull/4244 + * Bugfix - URL encode the webdav url in the graph API: [#3597](https://github.com/owncloud/ocis/pull/3597) Fixed the webdav URL in the drives responses. Without encoding the URL could be broken by files @@ -812,6 +649,15 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/issues/3983 https://github.com/owncloud/ocis/pull/3991 +* Enhancement - Add drives field to users endpoint: [#4072](https://github.com/owncloud/ocis/pull/4072) + + We have added `$expand=drives` to the `/users/{id}/` endpoint using the user filter + implemented in reva. + + https://github.com/owncloud/ocis/pull/4072 + https://github.com/cs3org/reva/pull/3046 + https://github.com/owncloud/ocis/pull/4323 + * Enhancement - Add FRONTEND_ENABLE_RESHARING env variable: [#4023](https://github.com/owncloud/ocis/pull/4023) We introduced resharing which was enabled by default, this is now configurable and can be @@ -854,6 +700,27 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/issues/3661 https://github.com/owncloud/ocis/pull/3956 +* Enhancement - Improve validation of OIDC access tokens: [#3841](https://github.com/owncloud/ocis/issues/3841) + + Previously OIDC access tokes were only validated by requesting the userinfo from the IDP. It is + now possible to enable additional verification if the IDP issues access tokens in JWT format. + In that case the oCIS proxy service will now verify the signature of the token using the public + keys provided by jwks_uri endpoint of the IDP. It will also verify if the issuer claim (iss) + matches the expected values. + + The new validation is enabled by setting `PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD` to + "jwt". Which is also the default. Setting it to "none" will disable the feature. + + https://github.com/owncloud/ocis/issues/3841 + https://github.com/owncloud/ocis/pull/4227 + +* Enhancement - Improve error log for "could not get user by claim" error: [#4227](https://github.com/owncloud/ocis/pull/4227) + + We've improved the error log for "could not get user by claim" error where previously only the + "nil" error has been logged. Now we're logging the message from the transport. + + https://github.com/owncloud/ocis/pull/4227 + * Enhancement - Introduce service registry cache: [#3833](https://github.com/owncloud/ocis/pull/3833) We've improved the service registry / service discovery by setting up registry caching (TTL @@ -879,6 +746,21 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/issues/871 https://github.com/owncloud/ocis/pull/3935 +* Enhancement - Allow providing list of services NOT to start: [#4254](https://github.com/owncloud/ocis/pull/4254) + + Until now if one wanted to use a custom version of a service, one needed to provide + `OCIS_RUN_SERVICES` which is a list of all services to start. Now one can provide + `OCIS_EXCLUDE_RUN_SERVICES` which is a list of only services not to start + + https://github.com/owncloud/ocis/pull/4254 + +* Enhancement - Introduce insecure flag for smtp email notifications: [#4279](https://github.com/owncloud/ocis/pull/4279) + + We've introduced the `NOTIFICATIONS_SMTP_INSECURE` configuration option, that let's you + skip certificate verification for smtp email servers. + + https://github.com/owncloud/ocis/pull/4279 + * Enhancement - Optional events in graph service: [#55555](https://github.com/owncloud/ocis/pull/55555) We've changed the graph service so that you also can start it without any event bus. Therefore @@ -887,6 +769,21 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/pull/55555 +* Enhancement - Fix behavior for foobar (in present tense): [#4346](https://github.com/owncloud/ocis/pull/4346) + + We've added the configuration option `PROXY_OIDC_REWRITE_WELLKNOWN` to rewrite the + `/.well-known/openid-configuration` endpoint. If active, it serves the + `/.well-known/openid-configuration` response of the original IDP configured in + `OCIS_OIDC_ISSUER` / `PROXY_OIDC_ISSUER`. This is needed so that the Desktop Client, + Android Client and iOS Client can discover the OIDC identity provider. + + Previously this rewrite needed to be performed with an external proxy as NGINX or Traefik if an + external IDP was used. + + https://github.com/owncloud/ocis/issues/2819 + https://github.com/owncloud/ocis/issues/3280 + https://github.com/owncloud/ocis/pull/4346 + * Enhancement - Add config option to provide TLS certificate: [#3818](https://github.com/owncloud/ocis/issues/3818) Added a config option to the graph service to provide a TLS certificate to be used to verify the @@ -988,6 +885,13 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/pull/3626 +* Enhancement - Use storageID when requesting special items: [#4356](https://github.com/owncloud/ocis/pull/4356) + + We need to use the storageID when requesting the special items of a space to spare a registry + lookup and improve the performance + + https://github.com/owncloud/ocis/pull/4356 + * Enhancement - Add description tags to the thumbnails config structs: [#3752](https://github.com/owncloud/ocis/pull/3752) Added description tags to the config structs in the thumbnails service so they will be included @@ -1100,6 +1004,34 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/pull/4025 https://github.com/owncloud/ocis/pull/4211 +* Enhancement - Update reva to v2.7.4: [#4294](https://github.com/owncloud/ocis/pull/4294) + + Updated reva to version 2.7.4 This update includes: + + * Bugfix [cs3org/reva#3141](https://github.com/cs3org/reva/pull/3141): Check ListGrants permission when listing shares + + Updated reva to version 2.7.3 This update includes: + + * Bugfix [cs3org/reva#3109](https://github.com/cs3org/reva/pull/3109): Bugfix missing check in MustCheckNodePermissions + * Bugfix [cs3org/reva#3086](https://github.com/cs3org/reva/pull/3086): Bugfix crash in ldap authprovider + * Bugfix [cs3org/reva#3094](https://github.com/cs3org/reva/pull/3094): Allow removing password from public links + * Bugfix [cs3org/reva#3096](https://github.com/cs3org/reva/pull/3096): Bugfix user filter + * Bugfix [cs3org/reva#3091](https://github.com/cs3org/reva/pull/3091): Project spaces need no real owner + * Bugfix [cs3org/reva#3088](https://github.com/cs3org/reva/pull/3088): Use correct sublogger + * Enhancement [cs3org/reva#3123](https://github.com/cs3org/reva/pull/3123): Allow stating links that have no permissions + * Enhancement [cs3org/reva#3087](https://github.com/cs3org/reva/pull/3087): Allow to set LDAP substring filter type + * Enhancement [cs3org/reva#3098](https://github.com/cs3org/reva/pull/3098): App provider http endpoint uses Form instead of Query + * Enhancement [cs3org/reva#3133](https://github.com/cs3org/reva/pull/3133): Admins can set quota on all spaces + * Enhancement [cs3org/reva#3117](https://github.com/cs3org/reva/pull/3117): Update go-ldap to v3.4.4 + * Enhancement [cs3org/reva#3095](https://github.com/cs3org/reva/pull/3095): Upload expiration and cleanup + + Https://github.com/owncloud/ocis/pull/4272 + https://github.com/cs3org/reva/pull/3096 https://github.com/cs3org/reva/pull/4315 + + https://github.com/owncloud/ocis/pull/4294 + https://github.com/owncloud/ocis/pull/4330 + https://github.com/owncloud/ocis/pull/4369 + * Enhancement - Update reva to version 2.4.1: [#3746](https://github.com/owncloud/ocis/pull/3746) Changelog for reva 2.4.1 (2022-05-24) ======================================= @@ -1373,6 +1305,64 @@ The following sections list the changes for 2.0.0-beta.5. https://github.com/owncloud/ocis/pull/4140 https://github.com/owncloud/web/releases/tag/v5.7.0-rc.4 +* Enhancement - Update ownCloud Web to v5.7.0-rc.8: [#4314](https://github.com/owncloud/ocis/pull/4314) + + Tags: web + + We updated ownCloud Web to v5.7.0-rc.9. Please refer to the changelog (linked) for details on + the web release. + + * Bugfix [owncloud/web#7080](https://github.com/owncloud/web/issues/7080): Add Droparea again + * Bugfix [owncloud/web#7357](https://github.com/owncloud/web/pull/7357): Batch deleting multiple files + * Bugfix [owncloud/web#7379](https://github.com/owncloud/web/pull/7379): Decline share not possible + * Bugfix [owncloud/web#7322](https://github.com/owncloud/web/pull/7322): Files pagination scroll to top + * Bugfix [owncloud/web#7348](https://github.com/owncloud/web/pull/7348): Left sidebar active navigation item has wrong cursor + * Bugfix [owncloud/web#7355](https://github.com/owncloud/web/pull/7355): Link indicator on "Shared via link"-page + * Bugfix [owncloud/web#7325](https://github.com/owncloud/web/pull/7325): Loading state in views + * Bugfix [owncloud/web#7344](https://github.com/owncloud/web/pull/7344): Missing file icon in details panel + * Bugfix [owncloud/web#7321](https://github.com/owncloud/web/pull/7321): Missing scroll bar in user management app + * Bugfix [owncloud/web#7334](https://github.com/owncloud/web/pull/7334): No redirect after disabling space + * Bugfix [owncloud/web#3071](https://github.com/owncloud/web/issues/3071): Don't leak oidc callback url into browser history + * Bugfix [owncloud/web#7379](https://github.com/owncloud/web/pull/7379): Open file on shared space resource not possible + * Bugfix [owncloud/web#7268](https://github.com/owncloud/web/issues/7268): Personal shares leaked into project space + * Bugfix [owncloud/web#7359](https://github.com/owncloud/web/pull/7359): Fix infinite loading spinner on invalid preview links + * Bugfix [owncloud/web#7272](https://github.com/owncloud/web/issues/7272): Print backend version + * Bugfix [owncloud/web#7424](https://github.com/owncloud/web/pull/7424): Quicklinks not shown + * Bugfix [owncloud/web#7379](https://github.com/owncloud/web/pull/7379): Rename shared space resource not possible + * Bugfix [owncloud/web#7210](https://github.com/owncloud/web/pull/7210): Repair navigation highlighter + * Bugfix [owncloud/web#7393](https://github.com/owncloud/web/pull/7393): Selected item bottom glue + * Bugfix [owncloud/web#7308](https://github.com/owncloud/web/pull/7308): "Shared with others" and "Shared via Link" resource links not working + * Bugfix [owncloud/web#7400](https://github.com/owncloud/web/issues/7400): Respect space quota permission + * Bugfix [owncloud/web#7349](https://github.com/owncloud/web/pull/7349): Missing quick actions in spaces file list + * Bugfix [owncloud/web#7396](https://github.com/owncloud/web/pull/7396): Add storage ID when navigating to a shared parent directory + * Bugfix [owncloud/web#7394](https://github.com/owncloud/web/pull/7394): Suppress active panel error log + * Bugfix [owncloud/web#7038](https://github.com/owncloud/web/issues/7038): File list render performance + * Bugfix [owncloud/web#7240](https://github.com/owncloud/web/issues/7240): Access token renewal during upload + * Bugfix [owncloud/web#7376](https://github.com/owncloud/web/pull/7376): Tooltips not shown on disabled create and upload button + * Bugfix [owncloud/web#7297](https://github.com/owncloud/web/pull/7297): Upload overlay progress bar spacing + * Bugfix [owncloud/web#7332](https://github.com/owncloud/web/pull/7332): Users list not loading if user has no role + * Bugfix [owncloud/web#7313](https://github.com/owncloud/web/pull/7313): Versions of shared files not visible + * Enhancement [owncloud/web#7404](https://github.com/owncloud/web/pull/7404): Adjust helper texts + * Enhancement [owncloud/web#7350](https://github.com/owncloud/web/pull/7350): Change file loading mechanism in `preview` app + * Enhancement [owncloud/web#7356](https://github.com/owncloud/web/pull/7356): Declined shares are now easily accessible + * Enhancement [owncloud/web#7365](https://github.com/owncloud/web/pull/7365): Drop menu styling in right sidebar + * Enhancement [owncloud/web#7252](https://github.com/owncloud/web/pull/7252): Redesign shared with list + * Enhancement [owncloud/web#7371](https://github.com/owncloud/web/pull/7371): Use fixed width for the right sidebar + * Enhancement [owncloud/web#7267](https://github.com/owncloud/web/pull/7267): Search all files announce limit + * Enhancement [owncloud/web#7364](https://github.com/owncloud/web/pull/7364): Sharing panel show label instead of description for links + * Enhancement [owncloud/web#7355](https://github.com/owncloud/web/pull/7355): Update ODS to v14.0.0-alpha.12 + * Enhancement [owncloud/web#7375](https://github.com/owncloud/web/pull/7375): User management app saved dialog + + https://github.com/owncloud/ocis/pull/4314 + https://github.com/owncloud/web/releases/tag/v5.7.0-rc.8 + +* Enhancement - Expand personal drive on the graph user: [#4357](https://github.com/owncloud/ocis/pull/4357) + + We can now list the personal drive on the users endpoint via the graph API. A user can add an + `$expand=drive` query to list the personal drive of the requested user. + + https://github.com/owncloud/ocis/pull/4357 + * Enhancement - Add descriptions to webdav configuration: [#3755](https://github.com/owncloud/ocis/pull/3755) Added descriptions to webdav config structs to include them in the config documentation. From 258def99f497e4b3cdd13ac495fe35fd948eb1bb Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Fri, 12 Aug 2022 00:20:09 +0000 Subject: [PATCH 008/103] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38857ac2be..6119912b2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1378,7 +1378,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -1546,11 +1546,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -1719,23 +1736,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From e96819bce83dde85aeba7c3602bf2afb59eead38 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 4 Aug 2022 17:38:55 +0200 Subject: [PATCH 009/103] rewrite the auth middleware The old approach of the authentication middlewares had the problem that when an authenticator could not authenticate a request it would still send it to the next handler, in case that the next one can authenticate it. But if no authenticator could successfully authenticate the request, it would still be handled, which leads to unauthorized access. --- services/proxy/pkg/command/server.go | 107 ++++++---- .../proxy/pkg/middleware/authentication.go | 184 ++++++++++++----- services/proxy/pkg/middleware/basic_auth.go | 159 +++----------- .../proxy/pkg/middleware/basic_auth_test.go | 4 +- services/proxy/pkg/middleware/oidc_auth.go | 194 ++++++++---------- .../proxy/pkg/middleware/public_share_auth.go | 110 +++++----- .../proxy/pkg/middleware/signed_url_auth.go | 47 +++-- .../pkg/middleware/signed_url_auth_test.go | 12 +- 8 files changed, 423 insertions(+), 394 deletions(-) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 81342945f1..9e372e4481 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -16,9 +16,9 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/log" pkgmiddleware "github.com/owncloud/ocis/v2/ocis-pkg/middleware" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" + "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" settingssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0" - storesvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/store/v0" "github.com/owncloud/ocis/v2/services/proxy/pkg/config" "github.com/owncloud/ocis/v2/services/proxy/pkg/config/parser" "github.com/owncloud/ocis/v2/services/proxy/pkg/cs3" @@ -149,7 +149,7 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) logger.Fatal().Msgf("Invalid accounts backend type '%s'", cfg.AccountBackend) } - storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) + // storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) if err != nil { logger.Error().Err(err). Str("gateway", cfg.Reva.Address). @@ -166,6 +166,38 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) Timeout: time.Second * 10, } + var authenticators []middleware.Authenticator + if cfg.EnableBasicAuth { + logger.Warn().Msg("basic auth enabled, use only for testing or development") + authenticators = append(authenticators, middleware.BasicAuthenticator{ + Logger: logger, + UserProvider: userProvider, + }) + } + tokenCache := sync.NewCache(cfg.OIDC.UserinfoCache.Size) + authenticators = append(authenticators, middleware.OIDCAuthenticator{ + Logger: logger, + TokenCache: &tokenCache, + TokenCacheTTL: time.Duration(cfg.OIDC.UserinfoCache.TTL), + HTTPClient: oidcHTTPClient, + OIDCIss: cfg.OIDC.Issuer, + ProviderFunc: func() (middleware.OIDCProvider, error) { + // Initialize a provider by specifying the issuer URL. + // it will fetch the keys from the issuer using the .well-known + // endpoint + return oidc.NewProvider( + context.WithValue(ctx, oauth2.HTTPClient, oidcHTTPClient), + cfg.OIDC.Issuer, + ) + }, + JWKSOptions: cfg.OIDC.JWKS, + AccessTokenVerifyMethod: cfg.OIDC.AccessTokenVerifyMethod, + }) + // authenticators = append(authenticators, middleware.PublicShareAuthenticator{ + // Logger: logger, + // RevaGatewayClient: revaClient, + // }) + return alice.New( // first make sure we log all requests and redirect to https if necessary pkgmiddleware.TraceContext, @@ -179,39 +211,44 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) oidcHTTPClient, ), - // now that we established the basics, on with authentication middleware - middleware.Authentication( - // OIDC Options - middleware.OIDCProviderFunc(func() (middleware.OIDCProvider, error) { - // Initialize a provider by specifying the issuer URL. - // it will fetch the keys from the issuer using the .well-known - // endpoint - return oidc.NewProvider( - context.WithValue(ctx, oauth2.HTTPClient, oidcHTTPClient), - cfg.OIDC.Issuer, - ) - }), - middleware.HTTPClient(oidcHTTPClient), - middleware.TokenCacheSize(cfg.OIDC.UserinfoCache.Size), - middleware.TokenCacheTTL(time.Second*time.Duration(cfg.OIDC.UserinfoCache.TTL)), - middleware.AccessTokenVerifyMethod(cfg.OIDC.AccessTokenVerifyMethod), - middleware.JWKSOptions(cfg.OIDC.JWKS), + // middleware.AuthenticationOld( + // // OIDC Options + // middleware.OIDCProviderFunc(func() (middleware.OIDCProvider, error) { + // // Initialize a provider by specifying the issuer URL. + // // it will fetch the keys from the issuer using the .well-known + // // endpoint + // return oidc.NewProvider( + // context.WithValue(ctx, oauth2.HTTPClient, oidcHTTPClient), + // cfg.OIDC.Issuer, + // ) + // }), - // basic Options - middleware.Logger(logger), - middleware.EnableBasicAuth(cfg.EnableBasicAuth), - middleware.UserProvider(userProvider), - middleware.OIDCIss(cfg.OIDC.Issuer), - middleware.UserOIDCClaim(cfg.UserOIDCClaim), - middleware.UserCS3Claim(cfg.UserCS3Claim), + middleware.Authentication( + authenticators, middleware.CredentialsByUserAgent(cfg.AuthMiddleware.CredentialsByUserAgent), - ), - middleware.SignedURLAuth( middleware.Logger(logger), - middleware.PreSignedURLConfig(cfg.PreSignedURL), - middleware.UserProvider(userProvider), - middleware.Store(storeClient), + middleware.OIDCIss(cfg.OIDC.Issuer), + middleware.EnableBasicAuth(cfg.EnableBasicAuth), ), + // middleware.HTTPClient(oidcHTTPClient), + // middleware.TokenCacheSize(cfg.OIDC.UserinfoCache.Size), + // middleware.TokenCacheTTL(time.Second*time.Duration(cfg.OIDC.UserinfoCache.TTL)), + // + // // basic Options + // middleware.Logger(logger), + // middleware.EnableBasicAuth(cfg.EnableBasicAuth), + // middleware.UserProvider(userProvider), + // middleware.OIDCIss(cfg.OIDC.Issuer), + // middleware.UserOIDCClaim(cfg.UserOIDCClaim), + // middleware.UserCS3Claim(cfg.UserCS3Claim), + // middleware.CredentialsByUserAgent(cfg.AuthMiddleware.CredentialsByUserAgent), + // ), + // middleware.SignedURLAuth( + // middleware.Logger(logger), + // middleware.PreSignedURLConfig(cfg.PreSignedURL), + // middleware.UserProvider(userProvider), + // middleware.Store(storeClient), + // ), middleware.AccountResolver( middleware.Logger(logger), middleware.UserProvider(userProvider), @@ -233,9 +270,9 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) middleware.TokenManagerConfig(*cfg.TokenManager), middleware.RevaGatewayClient(revaClient), ), - middleware.PublicShareAuth( - middleware.Logger(logger), - middleware.RevaGatewayClient(revaClient), - ), + // middleware.PublicShareAuth( + // middleware.Logger(logger), + // middleware.RevaGatewayClient(revaClient), + // ), ) } diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 15fa4ec429..651876f35f 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -5,6 +5,8 @@ import ( "net/http" "regexp" "strings" + + "github.com/owncloud/ocis/v2/services/proxy/pkg/webdav" ) var ( @@ -12,48 +14,97 @@ var ( SupportedAuthStrategies []string // ProxyWwwAuthenticate is a list of endpoints that do not rely on reva underlying authentication, such as ocs. - // services that fallback to reva authentication are declared in the "frontend" command on oCIS. It is a list of strings - // to be regexp compiled. - ProxyWwwAuthenticate = []string{"/ocs/v[12].php/cloud/"} + // services that fallback to reva authentication are declared in the "frontend" command on oCIS. It is a list of + // regexp.Regexp which are safe to use concurrently. + ProxyWwwAuthenticate = []regexp.Regexp{*regexp.MustCompile("/ocs/v[12].php/cloud/")} - // WWWAuthenticate captures the Www-Authenticate header string. - WWWAuthenticate = "Www-Authenticate" + _publicPaths = []string{ + "/dav/public-files/", + "/remote.php/dav/public-files/", + "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", + "/ocs/v1.php/cloud/capabilities", + "/data", + } ) -// userAgentLocker aids in dependency injection for helper methods. The set of fields is arbitrary and the only relation -// they share is to fulfill their duty and lock a User-Agent to its correct challenge if configured. -type userAgentLocker struct { - w http.ResponseWriter - r *http.Request - locks map[string]string // locks represents a reva user-agent:challenge mapping. - fallback string +const ( + // WwwAuthenticate captures the Www-Authenticate header string. + WwwAuthenticate = "Www-Authenticate" +) + +// Authenticator is the common interface implemented by all request authenticators. +// The Authenticator may augment the request with user info or anything related to the +// authentication and return the augmented request. +type Authenticator interface { + Authenticate(*http.Request) (*http.Request, bool) } // Authentication is a higher order authentication middleware. -func Authentication(opts ...Option) func(next http.Handler) http.Handler { +func Authentication(auths []Authenticator, opts ...Option) func(next http.Handler) http.Handler { options := newOptions(opts...) - configureSupportedChallenges(options) - oidc := newOIDCAuth(options) - basic := newBasicAuth(options) return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if options.OIDCIss != "" && options.EnableBasicAuth { - oidc(basic(next)).ServeHTTP(w, r) + if isOIDCTokenAuth(r) || + r.URL.Path == "/" || + strings.HasPrefix(r.URL.Path, "/.well-known") || + r.URL.Path == "/login" || + strings.HasPrefix(r.URL.Path, "/js") || + strings.HasPrefix(r.URL.Path, "/themes") || + strings.HasPrefix(r.URL.Path, "/signin") || + strings.HasPrefix(r.URL.Path, "/konnect") || + r.URL.Path == "/config.json" || + r.URL.Path == "/oidc-callback.html" || + r.URL.Path == "/oidc-callback" || + r.URL.Path == "/settings.js" { + // The authentication for this request is handled by the IdP. + next.ServeHTTP(w, r) + return } - if options.OIDCIss != "" && !options.EnableBasicAuth { - oidc(next).ServeHTTP(w, r) + for _, a := range auths { + if req, ok := a.Authenticate(r); ok { + next.ServeHTTP(w, req) + return + } } + if !isPublicPath(r.URL.Path) { + for _, s := range SupportedAuthStrategies { + userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s) + } + } + w.WriteHeader(http.StatusUnauthorized) + // if the request is a PROPFIND return a WebDAV error code. + // TODO: The proxy has to be smart enough to detect when a request is directed towards a webdav server + // and react accordingly. + if webdav.IsWebdavRequest(r) { + b, err := webdav.Marshal(webdav.Exception{ + Code: webdav.SabredavPermissionDenied, + Message: "Authentication error", + }) - if options.OIDCIss == "" && options.EnableBasicAuth { - basic(next).ServeHTTP(w, r) + webdav.HandleWebdavError(w, b, err) } }) } } +// The token auth endpoint uses basic auth for clients, see https://openid.net/specs/openid-connect-basic-1_0.html#TokenRequest +// > The Client MUST authenticate to the Token Endpoint using the HTTP Basic method, as described in 2.3.1 of OAuth 2.0. +func isOIDCTokenAuth(req *http.Request) bool { + return req.URL.Path == "/konnect/v1/token" +} + +func isPublicPath(p string) bool { + for _, pp := range _publicPaths { + if strings.HasPrefix(p, pp) { + return true + } + } + return false +} + // configureSupportedChallenges adds known authentication challenges to the current session. func configureSupportedChallenges(options Options) { if options.OIDCIss != "" { @@ -66,13 +117,22 @@ func configureSupportedChallenges(options Options) { } func writeSupportedAuthenticateHeader(w http.ResponseWriter, r *http.Request) { - for i := 0; i < len(SupportedAuthStrategies); i++ { - w.Header().Add(WWWAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(SupportedAuthStrategies[i]), r.Host)) + for _, s := range SupportedAuthStrategies { + w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(s), r.Host)) } } func removeSuperfluousAuthenticate(w http.ResponseWriter) { - w.Header().Del(WWWAuthenticate) + w.Header().Del(WwwAuthenticate) +} + +// userAgentLocker aids in dependency injection for helper methods. The set of fields is arbitrary and the only relation +// they share is to fulfill their duty and lock a User-Agent to its correct challenge if configured. +type userAgentLocker struct { + w http.ResponseWriter + r *http.Request + locks map[string]string // locks represents a reva user-agent:challenge mapping. + fallback string } // userAgentAuthenticateLockIn sets Www-Authenticate according to configured user agents. This is useful for the case of @@ -86,22 +146,48 @@ func userAgentAuthenticateLockIn(w http.ResponseWriter, r *http.Request, locks m fallback: fallback, } - for i := 0; i < len(ProxyWwwAuthenticate); i++ { - evalRequestURI(&u, i) + for _, r := range ProxyWwwAuthenticate { + evalRequestURI(u, r) } } -func evalRequestURI(l *userAgentLocker, i int) { - r := regexp.MustCompile(ProxyWwwAuthenticate[i]) - if r.Match([]byte(l.r.RequestURI)) { - for k, v := range l.locks { - if strings.Contains(k, l.r.UserAgent()) { - removeSuperfluousAuthenticate(l.w) - l.w.Header().Add(WWWAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), l.r.Host)) - return - } +func evalRequestURI(l userAgentLocker, r regexp.Regexp) { + if !r.MatchString(l.r.RequestURI) { + return + } + for k, v := range l.locks { + if strings.Contains(k, l.r.UserAgent()) { + removeSuperfluousAuthenticate(l.w) + l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), l.r.Host)) + return } - l.w.Header().Add(WWWAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(l.fallback), l.r.Host)) + } + l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(l.fallback), l.r.Host)) +} + +// AuthenticationOld is a higher order authentication middleware. +func AuthenticationOld(opts ...Option) func(next http.Handler) http.Handler { + options := newOptions(opts...) + + configureSupportedChallenges(options) + oidc := newOIDCAuth(options) + // basic := newBasicAuth(options) + + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if options.OIDCIss != "" && options.EnableBasicAuth { + //oidc(basic(next)).ServeHTTP(w, r) + oidc(next).ServeHTTP(w, r) + } + + if options.OIDCIss != "" && !options.EnableBasicAuth { + oidc(next).ServeHTTP(w, r) + } + + // if options.OIDCIss == "" && options.EnableBasicAuth { + // basic(next).ServeHTTP(w, r) + // } + }) } } @@ -120,15 +206,15 @@ func newOIDCAuth(options Options) func(http.Handler) http.Handler { ) } -// newBasicAuth returns a configured basic middleware -func newBasicAuth(options Options) func(http.Handler) http.Handler { - return BasicAuth( - UserProvider(options.UserProvider), - Logger(options.Logger), - EnableBasicAuth(options.EnableBasicAuth), - OIDCIss(options.OIDCIss), - UserOIDCClaim(options.UserOIDCClaim), - UserCS3Claim(options.UserCS3Claim), - CredentialsByUserAgent(options.CredentialsByUserAgent), - ) -} +// // newBasicAuth returns a configured basic middleware +// func newBasicAuth(options Options) func(http.Handler) http.Handler { +// return BasicAuth( +// UserProvider(options.UserProvider), +// Logger(options.Logger), +// EnableBasicAuth(options.EnableBasicAuth), +// OIDCIss(options.OIDCIss), +// UserOIDCClaim(options.UserOIDCClaim), +// UserCS3Claim(options.UserCS3Claim), +// CredentialsByUserAgent(options.CredentialsByUserAgent), +// ) +// } diff --git a/services/proxy/pkg/middleware/basic_auth.go b/services/proxy/pkg/middleware/basic_auth.go index b7d480d87b..4771e57f21 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -1,145 +1,52 @@ package middleware import ( - "fmt" "net/http" - "strings" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/ocis-pkg/oidc" "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend" - "github.com/owncloud/ocis/v2/services/proxy/pkg/webdav" ) -// BasicAuth provides a middleware to check if BasicAuth is provided -func BasicAuth(optionSetters ...Option) func(next http.Handler) http.Handler { - options := newOptions(optionSetters...) - logger := options.Logger - - if options.EnableBasicAuth { - options.Logger.Warn().Msg("basic auth enabled, use only for testing or development") - } - - h := basicAuth{ - logger: logger, - enabled: options.EnableBasicAuth, - userProvider: options.UserProvider, - } - - return func(next http.Handler) http.Handler { - return http.HandlerFunc( - func(w http.ResponseWriter, req *http.Request) { - if h.isPublicLink(req) || !h.isBasicAuth(req) || h.isOIDCTokenAuth(req) { - if !h.isPublicLink(req) { - userAgentAuthenticateLockIn(w, req, options.CredentialsByUserAgent, "basic") - } - next.ServeHTTP(w, req) - return - } - - removeSuperfluousAuthenticate(w) - login, password, _ := req.BasicAuth() - user, _, err := h.userProvider.Authenticate(req.Context(), login, password) - - // touch is a user agent locking guard, when touched changes to true it indicates the User-Agent on the - // request is configured to support only one challenge, it it remains untouched, there are no considera- - // tions and we should write all available authentication challenges to the response. - touch := false - - if err != nil { - for k, v := range options.CredentialsByUserAgent { - if strings.Contains(k, req.UserAgent()) { - removeSuperfluousAuthenticate(w) - w.Header().Add("Www-Authenticate", fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), req.Host)) - touch = true - break - } - } - - // if the request is not bound to any user agent, write all available challenges - if !touch { - writeSupportedAuthenticateHeader(w, req) - } - - // if the request is a PROPFIND return a WebDAV error code. - // TODO: The proxy has to be smart enough to detect when a request is directed towards a webdav server - // and react accordingly. - - w.WriteHeader(http.StatusUnauthorized) - - if webdav.IsWebdavRequest(req) { - b, err := webdav.Marshal(webdav.Exception{ - Code: webdav.SabredavPermissionDenied, - Message: "Authentication error", - }) - - webdav.HandleWebdavError(w, b, err) - return - } - - return - } - - // fake oidc claims - claims := map[string]interface{}{ - oidc.Iss: user.Id.Idp, - oidc.PreferredUsername: user.Username, - oidc.Email: user.Mail, - oidc.OwncloudUUID: user.Id.OpaqueId, - } - - if options.UserCS3Claim == "userid" { - // set the custom user claim only if users will be looked up by the userid on the CS3api - // OpaqueId contains the userid configured in STORAGE_LDAP_USER_SCHEMA_UID - claims[options.UserOIDCClaim] = user.Id.OpaqueId - - } - - next.ServeHTTP(w, req.WithContext(oidc.NewContext(req.Context(), claims))) - }, - ) - } +type BasicAuthenticator struct { + Logger log.Logger + UserProvider backend.UserBackend + UserCS3Claim string + UserOIDCClaim string } -type basicAuth struct { - logger log.Logger - enabled bool - userProvider backend.UserBackend -} - -func (m basicAuth) isPublicLink(req *http.Request) bool { - login, _, ok := req.BasicAuth() - - if !ok || login != "public" { - return false +func (m BasicAuthenticator) Authenticate(req *http.Request) (*http.Request, bool) { + if isPublicPath(req.URL.Path) { + // The authentication of public path requests is handled by another authenticator. + // Since we can't guarantee the order of execution of the authenticators, we better + // implement an early return here for paths we can't authenticate in this authenticator. + return nil, false } - publicPaths := []string{ - "/dav/public-files/", - "/remote.php/dav/public-files/", - "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", - "/ocs/v1.php/cloud/capabilities", - "/data", - } - isPublic := false - - for _, p := range publicPaths { - if strings.HasPrefix(req.URL.Path, p) { - isPublic = true - break - } + login, password, ok := req.BasicAuth() + if !ok { + return nil, false } - return isPublic -} + user, _, err := m.UserProvider.Authenticate(req.Context(), login, password) + if err != nil { + // TODO add log line + return nil, false + } -// The token auth endpoint uses basic auth for clients, see https://openid.net/specs/openid-connect-basic-1_0.html#TokenRequest -// > The Client MUST authenticate to the Token Endpoint using the HTTP Basic method, as described in 2.3.1 of OAuth 2.0. -func (m basicAuth) isOIDCTokenAuth(req *http.Request) bool { - return req.URL.Path == "/konnect/v1/token" -} + // fake oidc claims + claims := map[string]interface{}{ + oidc.Iss: user.Id.Idp, + oidc.PreferredUsername: user.Username, + oidc.Email: user.Mail, + oidc.OwncloudUUID: user.Id.OpaqueId, + } -func (m basicAuth) isBasicAuth(req *http.Request) bool { - _, _, ok := req.BasicAuth() - return m.enabled && ok + if m.UserCS3Claim == "userid" { + // set the custom user claim only if users will be looked up by the userid on the CS3api + // OpaqueId contains the userid configured in STORAGE_LDAP_USER_SCHEMA_UID + claims[m.UserOIDCClaim] = user.Id.OpaqueId + + } + return req.WithContext(oidc.NewContext(req.Context(), claims)), true } diff --git a/services/proxy/pkg/middleware/basic_auth_test.go b/services/proxy/pkg/middleware/basic_auth_test.go index 46c7f48285..77279d66b4 100644 --- a/services/proxy/pkg/middleware/basic_auth_test.go +++ b/services/proxy/pkg/middleware/basic_auth_test.go @@ -23,8 +23,6 @@ func TestBasicAuth__isPublicLink(t *testing.T) { {url: "/ocs/v1.php/cloud/capabilities", username: "public", expected: true}, {url: "/ocs/v1.php/cloud/users/admin", username: "public", expected: false}, } - ba := basicAuth{} - for _, tt := range tests { req := httptest.NewRequest("", tt.url, nil) @@ -32,7 +30,7 @@ func TestBasicAuth__isPublicLink(t *testing.T) { req.SetBasicAuth(tt.username, "") } - result := ba.isPublicLink(req) + result := isPublicPath(req.URL.Path) if result != tt.expected { t.Errorf("with %s expected %t got %t", tt.url, tt.expected, result) } diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index ae3b313f08..97a71962ff 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -25,80 +25,29 @@ type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) } -// OIDCAuth provides a middleware to check access secured by a static token. -func OIDCAuth(optionSetters ...Option) func(next http.Handler) http.Handler { - options := newOptions(optionSetters...) - tokenCache := osync.NewCache(options.UserinfoCacheSize) +type OIDCAuthenticator struct { + Logger log.Logger + HTTPClient *http.Client + OIDCIss string + TokenCache *osync.Cache + TokenCacheTTL time.Duration + ProviderFunc func() (OIDCProvider, error) + AccessTokenVerifyMethod string + JWKSOptions config.JWKS - h := oidcAuth{ - logger: options.Logger, - providerFunc: options.OIDCProviderFunc, - httpClient: options.HTTPClient, - oidcIss: options.OIDCIss, - tokenCache: &tokenCache, - tokenCacheTTL: options.UserinfoCacheTTL, - accessTokenVerifyMethod: options.AccessTokenVerifyMethod, - jwksOptions: options.JWKS, - jwksLock: &sync.Mutex{}, - providerLock: &sync.Mutex{}, - } + providerLock *sync.Mutex + provider OIDCProvider - return func(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - // there is no bearer token on the request, - if !h.shouldServe(req) { - // oidc supported but token not present, add header and handover to the next middleware. - userAgentAuthenticateLockIn(w, req, options.CredentialsByUserAgent, "bearer") - next.ServeHTTP(w, req) - return - } - - if h.getProvider() == nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - - // Force init of jwks keyfunc if needed (contacts the .well-known and jwks endpoints on first call) - if h.accessTokenVerifyMethod == config.AccessTokenVerificationJWT && h.getKeyfunc() == nil { - w.WriteHeader(http.StatusInternalServerError) - return - } - - token := strings.TrimPrefix(req.Header.Get("Authorization"), "Bearer ") - - claims, status := h.getClaims(token, req) - if status != 0 { - w.WriteHeader(status) - return - } - - // inject claims to the request context for the account_resolver middleware. - next.ServeHTTP(w, req.WithContext(oidc.NewContext(req.Context(), claims))) - }) - } + jwksLock *sync.Mutex + JWKS *keyfunc.JWKS } -type oidcAuth struct { - logger log.Logger - provider OIDCProvider - providerLock *sync.Mutex - jwksOptions config.JWKS - jwks *keyfunc.JWKS - jwksLock *sync.Mutex - providerFunc func() (OIDCProvider, error) - httpClient *http.Client - oidcIss string - tokenCache *osync.Cache - tokenCacheTTL time.Duration - accessTokenVerifyMethod string -} - -func (m oidcAuth) getClaims(token string, req *http.Request) (claims map[string]interface{}, status int) { - hit := m.tokenCache.Load(token) +func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (claims map[string]interface{}, status int) { + hit := m.TokenCache.Load(token) if hit == nil { aClaims, err := m.verifyAccessToken(token) if err != nil { - m.logger.Error().Err(err).Msg("Failed to verify access token") + m.Logger.Error().Err(err).Msg("Failed to verify access token") status = http.StatusUnauthorized return } @@ -108,25 +57,25 @@ func (m oidcAuth) getClaims(token string, req *http.Request) (claims map[string] } userInfo, err := m.getProvider().UserInfo( - context.WithValue(req.Context(), oauth2.HTTPClient, m.httpClient), + context.WithValue(req.Context(), oauth2.HTTPClient, m.HTTPClient), oauth2.StaticTokenSource(oauth2Token), ) if err != nil { - m.logger.Error().Err(err).Msg("Failed to get userinfo") + m.Logger.Error().Err(err).Msg("Failed to get userinfo") status = http.StatusUnauthorized return } if err := userInfo.Claims(&claims); err != nil { - m.logger.Error().Err(err).Interface("userinfo", userInfo).Msg("failed to unmarshal userinfo claims") + m.Logger.Error().Err(err).Interface("userinfo", userInfo).Msg("failed to unmarshal userinfo claims") status = http.StatusInternalServerError return } expiration := m.extractExpiration(aClaims) - m.tokenCache.Store(token, claims, expiration) + m.TokenCache.Store(token, claims, expiration) - m.logger.Debug().Interface("claims", claims).Interface("userInfo", userInfo).Time("expiration", expiration.UTC()).Msg("unmarshalled and cached userinfo") + m.Logger.Debug().Interface("claims", claims).Interface("userInfo", userInfo).Time("expiration", expiration.UTC()).Msg("unmarshalled and cached userinfo") return } @@ -135,25 +84,25 @@ func (m oidcAuth) getClaims(token string, req *http.Request) (claims map[string] status = http.StatusInternalServerError return } - m.logger.Debug().Interface("claims", claims).Msg("cache hit for userinfo") + m.Logger.Debug().Interface("claims", claims).Msg("cache hit for userinfo") return } -func (m oidcAuth) verifyAccessToken(token string) (jwt.RegisteredClaims, error) { - switch m.accessTokenVerifyMethod { +func (m OIDCAuthenticator) verifyAccessToken(token string) (jwt.RegisteredClaims, error) { + switch m.AccessTokenVerifyMethod { case config.AccessTokenVerificationJWT: return m.verifyAccessTokenJWT(token) case config.AccessTokenVerificationNone: - m.logger.Debug().Msg("Access Token verification disabled") + m.Logger.Debug().Msg("Access Token verification disabled") return jwt.RegisteredClaims{}, nil default: - m.logger.Error().Str("access_token_verify_method", m.accessTokenVerifyMethod).Msg("Unknown Access Token verification setting") + m.Logger.Error().Str("access_token_verify_method", m.AccessTokenVerifyMethod).Msg("Unknown Access Token verification setting") return jwt.RegisteredClaims{}, errors.New("Unknown Access Token Verification method") } } // verifyAccessTokenJWT tries to parse and verify the access token as a JWT. -func (m oidcAuth) verifyAccessTokenJWT(token string) (jwt.RegisteredClaims, error) { +func (m OIDCAuthenticator) verifyAccessTokenJWT(token string) (jwt.RegisteredClaims, error) { var claims jwt.RegisteredClaims jwks := m.getKeyfunc() if jwks == nil { @@ -161,13 +110,13 @@ func (m oidcAuth) verifyAccessTokenJWT(token string) (jwt.RegisteredClaims, erro } _, err := jwt.ParseWithClaims(token, &claims, jwks.Keyfunc) - m.logger.Debug().Interface("access token", &claims).Msg("parsed access token") + m.Logger.Debug().Interface("access token", &claims).Msg("parsed access token") if err != nil { - m.logger.Info().Err(err).Msg("Failed to parse/verify the access token.") + m.Logger.Info().Err(err).Msg("Failed to parse/verify the access token.") return claims, err } - if !claims.VerifyIssuer(m.oidcIss, true) { + if !claims.VerifyIssuer(m.OIDCIss, true) { vErr := jwt.ValidationError{} vErr.Inner = jwt.ErrTokenInvalidIssuer vErr.Errors |= jwt.ValidationErrorIssuer @@ -180,19 +129,19 @@ func (m oidcAuth) verifyAccessTokenJWT(token string) (jwt.RegisteredClaims, erro // extractExpiration tries to extract the expriration time from the access token // If the access token does not have an exp claim it will fallback to the configured // default expiration -func (m oidcAuth) extractExpiration(aClaims jwt.RegisteredClaims) time.Time { - defaultExpiration := time.Now().Add(m.tokenCacheTTL) +func (m OIDCAuthenticator) extractExpiration(aClaims jwt.RegisteredClaims) time.Time { + defaultExpiration := time.Now().Add(m.TokenCacheTTL) if aClaims.ExpiresAt != nil { - m.logger.Debug().Str("exp", aClaims.ExpiresAt.String()).Msg("Expiration Time from access_token") + m.Logger.Debug().Str("exp", aClaims.ExpiresAt.String()).Msg("Expiration Time from access_token") return aClaims.ExpiresAt.Time } return defaultExpiration } -func (m oidcAuth) shouldServe(req *http.Request) bool { +func (m OIDCAuthenticator) shouldServe(req *http.Request) bool { header := req.Header.Get("Authorization") - if m.oidcIss == "" { + if m.OIDCIss == "" { return false } @@ -211,58 +160,58 @@ type jwksJSON struct { JWKSURL string `json:"jwks_uri"` } -func (m *oidcAuth) getKeyfunc() *keyfunc.JWKS { +func (m *OIDCAuthenticator) getKeyfunc() *keyfunc.JWKS { m.jwksLock.Lock() defer m.jwksLock.Unlock() - if m.jwks == nil { - wellKnown := strings.TrimSuffix(m.oidcIss, "/") + "/.well-known/openid-configuration" + if m.JWKS == nil { + wellKnown := strings.TrimSuffix(m.OIDCIss, "/") + "/.well-known/openid-configuration" - resp, err := m.httpClient.Get(wellKnown) + resp, err := m.HTTPClient.Get(wellKnown) if err != nil { - m.logger.Error().Err(err).Msg("Failed to set request for .well-known/openid-configuration") + m.Logger.Error().Err(err).Msg("Failed to set request for .well-known/openid-configuration") return nil } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { - m.logger.Error().Err(err).Msg("unable to read discovery response body") + m.Logger.Error().Err(err).Msg("unable to read discovery response body") return nil } if resp.StatusCode != http.StatusOK { - m.logger.Error().Str("status", resp.Status).Str("body", string(body)).Msg("error requesting openid-configuration") + m.Logger.Error().Str("status", resp.Status).Str("body", string(body)).Msg("error requesting openid-configuration") return nil } var j jwksJSON err = json.Unmarshal(body, &j) if err != nil { - m.logger.Error().Err(err).Msg("failed to decode provider openid-configuration") + m.Logger.Error().Err(err).Msg("failed to decode provider openid-configuration") return nil } - m.logger.Debug().Str("jwks", j.JWKSURL).Msg("discovered jwks endpoint") + m.Logger.Debug().Str("jwks", j.JWKSURL).Msg("discovered jwks endpoint") options := keyfunc.Options{ - Client: m.httpClient, + Client: m.HTTPClient, RefreshErrorHandler: func(err error) { - m.logger.Error().Err(err).Msg("There was an error with the jwt.Keyfunc") + m.Logger.Error().Err(err).Msg("There was an error with the jwt.Keyfunc") }, - RefreshInterval: time.Minute * time.Duration(m.jwksOptions.RefreshInterval), - RefreshRateLimit: time.Second * time.Duration(m.jwksOptions.RefreshRateLimit), - RefreshTimeout: time.Second * time.Duration(m.jwksOptions.RefreshTimeout), - RefreshUnknownKID: m.jwksOptions.RefreshUnknownKID, + RefreshInterval: time.Minute * time.Duration(m.JWKSOptions.RefreshInterval), + RefreshRateLimit: time.Second * time.Duration(m.JWKSOptions.RefreshRateLimit), + RefreshTimeout: time.Second * time.Duration(m.JWKSOptions.RefreshTimeout), + RefreshUnknownKID: m.JWKSOptions.RefreshUnknownKID, } - m.jwks, err = keyfunc.Get(j.JWKSURL, options) + m.JWKS, err = keyfunc.Get(j.JWKSURL, options) if err != nil { - m.jwks = nil - m.logger.Error().Err(err).Msg("Failed to create JWKS from resource at the given URL.") + m.JWKS = nil + m.Logger.Error().Err(err).Msg("Failed to create JWKS from resource at the given URL.") return nil } } - return m.jwks + return m.JWKS } -func (m *oidcAuth) getProvider() OIDCProvider { +func (m *OIDCAuthenticator) getProvider() OIDCProvider { m.providerLock.Lock() defer m.providerLock.Unlock() if m.provider == nil { @@ -271,9 +220,9 @@ func (m *oidcAuth) getProvider() OIDCProvider { // provider needs to be cached as when it is created // it will fetch the keys from the issuer using the .well-known // endpoint - provider, err := m.providerFunc() + provider, err := m.ProviderFunc() if err != nil { - m.logger.Error().Err(err).Msg("could not initialize oidcAuth provider") + m.Logger.Error().Err(err).Msg("could not initialize oidcAuth provider") return nil } @@ -281,3 +230,32 @@ func (m *oidcAuth) getProvider() OIDCProvider { } return m.provider } + +func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { + // there is no bearer token on the request, + if !m.shouldServe(r) { + // // oidc supported but token not present, add header and handover to the next middleware. + // userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, "bearer") + // next.ServeHTTP(w, r) + return nil, false + } + + if m.getProvider() == nil { + // w.WriteHeader(http.StatusInternalServerError) + return nil, false + } + // Force init of jwks keyfunc if needed (contacts the .well-known and jwks endpoints on first call) + if m.AccessTokenVerifyMethod == config.AccessTokenVerificationJWT && m.getKeyfunc() == nil { + return nil, false + } + + token := strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ") + + claims, status := m.getClaims(token, r) + if status != 0 { + // w.WriteHeader(status) + // TODO log + return nil, false + } + return r.WithContext(oidc.NewContext(r.Context(), claims)), true +} diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index 9b3ddcd5ff..6d6d0fa747 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -5,6 +5,7 @@ import ( "strings" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" + "github.com/owncloud/ocis/v2/ocis-pkg/log" ) const ( @@ -14,59 +15,58 @@ const ( authenticationType = "publicshares" ) -// PublicShareAuth ... -func PublicShareAuth(opts ...Option) func(next http.Handler) http.Handler { - options := newOptions(opts...) - logger := options.Logger - - return func(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - shareToken := r.Header.Get(headerShareToken) - if shareToken == "" { - shareToken = r.URL.Query().Get(headerShareToken) - } - - // Currently we only want to authenticate app open request coming from public shares. - if shareToken == "" { - // Don't authenticate - next.ServeHTTP(w, r) - return - } - - var sharePassword string - if signature := r.URL.Query().Get("signature"); signature != "" { - expiration := r.URL.Query().Get("expiration") - if expiration == "" { - logger.Warn().Str("signature", signature).Msg("cannot do signature auth without the expiration") - next.ServeHTTP(w, r) - return - } - sharePassword = strings.Join([]string{"signature", signature, expiration}, "|") - } else { - // We can ignore the username since it is always set to "public" in public shares. - _, password, ok := r.BasicAuth() - - sharePassword = basicAuthPasswordPrefix - if ok { - sharePassword += password - } - } - - authResp, err := options.RevaGatewayClient.Authenticate(r.Context(), &gateway.AuthenticateRequest{ - Type: authenticationType, - ClientId: shareToken, - ClientSecret: sharePassword, - }) - - if err != nil { - logger.Debug().Err(err).Str("public_share_token", shareToken).Msg("could not authenticate public share") - // try another middleware - next.ServeHTTP(w, r) - return - } - - r.Header.Add(headerRevaAccessToken, authResp.Token) - next.ServeHTTP(w, r) - }) - } +type PublicShareAuthenticator struct { + Logger log.Logger + RevaGatewayClient gateway.GatewayAPIClient +} + +func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { + if !isPublicPath(r.URL.Path) { + return nil, false + } + + query := r.URL.Query() + shareToken := r.Header.Get(headerShareToken) + if shareToken == "" { + shareToken = query.Get(headerShareToken) + } + + // Currently we only want to authenticate app open request coming from public shares. + if shareToken == "" { + // Don't authenticate + return nil, false + } + + var sharePassword string + if signature := query.Get("signature"); signature != "" { + expiration := query.Get("expiration") + if expiration == "" { + a.Logger.Warn().Str("signature", signature).Msg("cannot do signature auth without the expiration") + return nil, false + } + sharePassword = strings.Join([]string{"signature", signature, expiration}, "|") + } else { + // We can ignore the username since it is always set to "public" in public shares. + _, password, ok := r.BasicAuth() + + sharePassword = basicAuthPasswordPrefix + if ok { + sharePassword += password + } + } + + authResp, err := a.RevaGatewayClient.Authenticate(r.Context(), &gateway.AuthenticateRequest{ + Type: authenticationType, + ClientId: shareToken, + ClientSecret: sharePassword, + }) + + if err != nil { + a.Logger.Debug().Err(err).Str("public_share_token", shareToken).Msg("could not authenticate public share") + // try another middleware + return nil, false + } + + r.Header.Add(headerRevaAccessToken, authResp.Token) + return r, false } diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index d71036d5a7..094c279ad4 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -25,7 +25,7 @@ func SignedURLAuth(optionSetters ...Option) func(next http.Handler) http.Handler options := newOptions(optionSetters...) return func(next http.Handler) http.Handler { - return &signedURLAuth{ + return &SignedURLAuthenticator{ next: next, logger: options.Logger, preSignedURLConfig: options.PreSignedURLConfig, @@ -35,7 +35,7 @@ func SignedURLAuth(optionSetters ...Option) func(next http.Handler) http.Handler } } -type signedURLAuth struct { +type SignedURLAuthenticator struct { next http.Handler logger log.Logger preSignedURLConfig config.PreSignedURL @@ -43,7 +43,7 @@ type signedURLAuth struct { store storesvc.StoreService } -func (m signedURLAuth) ServeHTTP(w http.ResponseWriter, req *http.Request) { +func (m SignedURLAuthenticator) ServeHTTP(w http.ResponseWriter, req *http.Request) { if !m.shouldServe(req) { m.next.ServeHTTP(w, req) return @@ -67,14 +67,14 @@ func (m signedURLAuth) ServeHTTP(w http.ResponseWriter, req *http.Request) { m.next.ServeHTTP(w, req) } -func (m signedURLAuth) shouldServe(req *http.Request) bool { +func (m SignedURLAuthenticator) shouldServe(req *http.Request) bool { if !m.preSignedURLConfig.Enabled { return false } return req.URL.Query().Get("OC-Signature") != "" } -func (m signedURLAuth) validate(req *http.Request) (err error) { +func (m SignedURLAuthenticator) validate(req *http.Request) (err error) { query := req.URL.Query() if ok, err := m.allRequiredParametersArePresent(query); !ok { @@ -100,7 +100,7 @@ func (m signedURLAuth) validate(req *http.Request) (err error) { return nil } -func (m signedURLAuth) allRequiredParametersArePresent(query url.Values) (ok bool, err error) { +func (m SignedURLAuthenticator) allRequiredParametersArePresent(query url.Values) (ok bool, err error) { // check if required query parameters exist in given request query parameters // OC-Signature - the computed signature - server will verify the request upon this REQUIRED // OC-Credential - defines the user scope (shall we use the owncloud user id here - this might leak internal data ....) REQUIRED @@ -122,7 +122,7 @@ func (m signedURLAuth) allRequiredParametersArePresent(query url.Values) (ok boo return true, nil } -func (m signedURLAuth) requestMethodMatches(meth string, query url.Values) (ok bool, err error) { +func (m SignedURLAuthenticator) requestMethodMatches(meth string, query url.Values) (ok bool, err error) { // check if given url query parameter OC-Verb matches given request method if !strings.EqualFold(meth, query.Get("OC-Verb")) { return false, errors.New("required OC-Verb parameter did not match request method") @@ -131,7 +131,7 @@ func (m signedURLAuth) requestMethodMatches(meth string, query url.Values) (ok b return true, nil } -func (m signedURLAuth) requestMethodIsAllowed(meth string) (ok bool, err error) { +func (m SignedURLAuthenticator) requestMethodIsAllowed(meth string) (ok bool, err error) { // check if given request method is allowed methodIsAllowed := false for _, am := range m.preSignedURLConfig.AllowedHTTPMethods { @@ -147,7 +147,7 @@ func (m signedURLAuth) requestMethodIsAllowed(meth string) (ok bool, err error) return true, nil } -func (m signedURLAuth) urlIsExpired(query url.Values, now func() time.Time) (expired bool, err error) { +func (m SignedURLAuthenticator) urlIsExpired(query url.Values, now func() time.Time) (expired bool, err error) { // check if url is expired by checking if given date (OC-Date) + expires in seconds (OC-Expires) is after now validFrom, err := time.Parse(time.RFC3339, query.Get("OC-Date")) if err != nil { @@ -164,7 +164,7 @@ func (m signedURLAuth) urlIsExpired(query url.Values, now func() time.Time) (exp return !(now().After(validFrom) && now().Before(validTo)), nil } -func (m signedURLAuth) signatureIsValid(req *http.Request) (ok bool, err error) { +func (m SignedURLAuthenticator) signatureIsValid(req *http.Request) (ok bool, err error) { u := revactx.ContextMustGetUser(req.Context()) signingKey, err := m.getSigningKey(req.Context(), u.Id.OpaqueId) if err != nil { @@ -187,7 +187,7 @@ func (m signedURLAuth) signatureIsValid(req *http.Request) (ok bool, err error) return m.createSignature(url, signingKey) == signature, nil } -func (m signedURLAuth) createSignature(url string, signingKey []byte) string { +func (m SignedURLAuthenticator) createSignature(url string, signingKey []byte) string { // the oc10 signature check: $hash = \hash_pbkdf2("sha512", $url, $signingKey, 10000, 64, false); // - sets the length of the output string to 64 // - sets raw output to false -> if raw_output is FALSE length corresponds to twice the byte-length of the derived key (as every byte of the key is returned as two hexits). @@ -197,7 +197,7 @@ func (m signedURLAuth) createSignature(url string, signingKey []byte) string { return hex.EncodeToString(hash) } -func (m signedURLAuth) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) { +func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) { res, err := m.store.Read(ctx, &storesvc.ReadRequest{ Options: &storemsg.ReadOptions{ Database: "proxy", @@ -211,3 +211,26 @@ func (m signedURLAuth) getSigningKey(ctx context.Context, ocisID string) ([]byte return res.Records[0].Value, nil } + +func (m SignedURLAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { + if !m.shouldServe(r) { + return nil, false + } + + user, _, err := m.userProvider.GetUserByClaims(r.Context(), "username", r.URL.Query().Get("OC-Credential"), true) + if err != nil { + m.logger.Error().Err(err).Msg("Could not get user by claim") + return nil, false + } + + ctx := revactx.ContextSetUser(r.Context(), user) + + r = r.WithContext(ctx) + + if err := m.validate(r); err != nil { + // http.Error(w, "Invalid url signature", http.StatusUnauthorized) + return nil, false + } + + return r, true +} diff --git a/services/proxy/pkg/middleware/signed_url_auth_test.go b/services/proxy/pkg/middleware/signed_url_auth_test.go index 856fcdb0e2..01311b731e 100644 --- a/services/proxy/pkg/middleware/signed_url_auth_test.go +++ b/services/proxy/pkg/middleware/signed_url_auth_test.go @@ -7,7 +7,7 @@ import ( ) func TestSignedURLAuth_shouldServe(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} tests := []struct { url string enabled bool @@ -31,7 +31,7 @@ func TestSignedURLAuth_shouldServe(t *testing.T) { } func TestSignedURLAuth_allRequiredParametersPresent(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} baseURL := "https://example.com/example.jpg?" tests := []struct { params string @@ -54,7 +54,7 @@ func TestSignedURLAuth_allRequiredParametersPresent(t *testing.T) { } func TestSignedURLAuth_requestMethodMatches(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} tests := []struct { method string url string @@ -75,7 +75,7 @@ func TestSignedURLAuth_requestMethodMatches(t *testing.T) { } func TestSignedURLAuth_requestMethodIsAllowed(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} tests := []struct { method string allowed []string @@ -99,7 +99,7 @@ func TestSignedURLAuth_requestMethodIsAllowed(t *testing.T) { } func TestSignedURLAuth_urlIsExpired(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} nowFunc := func() time.Time { t, _ := time.Parse(time.RFC3339, "2020-02-02T12:30:00.000Z") return t @@ -126,7 +126,7 @@ func TestSignedURLAuth_urlIsExpired(t *testing.T) { } func TestSignedURLAuth_createSignature(t *testing.T) { - pua := signedURLAuth{} + pua := SignedURLAuthenticator{} expected := "27d2ebea381384af3179235114801dcd00f91e46f99fca72575301cf3948101d" s := pua.createSignature("something", []byte("somerandomkey")) From f35c8b9205c79470da0bdc3d7ed7188886740711 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 8 Aug 2022 15:49:22 +0200 Subject: [PATCH 010/103] clean up the authenticators middlewares --- services/proxy/pkg/command/server.go | 53 ++------- .../proxy/pkg/middleware/authentication.go | 56 +-------- services/proxy/pkg/middleware/basic_auth.go | 20 +++- services/proxy/pkg/middleware/oidc_auth.go | 63 +++++----- .../proxy/pkg/middleware/public_share_auth.go | 20 +++- .../proxy/pkg/middleware/signed_url_auth.go | 111 ++++++++---------- 6 files changed, 126 insertions(+), 197 deletions(-) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 9e372e4481..7377d95829 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -19,6 +19,7 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" settingssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0" + storesvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/store/v0" "github.com/owncloud/ocis/v2/services/proxy/pkg/config" "github.com/owncloud/ocis/v2/services/proxy/pkg/config/parser" "github.com/owncloud/ocis/v2/services/proxy/pkg/cs3" @@ -149,7 +150,7 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) logger.Fatal().Msgf("Invalid accounts backend type '%s'", cfg.AccountBackend) } - // storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) + storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient) if err != nil { logger.Error().Err(err). Str("gateway", cfg.Reva.Address). @@ -193,10 +194,17 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) JWKSOptions: cfg.OIDC.JWKS, AccessTokenVerifyMethod: cfg.OIDC.AccessTokenVerifyMethod, }) - // authenticators = append(authenticators, middleware.PublicShareAuthenticator{ - // Logger: logger, - // RevaGatewayClient: revaClient, - // }) + authenticators = append(authenticators, middleware.PublicShareAuthenticator{ + Logger: logger, + RevaGatewayClient: revaClient, + }) + + authenticators = append(authenticators, middleware.SignedURLAuthenticator{ + Logger: logger, + PreSignedURLConfig: cfg.PreSignedURL, + UserProvider: userProvider, + Store: storeClient, + }) return alice.New( // first make sure we log all requests and redirect to https if necessary @@ -211,18 +219,6 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) oidcHTTPClient, ), - // middleware.AuthenticationOld( - // // OIDC Options - // middleware.OIDCProviderFunc(func() (middleware.OIDCProvider, error) { - // // Initialize a provider by specifying the issuer URL. - // // it will fetch the keys from the issuer using the .well-known - // // endpoint - // return oidc.NewProvider( - // context.WithValue(ctx, oauth2.HTTPClient, oidcHTTPClient), - // cfg.OIDC.Issuer, - // ) - // }), - middleware.Authentication( authenticators, middleware.CredentialsByUserAgent(cfg.AuthMiddleware.CredentialsByUserAgent), @@ -230,25 +226,6 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) middleware.OIDCIss(cfg.OIDC.Issuer), middleware.EnableBasicAuth(cfg.EnableBasicAuth), ), - // middleware.HTTPClient(oidcHTTPClient), - // middleware.TokenCacheSize(cfg.OIDC.UserinfoCache.Size), - // middleware.TokenCacheTTL(time.Second*time.Duration(cfg.OIDC.UserinfoCache.TTL)), - // - // // basic Options - // middleware.Logger(logger), - // middleware.EnableBasicAuth(cfg.EnableBasicAuth), - // middleware.UserProvider(userProvider), - // middleware.OIDCIss(cfg.OIDC.Issuer), - // middleware.UserOIDCClaim(cfg.UserOIDCClaim), - // middleware.UserCS3Claim(cfg.UserCS3Claim), - // middleware.CredentialsByUserAgent(cfg.AuthMiddleware.CredentialsByUserAgent), - // ), - // middleware.SignedURLAuth( - // middleware.Logger(logger), - // middleware.PreSignedURLConfig(cfg.PreSignedURL), - // middleware.UserProvider(userProvider), - // middleware.Store(storeClient), - // ), middleware.AccountResolver( middleware.Logger(logger), middleware.UserProvider(userProvider), @@ -270,9 +247,5 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) middleware.TokenManagerConfig(*cfg.TokenManager), middleware.RevaGatewayClient(revaClient), ), - // middleware.PublicShareAuth( - // middleware.Logger(logger), - // middleware.RevaGatewayClient(revaClient), - // ), ) } diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 651876f35f..6c961657d1 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -18,7 +18,7 @@ var ( // regexp.Regexp which are safe to use concurrently. ProxyWwwAuthenticate = []regexp.Regexp{*regexp.MustCompile("/ocs/v[12].php/cloud/")} - _publicPaths = []string{ + _publicPaths = [...]string{ "/dav/public-files/", "/remote.php/dav/public-files/", "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", @@ -164,57 +164,3 @@ func evalRequestURI(l userAgentLocker, r regexp.Regexp) { } l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(l.fallback), l.r.Host)) } - -// AuthenticationOld is a higher order authentication middleware. -func AuthenticationOld(opts ...Option) func(next http.Handler) http.Handler { - options := newOptions(opts...) - - configureSupportedChallenges(options) - oidc := newOIDCAuth(options) - // basic := newBasicAuth(options) - - return func(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if options.OIDCIss != "" && options.EnableBasicAuth { - //oidc(basic(next)).ServeHTTP(w, r) - oidc(next).ServeHTTP(w, r) - } - - if options.OIDCIss != "" && !options.EnableBasicAuth { - oidc(next).ServeHTTP(w, r) - } - - // if options.OIDCIss == "" && options.EnableBasicAuth { - // basic(next).ServeHTTP(w, r) - // } - }) - } -} - -// newOIDCAuth returns a configured oidc middleware -func newOIDCAuth(options Options) func(http.Handler) http.Handler { - return OIDCAuth( - Logger(options.Logger), - OIDCProviderFunc(options.OIDCProviderFunc), - HTTPClient(options.HTTPClient), - OIDCIss(options.OIDCIss), - TokenCacheSize(options.UserinfoCacheSize), - TokenCacheTTL(options.UserinfoCacheTTL), - CredentialsByUserAgent(options.CredentialsByUserAgent), - AccessTokenVerifyMethod(options.AccessTokenVerifyMethod), - JWKSOptions(options.JWKS), - ) -} - -// // newBasicAuth returns a configured basic middleware -// func newBasicAuth(options Options) func(http.Handler) http.Handler { -// return BasicAuth( -// UserProvider(options.UserProvider), -// Logger(options.Logger), -// EnableBasicAuth(options.EnableBasicAuth), -// OIDCIss(options.OIDCIss), -// UserOIDCClaim(options.UserOIDCClaim), -// UserCS3Claim(options.UserCS3Claim), -// CredentialsByUserAgent(options.CredentialsByUserAgent), -// ) -// } diff --git a/services/proxy/pkg/middleware/basic_auth.go b/services/proxy/pkg/middleware/basic_auth.go index 4771e57f21..eaccd70425 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -15,22 +15,26 @@ type BasicAuthenticator struct { UserOIDCClaim string } -func (m BasicAuthenticator) Authenticate(req *http.Request) (*http.Request, bool) { - if isPublicPath(req.URL.Path) { +func (m BasicAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { + if isPublicPath(r.URL.Path) { // The authentication of public path requests is handled by another authenticator. // Since we can't guarantee the order of execution of the authenticators, we better // implement an early return here for paths we can't authenticate in this authenticator. return nil, false } - login, password, ok := req.BasicAuth() + login, password, ok := r.BasicAuth() if !ok { return nil, false } - user, _, err := m.UserProvider.Authenticate(req.Context(), login, password) + user, _, err := m.UserProvider.Authenticate(r.Context(), login, password) if err != nil { - // TODO add log line + m.Logger.Error(). + Err(err). + Str("authenticator", "basic"). + Str("path", r.URL.Path). + Msg("failed to authenticate request") return nil, false } @@ -48,5 +52,9 @@ func (m BasicAuthenticator) Authenticate(req *http.Request) (*http.Request, bool claims[m.UserOIDCClaim] = user.Id.OpaqueId } - return req.WithContext(oidc.NewContext(req.Context(), claims)), true + m.Logger.Debug(). + Str("authenticator", "basic"). + Str("path", r.URL.Path). + Msg("successfully authenticated request") + return r.WithContext(oidc.NewContext(r.Context(), claims)), true } diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index 97a71962ff..5d740843d1 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -3,7 +3,6 @@ package middleware import ( "context" "encoding/json" - "errors" "io/ioutil" "net/http" "strings" @@ -17,9 +16,20 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/oidc" osync "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/services/proxy/pkg/config" + "github.com/pkg/errors" "golang.org/x/oauth2" ) +const ( + _headerAuthorization = "Authorization" + _bearerPrefix = "Bearer " +) + +var ( + // _unauthenticatePaths contains paths which don't need to be authenticated. + _unauthenticatePaths = [...]string{"/konnect/v1/userinfo", "/status.php"} +) + // OIDCProvider used to mock the oidc provider during tests type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) @@ -42,14 +52,13 @@ type OIDCAuthenticator struct { JWKS *keyfunc.JWKS } -func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (claims map[string]interface{}, status int) { +func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (map[string]interface{}, error) { + var claims map[string]interface{} hit := m.TokenCache.Load(token) if hit == nil { aClaims, err := m.verifyAccessToken(token) if err != nil { - m.Logger.Error().Err(err).Msg("Failed to verify access token") - status = http.StatusUnauthorized - return + return nil, errors.Wrap(err, "failed to verify access token") } oauth2Token := &oauth2.Token{ @@ -61,31 +70,25 @@ func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (claims ma oauth2.StaticTokenSource(oauth2Token), ) if err != nil { - m.Logger.Error().Err(err).Msg("Failed to get userinfo") - status = http.StatusUnauthorized - return + return nil, errors.Wrap(err, "failed to get userinfo") } - if err := userInfo.Claims(&claims); err != nil { - m.Logger.Error().Err(err).Interface("userinfo", userInfo).Msg("failed to unmarshal userinfo claims") - status = http.StatusInternalServerError - return + return nil, errors.Wrap(err, "failed to unmarshal userinfo claims") } expiration := m.extractExpiration(aClaims) m.TokenCache.Store(token, claims, expiration) m.Logger.Debug().Interface("claims", claims).Interface("userInfo", userInfo).Time("expiration", expiration.UTC()).Msg("unmarshalled and cached userinfo") - return + return claims, nil } var ok bool if claims, ok = hit.V.(map[string]interface{}); !ok { - status = http.StatusInternalServerError - return + return nil, errors.New("failed to cast claims from the cache") } m.Logger.Debug().Interface("claims", claims).Msg("cache hit for userinfo") - return + return claims, nil } func (m OIDCAuthenticator) verifyAccessToken(token string) (jwt.RegisteredClaims, error) { @@ -139,21 +142,20 @@ func (m OIDCAuthenticator) extractExpiration(aClaims jwt.RegisteredClaims) time. } func (m OIDCAuthenticator) shouldServe(req *http.Request) bool { - header := req.Header.Get("Authorization") - if m.OIDCIss == "" { return false } // todo: looks dirty, check later // TODO: make a PR to coreos/go-oidc for exposing userinfo endpoint on provider, see https://github.com/coreos/go-oidc/issues/248 - for _, ignoringPath := range []string{"/konnect/v1/userinfo", "/status.php"} { + for _, ignoringPath := range _unauthenticatePaths { if req.URL.Path == ignoringPath { return false } } - return strings.HasPrefix(header, "Bearer ") + header := req.Header.Get(_headerAuthorization) + return strings.HasPrefix(header, _bearerPrefix) } type jwksJSON struct { @@ -234,14 +236,10 @@ func (m *OIDCAuthenticator) getProvider() OIDCProvider { func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { // there is no bearer token on the request, if !m.shouldServe(r) { - // // oidc supported but token not present, add header and handover to the next middleware. - // userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, "bearer") - // next.ServeHTTP(w, r) return nil, false } if m.getProvider() == nil { - // w.WriteHeader(http.StatusInternalServerError) return nil, false } // Force init of jwks keyfunc if needed (contacts the .well-known and jwks endpoints on first call) @@ -249,13 +247,20 @@ func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { return nil, false } - token := strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ") + token := strings.TrimPrefix(r.Header.Get(_headerAuthorization), _bearerPrefix) - claims, status := m.getClaims(token, r) - if status != 0 { - // w.WriteHeader(status) - // TODO log + claims, err := m.getClaims(token, r) + if err != nil { + m.Logger.Error(). + Err(err). + Str("authenticator", "oidc"). + Str("path", r.URL.Path). + Msg("failed to authenticate the request") return nil, false } + m.Logger.Debug(). + Str("authenticator", "oidc"). + Str("path", r.URL.Path). + Msg("successfully authenticated request") return r.WithContext(oidc.NewContext(r.Context(), claims)), true } diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index 6d6d0fa747..795063d5d0 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -13,6 +13,9 @@ const ( headerShareToken = "public-token" basicAuthPasswordPrefix = "password|" authenticationType = "publicshares" + + _paramSignature = "signature" + _paramExpiration = "expiration" ) type PublicShareAuthenticator struct { @@ -38,8 +41,8 @@ func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, } var sharePassword string - if signature := query.Get("signature"); signature != "" { - expiration := query.Get("expiration") + if signature := query.Get(_paramSignature); signature != "" { + expiration := query.Get(_paramExpiration) if expiration == "" { a.Logger.Warn().Str("signature", signature).Msg("cannot do signature auth without the expiration") return nil, false @@ -62,11 +65,20 @@ func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, }) if err != nil { - a.Logger.Debug().Err(err).Str("public_share_token", shareToken).Msg("could not authenticate public share") - // try another middleware + a.Logger.Error(). + Err(err). + Str("authenticator", "public_share"). + Str("public_share_token", shareToken). + Str("path", r.URL.Path). + Msg("failed to authenticate request") return nil, false } r.Header.Add(headerRevaAccessToken, authResp.Token) + + a.Logger.Debug(). + Str("authenticator", "public_share"). + Str("path", r.URL.Path). + Msg("successfully authenticated request") return r, false } diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index 094c279ad4..80a613aace 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -20,58 +20,36 @@ import ( "golang.org/x/crypto/pbkdf2" ) -// SignedURLAuth provides a middleware to check access secured by a signed URL. -func SignedURLAuth(optionSetters ...Option) func(next http.Handler) http.Handler { - options := newOptions(optionSetters...) +const ( + _paramOCSignature = "OC-Signature" + _paramOCCredential = "OC-Credential" + _paramOCDate = "OC-Date" + _paramOCExpires = "OC-Expires" + _paramOCVerb = "OC-Verb" +) - return func(next http.Handler) http.Handler { - return &SignedURLAuthenticator{ - next: next, - logger: options.Logger, - preSignedURLConfig: options.PreSignedURLConfig, - store: options.Store, - userProvider: options.UserProvider, - } +var ( + _requiredParams = [...]string{ + _paramOCSignature, + _paramOCCredential, + _paramOCDate, + _paramOCExpires, + _paramOCVerb, } -} +) type SignedURLAuthenticator struct { - next http.Handler - logger log.Logger - preSignedURLConfig config.PreSignedURL - userProvider backend.UserBackend - store storesvc.StoreService -} - -func (m SignedURLAuthenticator) ServeHTTP(w http.ResponseWriter, req *http.Request) { - if !m.shouldServe(req) { - m.next.ServeHTTP(w, req) - return - } - - user, _, err := m.userProvider.GetUserByClaims(req.Context(), "username", req.URL.Query().Get("OC-Credential"), true) - if err != nil { - m.logger.Error().Err(err).Msg("Could not get user by claim") - w.WriteHeader(http.StatusInternalServerError) - } - - ctx := revactx.ContextSetUser(req.Context(), user) - - req = req.WithContext(ctx) - - if err := m.validate(req); err != nil { - http.Error(w, "Invalid url signature", http.StatusUnauthorized) - return - } - - m.next.ServeHTTP(w, req) + Logger log.Logger + PreSignedURLConfig config.PreSignedURL + UserProvider backend.UserBackend + Store storesvc.StoreService } func (m SignedURLAuthenticator) shouldServe(req *http.Request) bool { - if !m.preSignedURLConfig.Enabled { + if !m.PreSignedURLConfig.Enabled { return false } - return req.URL.Query().Get("OC-Signature") != "" + return req.URL.Query().Get(_paramOCSignature) != "" } func (m SignedURLAuthenticator) validate(req *http.Request) (err error) { @@ -107,13 +85,7 @@ func (m SignedURLAuthenticator) allRequiredParametersArePresent(query url.Values // OC-Date - defined the date the url was signed (ISO 8601 UTC) REQUIRED // OC-Expires - defines the expiry interval in seconds (between 1 and 604800 = 7 days) REQUIRED // TODO OC-Verb - defines for which http verb the request is valid - defaults to GET OPTIONAL - for _, p := range []string{ - "OC-Signature", - "OC-Credential", - "OC-Date", - "OC-Expires", - "OC-Verb", - } { + for _, p := range _requiredParams { if query.Get(p) == "" { return false, fmt.Errorf("required %s parameter not found", p) } @@ -124,7 +96,7 @@ func (m SignedURLAuthenticator) allRequiredParametersArePresent(query url.Values func (m SignedURLAuthenticator) requestMethodMatches(meth string, query url.Values) (ok bool, err error) { // check if given url query parameter OC-Verb matches given request method - if !strings.EqualFold(meth, query.Get("OC-Verb")) { + if !strings.EqualFold(meth, query.Get(_paramOCVerb)) { return false, errors.New("required OC-Verb parameter did not match request method") } @@ -134,7 +106,7 @@ func (m SignedURLAuthenticator) requestMethodMatches(meth string, query url.Valu func (m SignedURLAuthenticator) requestMethodIsAllowed(meth string) (ok bool, err error) { // check if given request method is allowed methodIsAllowed := false - for _, am := range m.preSignedURLConfig.AllowedHTTPMethods { + for _, am := range m.PreSignedURLConfig.AllowedHTTPMethods { if strings.EqualFold(meth, am) { methodIsAllowed = true break @@ -147,14 +119,15 @@ func (m SignedURLAuthenticator) requestMethodIsAllowed(meth string) (ok bool, er return true, nil } + func (m SignedURLAuthenticator) urlIsExpired(query url.Values, now func() time.Time) (expired bool, err error) { // check if url is expired by checking if given date (OC-Date) + expires in seconds (OC-Expires) is after now - validFrom, err := time.Parse(time.RFC3339, query.Get("OC-Date")) + validFrom, err := time.Parse(time.RFC3339, query.Get(_paramOCDate)) if err != nil { return true, err } - requestExpiry, err := time.ParseDuration(query.Get("OC-Expires") + "s") + requestExpiry, err := time.ParseDuration(query.Get(_paramOCExpires) + "s") if err != nil { return true, err } @@ -168,16 +141,16 @@ func (m SignedURLAuthenticator) signatureIsValid(req *http.Request) (ok bool, er u := revactx.ContextMustGetUser(req.Context()) signingKey, err := m.getSigningKey(req.Context(), u.Id.OpaqueId) if err != nil { - m.logger.Error().Err(err).Msg("could not retrieve signing key") + m.Logger.Error().Err(err).Msg("could not retrieve signing key") return false, err } if len(signingKey) == 0 { - m.logger.Error().Err(err).Msg("signing key empty") + m.Logger.Error().Err(err).Msg("signing key empty") return false, err } q := req.URL.Query() - signature := q.Get("OC-Signature") - q.Del("OC-Signature") + signature := q.Get(_paramOCSignature) + q.Del(_paramOCSignature) req.URL.RawQuery = q.Encode() url := req.URL.String() if !req.URL.IsAbs() { @@ -198,7 +171,7 @@ func (m SignedURLAuthenticator) createSignature(url string, signingKey []byte) s } func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) { - res, err := m.store.Read(ctx, &storesvc.ReadRequest{ + res, err := m.Store.Read(ctx, &storesvc.ReadRequest{ Options: &storemsg.ReadOptions{ Database: "proxy", Table: "signing-keys", @@ -206,7 +179,7 @@ func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string Key: ocisID, }) if err != nil || len(res.Records) < 1 { - return []byte{}, err + return nil, err } return res.Records[0].Value, nil @@ -217,9 +190,13 @@ func (m SignedURLAuthenticator) Authenticate(r *http.Request) (*http.Request, bo return nil, false } - user, _, err := m.userProvider.GetUserByClaims(r.Context(), "username", r.URL.Query().Get("OC-Credential"), true) + user, _, err := m.UserProvider.GetUserByClaims(r.Context(), "username", r.URL.Query().Get(_paramOCCredential), true) if err != nil { - m.logger.Error().Err(err).Msg("Could not get user by claim") + m.Logger.Error(). + Err(err). + Str("authenticator", "signed_url"). + Str("path", r.URL.Path). + Msg("Could not get user by claim") return nil, false } @@ -228,9 +205,17 @@ func (m SignedURLAuthenticator) Authenticate(r *http.Request) (*http.Request, bo r = r.WithContext(ctx) if err := m.validate(r); err != nil { - // http.Error(w, "Invalid url signature", http.StatusUnauthorized) + m.Logger.Error(). + Err(err). + Str("authenticator", "signed_url"). + Str("path", r.URL.Path). + Msg("Could not get user by claim") return nil, false } + m.Logger.Debug(). + Str("authenticator", "signed_url"). + Str("path", r.URL.Path). + Msg("successfully authenticated request") return r, true } From ddfc01bff9242db5042f751ee91ef41d8cbfb5ad Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 8 Aug 2022 16:59:05 +0200 Subject: [PATCH 011/103] refactor unprotected paths check --- .../proxy/pkg/middleware/authentication.go | 51 ++++++++++++++----- services/proxy/pkg/middleware/oidc_auth.go | 13 ----- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 6c961657d1..887e116be2 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -23,7 +23,31 @@ var ( "/remote.php/dav/public-files/", "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", "/ocs/v1.php/cloud/capabilities", - "/data", + } + // _unprotectedPaths contains paths which don't need to be authenticated. + _unprotectedPaths = map[string]struct{}{ + "/": {}, + "/login": {}, + "/app/list": {}, + "/config.json": {}, + "/oidc-callback.html": {}, + "/oidc-callback": {}, + "/settings.js": {}, + "/data": {}, + "/konnect/v1/userinfo": {}, + "/status.php": {}, + } + // _unprotectedPathPrefixes contains paths which don't need to be authenticated. + _unprotectedPathPrefixes = [...]string{ + "/files", + "/settings", + "/user-management", + "/.well-known", + "/js", + "/icons", + "/themes", + "/signin", + "/konnect", } ) @@ -46,18 +70,7 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if isOIDCTokenAuth(r) || - r.URL.Path == "/" || - strings.HasPrefix(r.URL.Path, "/.well-known") || - r.URL.Path == "/login" || - strings.HasPrefix(r.URL.Path, "/js") || - strings.HasPrefix(r.URL.Path, "/themes") || - strings.HasPrefix(r.URL.Path, "/signin") || - strings.HasPrefix(r.URL.Path, "/konnect") || - r.URL.Path == "/config.json" || - r.URL.Path == "/oidc-callback.html" || - r.URL.Path == "/oidc-callback" || - r.URL.Path == "/settings.js" { + if isOIDCTokenAuth(r) || isUnprotectedPath(r) { // The authentication for this request is handled by the IdP. next.ServeHTTP(w, r) return @@ -96,6 +109,18 @@ func isOIDCTokenAuth(req *http.Request) bool { return req.URL.Path == "/konnect/v1/token" } +func isUnprotectedPath(r *http.Request) bool { + if _, ok := _unprotectedPaths[r.URL.Path]; ok { + return true + } + for _, p := range _unprotectedPathPrefixes { + if strings.HasPrefix(r.URL.Path, p) { + return true + } + } + return false +} + func isPublicPath(p string) bool { for _, pp := range _publicPaths { if strings.HasPrefix(p, pp) { diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index 5d740843d1..a6c1b5519d 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -25,11 +25,6 @@ const ( _bearerPrefix = "Bearer " ) -var ( - // _unauthenticatePaths contains paths which don't need to be authenticated. - _unauthenticatePaths = [...]string{"/konnect/v1/userinfo", "/status.php"} -) - // OIDCProvider used to mock the oidc provider during tests type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) @@ -146,14 +141,6 @@ func (m OIDCAuthenticator) shouldServe(req *http.Request) bool { return false } - // todo: looks dirty, check later - // TODO: make a PR to coreos/go-oidc for exposing userinfo endpoint on provider, see https://github.com/coreos/go-oidc/issues/248 - for _, ignoringPath := range _unauthenticatePaths { - if req.URL.Path == ignoringPath { - return false - } - } - header := req.Header.Get(_headerAuthorization) return strings.HasPrefix(header, _bearerPrefix) } From ef020920e8155d442b5c538ab10a296d4c08da74 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 8 Aug 2022 17:23:47 +0200 Subject: [PATCH 012/103] update authentication tests --- .../pkg/middleware/authentication_test.go | 19 ++++++++++ .../proxy/pkg/middleware/basic_auth_test.go | 38 ------------------- .../pkg/middleware/signed_url_auth_test.go | 4 +- 3 files changed, 21 insertions(+), 40 deletions(-) create mode 100644 services/proxy/pkg/middleware/authentication_test.go delete mode 100644 services/proxy/pkg/middleware/basic_auth_test.go diff --git a/services/proxy/pkg/middleware/authentication_test.go b/services/proxy/pkg/middleware/authentication_test.go new file mode 100644 index 0000000000..1188fefa34 --- /dev/null +++ b/services/proxy/pkg/middleware/authentication_test.go @@ -0,0 +1,19 @@ +package middleware + +import ( + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var _ = Describe("authentication helpers", func() { + DescribeTable("isPublicPath should recognize public paths", + func(input string, expected bool) { + isPublic := isPublicPath(input) + Expect(isPublic).To(Equal(expected)) + }, + Entry("public files path", "/remote.php/dav/public-files/", true), + Entry("public files path without remote.php", "/remote.php/dav/public-files/", true), + Entry("token info path", "/remote.php/ocs/apps/files_sharing/api/v1/tokeninfo/unprotected", true), + Entry("capabilities", "/ocs/v1.php/cloud/capabilities", true), + ) +}) diff --git a/services/proxy/pkg/middleware/basic_auth_test.go b/services/proxy/pkg/middleware/basic_auth_test.go deleted file mode 100644 index 77279d66b4..0000000000 --- a/services/proxy/pkg/middleware/basic_auth_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package middleware - -import ( - "net/http/httptest" - "testing" -) - -/**/ - -func TestBasicAuth__isPublicLink(t *testing.T) { - tests := []struct { - url string - username string - expected bool - }{ - {url: "/remote.php/dav/public-files/", username: "", expected: false}, - {url: "/remote.php/dav/public-files/", username: "abc", expected: false}, - {url: "/remote.php/dav/public-files/", username: "private", expected: false}, - {url: "/remote.php/dav/public-files/", username: "public", expected: true}, - {url: "/ocs/v1.php/cloud/capabilities", username: "", expected: false}, - {url: "/ocs/v1.php/cloud/capabilities", username: "abc", expected: false}, - {url: "/ocs/v1.php/cloud/capabilities", username: "private", expected: false}, - {url: "/ocs/v1.php/cloud/capabilities", username: "public", expected: true}, - {url: "/ocs/v1.php/cloud/users/admin", username: "public", expected: false}, - } - for _, tt := range tests { - req := httptest.NewRequest("", tt.url, nil) - - if tt.username != "" { - req.SetBasicAuth(tt.username, "") - } - - result := isPublicPath(req.URL.Path) - if result != tt.expected { - t.Errorf("with %s expected %t got %t", tt.url, tt.expected, result) - } - } -} diff --git a/services/proxy/pkg/middleware/signed_url_auth_test.go b/services/proxy/pkg/middleware/signed_url_auth_test.go index 01311b731e..35f84e6655 100644 --- a/services/proxy/pkg/middleware/signed_url_auth_test.go +++ b/services/proxy/pkg/middleware/signed_url_auth_test.go @@ -20,7 +20,7 @@ func TestSignedURLAuth_shouldServe(t *testing.T) { } for _, tt := range tests { - pua.preSignedURLConfig.Enabled = tt.enabled + pua.PreSignedURLConfig.Enabled = tt.enabled r := httptest.NewRequest("", tt.url, nil) result := pua.shouldServe(r) @@ -89,7 +89,7 @@ func TestSignedURLAuth_requestMethodIsAllowed(t *testing.T) { } for _, tt := range tests { - pua.preSignedURLConfig.AllowedHTTPMethods = tt.allowed + pua.PreSignedURLConfig.AllowedHTTPMethods = tt.allowed ok, _ := pua.requestMethodIsAllowed(tt.method) if ok != tt.expected { From 7bc1305cb4a5f0de769d0c357328174e071a144a Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 9 Aug 2022 15:32:35 +0200 Subject: [PATCH 013/103] add tests for the basic auth middleware --- .../proxy/pkg/middleware/basic_auth_test.go | 68 +++++++++++++++++++ .../pkg/middleware/middleware_suite_test.go | 13 ++++ .../proxy/pkg/middleware/oidc_auth_test.go | 36 ++++------ 3 files changed, 95 insertions(+), 22 deletions(-) create mode 100644 services/proxy/pkg/middleware/basic_auth_test.go create mode 100644 services/proxy/pkg/middleware/middleware_suite_test.go diff --git a/services/proxy/pkg/middleware/basic_auth_test.go b/services/proxy/pkg/middleware/basic_auth_test.go new file mode 100644 index 0000000000..fcc2e6f3ce --- /dev/null +++ b/services/proxy/pkg/middleware/basic_auth_test.go @@ -0,0 +1,68 @@ +package middleware + +import ( + "context" + "net/http" + "net/http/httptest" + + userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" + . "github.com/onsi/ginkgo/v2" + + . "github.com/onsi/gomega" + "github.com/owncloud/ocis/v2/ocis-pkg/log" + "github.com/owncloud/ocis/v2/ocis-pkg/oidc" + "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend" + "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend/test" +) + +var _ = Describe("Authenticating requests", Label("BasicAuthenticator"), func() { + var authenticator Authenticator + BeforeEach(func() { + authenticator = BasicAuthenticator{ + Logger: log.NewLogger(), + UserProvider: &test.UserBackendMock{ + AuthenticateFunc: func(ctx context.Context, username, password string) (*userv1beta1.User, string, error) { + var user *userv1beta1.User + if username == "testuser" && password == "testpassword" { + user = &userv1beta1.User{ + Id: &userv1beta1.UserId{ + Idp: "IdpId", + OpaqueId: "OpaqueId", + }, + Username: "testuser", + Mail: "testuser@example.com", + } + return user, "", nil + } + return nil, "", backend.ErrAccountNotFound + }, + }, + } + }) + + When("the request contains correct data", func() { + It("should successfully authenticate", func() { + req := httptest.NewRequest(http.MethodGet, "http://example.com/example/path", http.NoBody) + req.SetBasicAuth("testuser", "testpassword") + + req2, valid := authenticator.Authenticate(req) + + Expect(valid).To(Equal(true)) + Expect(req2).ToNot(BeNil()) + }) + It("adds claims to the request context", func() { + req := httptest.NewRequest(http.MethodGet, "http://example.com/example/path", http.NoBody) + req.SetBasicAuth("testuser", "testpassword") + + req2, valid := authenticator.Authenticate(req) + Expect(valid).To(Equal(true)) + + claims := oidc.FromContext(req2.Context()) + Expect(claims).ToNot(BeNil()) + Expect(claims[oidc.Iss]).To(Equal("IdpId")) + Expect(claims[oidc.PreferredUsername]).To(Equal("testuser")) + Expect(claims[oidc.Email]).To(Equal("testuser@example.com")) + Expect(claims[oidc.OwncloudUUID]).To(Equal("OpaqueId")) + }) + }) +}) diff --git a/services/proxy/pkg/middleware/middleware_suite_test.go b/services/proxy/pkg/middleware/middleware_suite_test.go new file mode 100644 index 0000000000..09e4e11360 --- /dev/null +++ b/services/proxy/pkg/middleware/middleware_suite_test.go @@ -0,0 +1,13 @@ +package middleware_test + +import ( + "testing" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +func TestMiddleware(t *testing.T) { + RegisterFailHandler(Fail) + RunSpecs(t, "Middleware Suite") +} diff --git a/services/proxy/pkg/middleware/oidc_auth_test.go b/services/proxy/pkg/middleware/oidc_auth_test.go index 6b7e97bceb..93612e3c48 100644 --- a/services/proxy/pkg/middleware/oidc_auth_test.go +++ b/services/proxy/pkg/middleware/oidc_auth_test.go @@ -5,35 +5,27 @@ import ( "fmt" "net/http" "net/http/httptest" - "testing" "github.com/coreos/go-oidc/v3/oidc" - "github.com/owncloud/ocis/v2/ocis-pkg/log" - "github.com/owncloud/ocis/v2/services/proxy/pkg/config" + . "github.com/onsi/ginkgo/v2" "golang.org/x/oauth2" ) -func TestOIDCAuthMiddleware(t *testing.T) { - next := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}) +var _ = Describe("Test OIDC Authenticator", func() { + It("should authenticate requests", func() { + m := OIDCAuthenticator{ + ProviderFunc: func() (OIDCProvider, error) { return mockOP(false), nil }, + } - m := OIDCAuth( - Logger(log.NewLogger()), - OIDCProviderFunc(func() (OIDCProvider, error) { - return mockOP(false), nil - }), - OIDCIss("https://localhost:9200"), - AccessTokenVerifyMethod(config.AccessTokenVerificationNone), - )(next) + r := httptest.NewRequest(http.MethodGet, "https://idp.example.com", nil) + r.Header.Set("Authorization", "Bearer sometoken") - r := httptest.NewRequest(http.MethodGet, "https://idp.example.com", nil) - r.Header.Set("Authorization", "Bearer sometoken") - w := httptest.NewRecorder() - m.ServeHTTP(w, r) - - if w.Code != http.StatusInternalServerError { - t.Errorf("expected an internal server error") - } -} + _, ok := m.Authenticate(r) + if ok { + Fail("expected an internal server error") + } + }) +}) type mockOIDCProvider struct { UserInfoFunc func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) From 17a4e65f082601baaf1560722a24f55a42ff7918 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 9 Aug 2022 16:50:05 +0200 Subject: [PATCH 014/103] add tests for the public share auth middleware --- .../proxy/pkg/middleware/public_share_auth.go | 6 +- .../pkg/middleware/public_share_auth_test.go | 78 +++++++++++++++++++ 2 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 services/proxy/pkg/middleware/public_share_auth_test.go diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index 795063d5d0..b32f9ed147 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -9,7 +9,7 @@ import ( ) const ( - headerRevaAccessToken = "x-access-token" + _headerRevaAccessToken = "x-access-token" headerShareToken = "public-token" basicAuthPasswordPrefix = "password|" authenticationType = "publicshares" @@ -74,11 +74,11 @@ func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, return nil, false } - r.Header.Add(headerRevaAccessToken, authResp.Token) + r.Header.Add(_headerRevaAccessToken, authResp.Token) a.Logger.Debug(). Str("authenticator", "public_share"). Str("path", r.URL.Path). Msg("successfully authenticated request") - return r, false + return r, true } diff --git a/services/proxy/pkg/middleware/public_share_auth_test.go b/services/proxy/pkg/middleware/public_share_auth_test.go new file mode 100644 index 0000000000..98637988bd --- /dev/null +++ b/services/proxy/pkg/middleware/public_share_auth_test.go @@ -0,0 +1,78 @@ +package middleware + +import ( + "context" + "net/http" + "net/http/httptest" + + gatewayv1beta1 "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" + rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/owncloud/ocis/v2/ocis-pkg/log" + "google.golang.org/grpc" +) + +var _ = Describe("Authenticating requests", Label("PublicShareAuthenticator"), func() { + var authenticator Authenticator + BeforeEach(func() { + authenticator = PublicShareAuthenticator{ + Logger: log.NewLogger(), + RevaGatewayClient: mockGatewayClient{ + AuthenticateFunc: func(authType, clientID, clientSecret string) (string, rpcv1beta1.Code) { + if authType != "publicshares" { + return "", rpcv1beta1.Code_CODE_NOT_FOUND + } + + if clientID == "sharetoken" && (clientSecret == "password|examples3cr3t" || clientSecret == "signature|examplesignature|exampleexpiration") { + return "exampletoken", rpcv1beta1.Code_CODE_OK + } + + return "", rpcv1beta1.Code_CODE_NOT_FOUND + }, + }, + } + }) + When("the request contains correct data", func() { + Context("using password authentication", func() { + It("should successfully authenticate", func() { + req := httptest.NewRequest(http.MethodGet, "http://example.com/dav/public-files/?public-token=sharetoken", http.NoBody) + req.SetBasicAuth("public", "examples3cr3t") + + req2, valid := authenticator.Authenticate(req) + + Expect(valid).To(Equal(true)) + Expect(req2).ToNot(BeNil()) + + h := req2.Header + Expect(h.Get(_headerRevaAccessToken)).To(Equal("exampletoken")) + }) + }) + Context("using signature authentication", func() { + It("should successfully authenticate", func() { + req := httptest.NewRequest(http.MethodGet, "http://example.com/dav/public-files/?public-token=sharetoken&signature=examplesignature&expiration=exampleexpiration", http.NoBody) + + req2, valid := authenticator.Authenticate(req) + + Expect(valid).To(Equal(true)) + Expect(req2).ToNot(BeNil()) + + h := req2.Header + Expect(h.Get(_headerRevaAccessToken)).To(Equal("exampletoken")) + }) + }) + }) +}) + +type mockGatewayClient struct { + gatewayv1beta1.GatewayAPIClient + AuthenticateFunc func(authType, clientID, clientSecret string) (string, rpcv1beta1.Code) +} + +func (c mockGatewayClient) Authenticate(ctx context.Context, in *gatewayv1beta1.AuthenticateRequest, opts ...grpc.CallOption) (*gatewayv1beta1.AuthenticateResponse, error) { + token, code := c.AuthenticateFunc(in.GetType(), in.GetClientId(), in.GetClientSecret()) + return &gatewayv1beta1.AuthenticateResponse{ + Status: &rpcv1beta1.Status{Code: code}, + Token: token, + }, nil +} From 9347657370fc3e316949974e8394a998a9e249fe Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 9 Aug 2022 17:17:37 +0200 Subject: [PATCH 015/103] remove the oidc tests since they aren't testing anything at the moment I admit it would be better to implement the tests but I tried and it is a bit tricky since we can't mock everything we would need to mock. I'll wan to get these changes in first and later in the near future we should revisit the auth middleware architecture and refactor it a bit more to be more testable and future proof. --- .../proxy/pkg/middleware/oidc_auth_test.go | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 services/proxy/pkg/middleware/oidc_auth_test.go diff --git a/services/proxy/pkg/middleware/oidc_auth_test.go b/services/proxy/pkg/middleware/oidc_auth_test.go deleted file mode 100644 index 93612e3c48..0000000000 --- a/services/proxy/pkg/middleware/oidc_auth_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package middleware - -import ( - "context" - "fmt" - "net/http" - "net/http/httptest" - - "github.com/coreos/go-oidc/v3/oidc" - . "github.com/onsi/ginkgo/v2" - "golang.org/x/oauth2" -) - -var _ = Describe("Test OIDC Authenticator", func() { - It("should authenticate requests", func() { - m := OIDCAuthenticator{ - ProviderFunc: func() (OIDCProvider, error) { return mockOP(false), nil }, - } - - r := httptest.NewRequest(http.MethodGet, "https://idp.example.com", nil) - r.Header.Set("Authorization", "Bearer sometoken") - - _, ok := m.Authenticate(r) - if ok { - Fail("expected an internal server error") - } - }) -}) - -type mockOIDCProvider struct { - UserInfoFunc func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) -} - -// UserInfo will panic if the function has been called, but not mocked -func (m mockOIDCProvider) UserInfo(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) { - if m.UserInfoFunc != nil { - return m.UserInfoFunc(ctx, ts) - } - - panic("UserInfo was called in test but not mocked") -} - -func mockOP(retErr bool) OIDCProvider { - if retErr { - return &mockOIDCProvider{ - UserInfoFunc: func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) { - return nil, fmt.Errorf("error returned by mockOIDCProvider UserInfo") - }, - } - - } - return &mockOIDCProvider{ - UserInfoFunc: func(ctx context.Context, ts oauth2.TokenSource) (*oidc.UserInfo, error) { - ui := &oidc.UserInfo{ - // claims: private ... - } - return ui, nil - }, - } - -} From 06ffd9cf8a66f3c747a362c90f0db1911da246a2 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 10 Aug 2022 13:39:15 +0200 Subject: [PATCH 016/103] some more cleaning up --- services/proxy/pkg/command/server.go | 21 ++++++-------- .../proxy/pkg/middleware/authentication.go | 2 ++ services/proxy/pkg/middleware/oidc_auth.go | 29 +++++++++++++++---- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 7377d95829..e54538f716 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -16,7 +16,6 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/log" pkgmiddleware "github.com/owncloud/ocis/v2/ocis-pkg/middleware" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" settingssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0" storesvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/store/v0" @@ -175,14 +174,12 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) UserProvider: userProvider, }) } - tokenCache := sync.NewCache(cfg.OIDC.UserinfoCache.Size) - authenticators = append(authenticators, middleware.OIDCAuthenticator{ - Logger: logger, - TokenCache: &tokenCache, - TokenCacheTTL: time.Duration(cfg.OIDC.UserinfoCache.TTL), - HTTPClient: oidcHTTPClient, - OIDCIss: cfg.OIDC.Issuer, - ProviderFunc: func() (middleware.OIDCProvider, error) { + authenticators = append(authenticators, middleware.NewOIDCAuthenticator( + logger, + cfg.OIDC.UserinfoCache.TTL, + oidcHTTPClient, + cfg.OIDC.Issuer, + func() (middleware.OIDCProvider, error) { // Initialize a provider by specifying the issuer URL. // it will fetch the keys from the issuer using the .well-known // endpoint @@ -191,9 +188,9 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) cfg.OIDC.Issuer, ) }, - JWKSOptions: cfg.OIDC.JWKS, - AccessTokenVerifyMethod: cfg.OIDC.AccessTokenVerifyMethod, - }) + cfg.OIDC.JWKS, + cfg.OIDC.AccessTokenVerifyMethod, + )) authenticators = append(authenticators, middleware.PublicShareAuthenticator{ Logger: logger, RevaGatewayClient: revaClient, diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 887e116be2..53dfd41435 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -36,6 +36,7 @@ var ( "/data": {}, "/konnect/v1/userinfo": {}, "/status.php": {}, + "/favicon.ico": {}, } // _unprotectedPathPrefixes contains paths which don't need to be authenticated. _unprotectedPathPrefixes = [...]string{ @@ -44,6 +45,7 @@ var ( "/user-management", "/.well-known", "/js", + "/css", "/icons", "/themes", "/signin", diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index a6c1b5519d..a59a3b2457 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -30,11 +30,28 @@ type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) } +func NewOIDCAuthenticator(logger log.Logger, tokenCacheTTL int, oidcHTTPClient *http.Client, oidcIss string, providerFunc func() (OIDCProvider, error), + jwksOptions config.JWKS, accessTokenVerifyMethod string) OIDCAuthenticator { + tokenCache := osync.NewCache(tokenCacheTTL) + return OIDCAuthenticator{ + Logger: logger, + tokenCache: &tokenCache, + TokenCacheTTL: time.Duration(tokenCacheTTL), + HTTPClient: oidcHTTPClient, + OIDCIss: oidcIss, + ProviderFunc: providerFunc, + JWKSOptions: jwksOptions, + AccessTokenVerifyMethod: accessTokenVerifyMethod, + providerLock: &sync.Mutex{}, + jwksLock: &sync.Mutex{}, + } +} + type OIDCAuthenticator struct { Logger log.Logger HTTPClient *http.Client OIDCIss string - TokenCache *osync.Cache + tokenCache *osync.Cache TokenCacheTTL time.Duration ProviderFunc func() (OIDCProvider, error) AccessTokenVerifyMethod string @@ -49,7 +66,7 @@ type OIDCAuthenticator struct { func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (map[string]interface{}, error) { var claims map[string]interface{} - hit := m.TokenCache.Load(token) + hit := m.tokenCache.Load(token) if hit == nil { aClaims, err := m.verifyAccessToken(token) if err != nil { @@ -72,7 +89,7 @@ func (m OIDCAuthenticator) getClaims(token string, req *http.Request) (map[strin } expiration := m.extractExpiration(aClaims) - m.TokenCache.Store(token, claims, expiration) + m.tokenCache.Store(token, claims, expiration) m.Logger.Debug().Interface("claims", claims).Interface("userInfo", userInfo).Time("expiration", expiration.UTC()).Msg("unmarshalled and cached userinfo") return claims, nil @@ -149,7 +166,7 @@ type jwksJSON struct { JWKSURL string `json:"jwks_uri"` } -func (m *OIDCAuthenticator) getKeyfunc() *keyfunc.JWKS { +func (m OIDCAuthenticator) getKeyfunc() *keyfunc.JWKS { m.jwksLock.Lock() defer m.jwksLock.Unlock() if m.JWKS == nil { @@ -200,7 +217,7 @@ func (m *OIDCAuthenticator) getKeyfunc() *keyfunc.JWKS { return m.JWKS } -func (m *OIDCAuthenticator) getProvider() OIDCProvider { +func (m OIDCAuthenticator) getProvider() OIDCProvider { m.providerLock.Lock() defer m.providerLock.Unlock() if m.provider == nil { @@ -229,11 +246,11 @@ func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { if m.getProvider() == nil { return nil, false } + // Force init of jwks keyfunc if needed (contacts the .well-known and jwks endpoints on first call) if m.AccessTokenVerifyMethod == config.AccessTokenVerificationJWT && m.getKeyfunc() == nil { return nil, false } - token := strings.TrimPrefix(r.Header.Get(_headerAuthorization), _bearerPrefix) claims, err := m.getClaims(token, r) From d271ae2451199ba3ef7f2f252c8a13b41b824b9b Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 10 Aug 2022 16:29:41 +0200 Subject: [PATCH 017/103] fix some authentication cases --- services/proxy/pkg/middleware/authentication.go | 2 ++ services/proxy/pkg/middleware/public_share_auth.go | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 53dfd41435..f5f4d91150 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -41,6 +41,8 @@ var ( // _unprotectedPathPrefixes contains paths which don't need to be authenticated. _unprotectedPathPrefixes = [...]string{ "/files", + "/data", + "/s/", "/settings", "/user-management", "/.well-known", diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index b32f9ed147..dabaa8a38c 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -34,10 +34,10 @@ func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, shareToken = query.Get(headerShareToken) } - // Currently we only want to authenticate app open request coming from public shares. if shareToken == "" { - // Don't authenticate - return nil, false + // If the share token is not set then we don't need to inject the user to + // the request context so we can just continue with the request. + return r, true } var sharePassword string From 32f68f91ffdc14ade38373b42ef4880ee185fc5e Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 10 Aug 2022 23:59:33 +0200 Subject: [PATCH 018/103] add missing www-authentication header on failed authentication --- services/proxy/pkg/middleware/authentication.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index f5f4d91150..c90522403f 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -87,6 +87,7 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle } } if !isPublicPath(r.URL.Path) { + writeSupportedAuthenticateHeader(w, r) for _, s := range SupportedAuthStrategies { userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s) } @@ -178,6 +179,7 @@ func userAgentAuthenticateLockIn(w http.ResponseWriter, r *http.Request, locks m for _, r := range ProxyWwwAuthenticate { evalRequestURI(u, r) } + fmt.Println(w.Header()) } func evalRequestURI(l userAgentLocker, r regexp.Regexp) { From 036c4664259634243a1ffc9880523a7d64eeb161 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 11 Aug 2022 10:41:18 +0200 Subject: [PATCH 019/103] add missing unprotected paths --- services/proxy/pkg/middleware/authentication.go | 3 ++- vendor-bin/behat/composer.json | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index c90522403f..728a85a0a4 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -37,6 +37,8 @@ var ( "/konnect/v1/userinfo": {}, "/status.php": {}, "/favicon.ico": {}, + "/ocs/v1.php/config": {}, + "/ocs/v2.php/config": {}, } // _unprotectedPathPrefixes contains paths which don't need to be authenticated. _unprotectedPathPrefixes = [...]string{ @@ -179,7 +181,6 @@ func userAgentAuthenticateLockIn(w http.ResponseWriter, r *http.Request, locks m for _, r := range ProxyWwwAuthenticate { evalRequestURI(u, r) } - fmt.Println(w.Header()) } func evalRequestURI(l userAgentLocker, r regexp.Regexp) { diff --git a/vendor-bin/behat/composer.json b/vendor-bin/behat/composer.json index 00964ecb4b..999f00df86 100644 --- a/vendor-bin/behat/composer.json +++ b/vendor-bin/behat/composer.json @@ -2,7 +2,10 @@ "config" : { "platform": { "php": "7.4" - } + }, + "allow-plugins": { + "composer/package-versions-deprecated": true + } }, "require": { "behat/behat": "^3.9", From 5d45f0e856201f6cb3afbe6d8a6477b05b10f523 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 11 Aug 2022 12:28:02 +0200 Subject: [PATCH 020/103] fix logic of when to add the www-authenticate headers --- .../proxy/pkg/middleware/authentication.go | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 728a85a0a4..07d5568f7f 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -89,10 +89,31 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle } } if !isPublicPath(r.URL.Path) { - writeSupportedAuthenticateHeader(w, r) - for _, s := range SupportedAuthStrategies { - userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s) + // Failed basic authentication attempts receive the Www-Authenticate header in the response + var touch bool + for k, v := range options.CredentialsByUserAgent { + if strings.Contains(k, r.UserAgent()) { + removeSuperfluousAuthenticate(w) + w.Header().Add("Www-Authenticate", fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), r.Host)) + touch = true + break + } } + + // if the request is not bound to any user agent, write all available challenges + if !touch && + // This is a temporary hack... Before the authentication middleware rewrite all + // unauthenticated requests were still handled. The reva http services then did add + // the supported authentication headers to the response. Since we are not allowing the + // requests to continue so far we have to do it here. But we shouldn't do it for the graph service. + // That's the reason for this hard check here. + !strings.HasPrefix(r.URL.Path, "/graph") { + writeSupportedAuthenticateHeader(w, r) + } + } + + for _, s := range SupportedAuthStrategies { + userAgentAuthenticateLockIn(w, r, options.CredentialsByUserAgent, s) } w.WriteHeader(http.StatusUnauthorized) // if the request is a PROPFIND return a WebDAV error code. From 85456875519a31e3ed287f78dd9109775855b96a Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Fri, 12 Aug 2022 13:50:34 +0000 Subject: [PATCH 021/103] Automated changelog update [skip ci] --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6119912b2f..2d7a0748cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +# Changelog for [unreleased] (UNRELEASED) + +The following sections list the changes for unreleased. + +[unreleased]: https://github.com/owncloud/ocis/compare/v2.0.0...master + +## Summary + +* Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) + +## Details + +* Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) + + The new command `ocis idm resetpassword` allows to reset the administrator password when ocis + is not running. So it is possible to recover setups where the admin password was lost. + + https://github.com/owncloud/ocis/issues/4084 + https://github.com/owncloud/ocis/pull/4365 # Changelog for [2.0.0-beta.6] (2022-08-11) The following sections list the changes for 2.0.0-beta.6. From 319e2401ed3bdb6cf15f11aa01c3eef5986c5820 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Sat, 13 Aug 2022 01:02:36 +0000 Subject: [PATCH 022/103] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d7a0748cc..c24e88da1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1397,7 +1397,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -1565,28 +1565,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -1755,6 +1738,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 24edee982d7d9e32df7d642b35caa69adef19b3b Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 15 Aug 2022 00:19:45 +0000 Subject: [PATCH 023/103] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c24e88da1b..2d7a0748cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1397,7 +1397,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -1565,11 +1565,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -1738,23 +1755,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 19e3169800a930b2c49928d90e36466f1868c67a Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Mon, 15 Aug 2022 11:09:54 +0200 Subject: [PATCH 024/103] let idp init private key also if the file already exists and is empty --- .../unreleased/bugfix-idp-init-certificate-empty-file | 6 ++++++ services/idp/pkg/command/server.go | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/bugfix-idp-init-certificate-empty-file diff --git a/changelog/unreleased/bugfix-idp-init-certificate-empty-file b/changelog/unreleased/bugfix-idp-init-certificate-empty-file new file mode 100644 index 0000000000..0b0967669e --- /dev/null +++ b/changelog/unreleased/bugfix-idp-init-certificate-empty-file @@ -0,0 +1,6 @@ +Bugfix: Autocreate IDP private key also if file exists but is empty + +We've fixed the behavior for the IDP private key generation so that +a private key is also generated when the file already exists but is empty. + +https://github.com/owncloud/ocis/pull/4394 diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index 6e6be436ab..4991a385e3 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -161,12 +161,12 @@ func ensureEncryptionSecretExists(path string) error { func ensureSigningPrivateKeyExists(paths []string) error { for _, path := range paths { - _, err := os.Stat(path) - if err == nil { - // If the file exists we can just return + file, err := os.Stat(path) + if err == nil && file.Size() > 0 { + // If the file exists and is not empty we can just return return nil } - if !errors.Is(err, fs.ErrNotExist) { + if !errors.Is(err, fs.ErrNotExist) && file.Size() > 0 { return err } From 3ebfcbff1e3793bf806c4b11e6cbd9ffd4d0ebb4 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 15 Aug 2022 11:38:04 +0200 Subject: [PATCH 025/103] add missing unprotected path --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 07d5568f7f..2bdc5fe2cb 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -30,6 +30,7 @@ var ( "/login": {}, "/app/list": {}, "/config.json": {}, + "/manifest.json": {}, "/oidc-callback.html": {}, "/oidc-callback": {}, "/settings.js": {}, From 5f2a070b5ca6af67185147b94ca75ef47bd028e0 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Mon, 15 Aug 2022 10:50:12 +0000 Subject: [PATCH 026/103] Automated changelog update [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d7a0748cc..db8eac1aa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,18 @@ The following sections list the changes for unreleased. ## Summary +* Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) ## Details +* Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) + + We've fixed the behavior for the IDP private key generation so that a private key is also + generated when the file already exists but is empty. + + https://github.com/owncloud/ocis/pull/4394 + * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) The new command `ocis idm resetpassword` allows to reset the administrator password when ocis From 864438b2de2744a57a2145cce644b9b2880598d6 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 15 Aug 2022 16:04:14 +0200 Subject: [PATCH 027/103] add missing unprotected path --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 2bdc5fe2cb..2ee63fe34b 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -45,6 +45,7 @@ var ( _unprotectedPathPrefixes = [...]string{ "/files", "/data", + "/account", "/s/", "/settings", "/user-management", From f7aee3d520631d5afceebe519cd1e0835f15cdf9 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Tue, 16 Aug 2022 03:28:19 +0000 Subject: [PATCH 028/103] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db8eac1aa7..8f0647b373 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1405,7 +1405,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -1573,28 +1573,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -1763,6 +1746,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 4af040454b8eb9ab5d6da7648218b7c30675ea43 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Tue, 2 Aug 2022 16:20:28 +0545 Subject: [PATCH 029/103] cache bucket used for short-term cache and single cache purge pipeline --- .drone.star | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/.drone.star b/.drone.star index ad8af2a553..4db102d9af 100644 --- a/.drone.star +++ b/.drone.star @@ -239,20 +239,8 @@ def main(ctx): test_pipelines.append( pipelineDependsOn( - purgeBuildArtifactCache(ctx, "ocis-binary-amd64"), - testPipelines(ctx), - ), - ) - test_pipelines.append( - pipelineDependsOn( - purgeBuildArtifactCache(ctx, "testrunner"), - testPipelines(ctx), - ), - ) - test_pipelines.append( - pipelineDependsOn( - purgeBuildArtifactCache(ctx, "testing_app"), - testPipelines(ctx), + purgeBuildArtifactCache(ctx), + failEarly(ctx, True) + testPipelines(ctx), ), ) @@ -2163,7 +2151,7 @@ def checkStarlark(): }, }] -def genericCache(name, action, mounts, cache_key): +def genericCache(name, action, mounts, cache_path): rebuild = "false" restore = "false" if action == "rebuild": @@ -2189,16 +2177,18 @@ def genericCache(name, action, mounts, cache_key): "secret_key": { "from_secret": "cache_s3_secret_key", }, - "filename": "%s.tar" % (cache_key), + "filename": "%s.tar" % (name), + "path": cache_path, + "fallback_path": cache_path, }, } return step -def genericCachePurge(name, cache_key): +def genericCachePurge(flush_path): return { "kind": "pipeline", "type": "docker", - "name": "purge_%s" % (name), + "name": "purge_build_artifact_cache", "platform": { "os": "linux", "arch": "amd64", @@ -2218,8 +2208,8 @@ def genericCachePurge(name, cache_key): "from_secret": "cache_s3_endpoint", }, "flush": True, - "flush_age": "14", - "filename": "%s.tar" % (cache_key), + "flush_age": 1, + "flush_path": flush_path, }, }, ], @@ -2236,12 +2226,14 @@ def genericCachePurge(name, cache_key): } def genericBuildArtifactCache(ctx, name, action, path): - name = "%s_build_artifact_cache" % (name) - cache_key = "%s/%s/%s" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}", name) if action == "rebuild" or action == "restore": - return genericCache(name, action, [path], cache_key) + cache_path = "%s/%s/%s" % ("cache", ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}") + name = "%s_build_artifact_cache" % (name) + return genericCache(name, action, [path], cache_path) + if action == "purge": - return genericCachePurge(name, cache_key) + flush_path = "%s/%s" % ("cache", ctx.repo.slug) + return genericCachePurge(flush_path) return [] def restoreBuildArtifactCache(ctx, name, path): @@ -2250,8 +2242,8 @@ def restoreBuildArtifactCache(ctx, name, path): def rebuildBuildArtifactCache(ctx, name, path): return [genericBuildArtifactCache(ctx, name, "rebuild", path)] -def purgeBuildArtifactCache(ctx, name): - return genericBuildArtifactCache(ctx, name, "purge", []) +def purgeBuildArtifactCache(ctx): + return genericBuildArtifactCache(ctx, "", "purge", []) def pipelineSanityChecks(ctx, pipelines): """pipelineSanityChecks helps the CI developers to find errors before running it From 78d85b683da0805c5a04f1738a09de5715534ae4 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 16 Aug 2022 12:47:44 +0200 Subject: [PATCH 030/103] add missing comments --- services/proxy/pkg/middleware/authentication.go | 6 ++++-- services/proxy/pkg/middleware/basic_auth.go | 1 + services/proxy/pkg/middleware/oidc_auth.go | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 2ee63fe34b..3e851d0ada 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -65,9 +65,11 @@ const ( ) // Authenticator is the common interface implemented by all request authenticators. -// The Authenticator may augment the request with user info or anything related to the -// authentication and return the augmented request. + type Authenticator interface { + // Authenticate is used to authenticate incoming HTTP requests. + // The Authenticator may augment the request with user info or anything related to the + // authentication and return the augmented request. Authenticate(*http.Request) (*http.Request, bool) } diff --git a/services/proxy/pkg/middleware/basic_auth.go b/services/proxy/pkg/middleware/basic_auth.go index eaccd70425..eb8f79847b 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -8,6 +8,7 @@ import ( "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend" ) +// BasicAuthenticator is the authenticator responsible for HTTP Basic authentication. type BasicAuthenticator struct { Logger log.Logger UserProvider backend.UserBackend diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index a59a3b2457..36adeeb296 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -30,6 +30,7 @@ type OIDCProvider interface { UserInfo(ctx context.Context, ts oauth2.TokenSource) (*gOidc.UserInfo, error) } +// NewOIDCAuthenticator returns a ready to use authenticator which can handle OIDC authentication. func NewOIDCAuthenticator(logger log.Logger, tokenCacheTTL int, oidcHTTPClient *http.Client, oidcIss string, providerFunc func() (OIDCProvider, error), jwksOptions config.JWKS, accessTokenVerifyMethod string) OIDCAuthenticator { tokenCache := osync.NewCache(tokenCacheTTL) @@ -47,6 +48,7 @@ func NewOIDCAuthenticator(logger log.Logger, tokenCacheTTL int, oidcHTTPClient * } } +// OIDCAuthenticator is an authenticator responsible for OIDC authentication. type OIDCAuthenticator struct { Logger log.Logger HTTPClient *http.Client @@ -239,7 +241,10 @@ func (m OIDCAuthenticator) getProvider() OIDCProvider { func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { // there is no bearer token on the request, - if !m.shouldServe(r) { + if !m.shouldServe(r) || isPublicPath(r.URL.Path) { + // The authentication of public path requests is handled by another authenticator. + // Since we can't guarantee the order of execution of the authenticators, we better + // implement an early return here for paths we can't authenticate in this authenticator. return nil, false } From 2f85d4cffacfcda72fc1337ac2f665106dbb852b Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Tue, 16 Aug 2022 17:01:43 +0545 Subject: [PATCH 031/103] Removing dependency with earlyfail for purge --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index 4db102d9af..865ea74bbb 100644 --- a/.drone.star +++ b/.drone.star @@ -240,7 +240,7 @@ def main(ctx): test_pipelines.append( pipelineDependsOn( purgeBuildArtifactCache(ctx), - failEarly(ctx, True) + testPipelines(ctx), + testPipelines(ctx), ), ) From 905ead629c9143e9f74273276a8b0eb2ad1d56ff Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 16 Aug 2022 15:16:48 +0200 Subject: [PATCH 032/103] add unprotected path prefix for external apps --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 3e851d0ada..84a552463f 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -47,6 +47,7 @@ var ( "/data", "/account", "/s/", + "/external/spaces", "/settings", "/user-management", "/.well-known", From 3f25ca2059d48a58682d092408b9e47427bfd327 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 16 Aug 2022 15:45:22 +0200 Subject: [PATCH 033/103] add unprotected path prefix for parallel deployment --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 84a552463f..a218546760 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -48,6 +48,7 @@ var ( "/account", "/s/", "/external/spaces", + "/apps/openidconnect/redirect", "/settings", "/user-management", "/.well-known", From b5ef10dc2b82fc9a083fad594a00af055068b6e2 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 16 Aug 2022 16:53:27 +0200 Subject: [PATCH 034/103] add missing comments and changelog --- changelog/unreleased/rewrite-authentication.md | 7 +++++++ services/proxy/pkg/middleware/public_share_auth.go | 2 ++ services/proxy/pkg/middleware/signed_url_auth.go | 1 + 3 files changed, 10 insertions(+) create mode 100644 changelog/unreleased/rewrite-authentication.md diff --git a/changelog/unreleased/rewrite-authentication.md b/changelog/unreleased/rewrite-authentication.md new file mode 100644 index 0000000000..c399074312 --- /dev/null +++ b/changelog/unreleased/rewrite-authentication.md @@ -0,0 +1,7 @@ +Enhancement: Rewrite of the request authentication middleware + +There were some flaws in the authentication middleware which were resolved by this rewrite. +This rewrite also introduced the need to manually mark certain paths as "unprotected" if +requests to these paths must not be authenticated. + +https://github.com/owncloud/ocis/pull/4374 diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index dabaa8a38c..cab9b6ebf3 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -18,6 +18,8 @@ const ( _paramExpiration = "expiration" ) +// PublicShareAuthenticator is the authenticator which can authenticate public share requests. +// It will add the share owner into the request context. type PublicShareAuthenticator struct { Logger log.Logger RevaGatewayClient gateway.GatewayAPIClient diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index 80a613aace..2455e8eecf 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -38,6 +38,7 @@ var ( } ) +// SignedURLAuthenticator is the authenticator responsible for authenticating signed URL requests. type SignedURLAuthenticator struct { Logger log.Logger PreSignedURLConfig config.PreSignedURL From b9f5309ccf9306b387bb69a60f47e7e91aef7d46 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Wed, 17 Aug 2022 01:03:32 +0000 Subject: [PATCH 035/103] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f0647b373..db8eac1aa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1405,7 +1405,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -1573,11 +1573,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -1746,23 +1763,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From f9a25c062524dd45da2f63ef87db12368ff12fbe Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 10 Aug 2022 15:59:29 +0200 Subject: [PATCH 036/103] add open-with-web endpoint, needs cs3org/reva#3143 --- docs/services/app-registry/apps.md | 3 ++- services/frontend/pkg/revaconfig/config.go | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/services/app-registry/apps.md b/docs/services/app-registry/apps.md index 39f01d65cc..4d5f61336e 100644 --- a/docs/services/app-registry/apps.md +++ b/docs/services/app-registry/apps.md @@ -22,9 +22,10 @@ The capabilities endpoint (e.g. `https://localhost:9200/ocs/v1.php/cloud/capabil "app_providers": [ { "enabled": true, - "version": "1.0.0", + "version": "1.1.0", "apps_url": "/app/list", "open_url": "/app/open", + "open_web_url": "/app/open-in-web", "new_url": "/app/new" } ] diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index 29bcdc1c0b..723742b939 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -23,11 +23,12 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { appProviders := []map[string]interface{}{ { - "enabled": true, - "version": "1.0.0", - "apps_url": "/app/list", - "open_url": "/app/open", - "new_url": "/app/new", + "enabled": true, + "version": "1.1.0", + "apps_url": "/app/list", + "open_url": "/app/open", + "open_web_url": "/app/open-in-web", + "new_url": "/app/new", }, } @@ -88,6 +89,14 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { "transfer_shared_secret": cfg.TransferSecret, "timeout": 86400, "insecure": cfg.AppHandler.Insecure, + "webbaseuri": "https://ocis.owncloud.test/external", + "web": map[string]interface{}{ + "urlparamsmapping": map[string]string{ + // param -> value mapper + "fileId": "fileid", + "app": "appname", + }, + }, }, "archiver": map[string]interface{}{ "prefix": cfg.Archiver.Prefix, From 0a9790105d008dc74335c85d5e73a895cb998708 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 11 Aug 2022 09:25:25 +0200 Subject: [PATCH 037/103] introduce staticurlparams --- services/frontend/pkg/revaconfig/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index 723742b939..a0ee3bc800 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -96,6 +96,9 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { "fileId": "fileid", "app": "appname", }, + "staticurlparams": map[string]string{ + "contextRouteName": "files-spaces-personal", + }, }, }, "archiver": map[string]interface{}{ From 5730ad6d5b2c97b1165aaf4aa868dca947d7d8f4 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 12 Aug 2022 16:05:15 +0200 Subject: [PATCH 038/103] add documentation, wire configuration --- .../enhancement-add-open-with-web-endpoint.md | 7 +++ docs/services/app-registry/apps.md | 44 ++++++++++++++++++- services/frontend/pkg/command/server.go | 5 ++- services/frontend/pkg/revaconfig/config.go | 20 ++++++--- 4 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/enhancement-add-open-with-web-endpoint.md diff --git a/changelog/unreleased/enhancement-add-open-with-web-endpoint.md b/changelog/unreleased/enhancement-add-open-with-web-endpoint.md new file mode 100644 index 0000000000..5510410574 --- /dev/null +++ b/changelog/unreleased/enhancement-add-open-with-web-endpoint.md @@ -0,0 +1,7 @@ +Enhancement: Add /app/open-with-web endpoint + +We've added an /app/open-with-web endpoint to the app provider, so that +clients that are no browser or have only limited browser access can also open apps with the help of a Web URL. + +https://github.com/owncloud/ocis/pull/4376 +https://github.com/cs3org/reva/pull/3143 diff --git a/docs/services/app-registry/apps.md b/docs/services/app-registry/apps.md index 4d5f61336e..e9726849cb 100644 --- a/docs/services/app-registry/apps.md +++ b/docs/services/app-registry/apps.md @@ -25,7 +25,7 @@ The capabilities endpoint (e.g. `https://localhost:9200/ocs/v1.php/cloud/capabil "version": "1.1.0", "apps_url": "/app/list", "open_url": "/app/open", - "open_web_url": "/app/open-in-web", + "open_web_url": "/app/open-with-web", "new_url": "/app/new" } ] @@ -179,6 +179,48 @@ HTTP status code: 200 } ``` +### Open a file with the ownCloud Web + +**Endpoint**: specified in the capabilities in `open_web_url`, currently `/app/open-with-web` + +**Method**: HTTP POST + +**Authentication** (one of them): + +- `Authorization` header with OIDC Bearer token for authenticated users or basic auth credentials (if enabled in oCIS) +- `X-Access-Token` header with a REVA token for authenticated users + +**Query parameters**: + +- `file_id` (mandatory): id of the file to be opened +- `app_name` (optional) + - default (not given): default app for mime type + - possible values depend on the app providers for a mimetype from the `/app/open` endpoint + +**Request examples**: + +```bash +curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=' + +curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&app_name=Collabora' +``` + +**Response examples**: + +The URI from the response JSON is intended to be opened with a GET request in a browser. If the user has not yet a session in the browser, a login flow is handled by ownCloud Web. + +HTTP status code: 200 + +```json +{ + "uri": "https://....." +} +``` + +**Example responses (error case)**: + +See error cases for [Open a file with the app provider](#open-a-file-with-the-app-provider) + ### Open a file with the app provider **Endpoint**: specified in the capabilities in `open_url`, currently `/app/open` diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index 20719e36cc..91fcdf1fc3 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -48,7 +48,10 @@ func Server(cfg *config.Config) *cli.Command { pidFile := path.Join(os.TempDir(), "revad-"+cfg.Service.Name+"-"+uuid.Must(uuid.NewV4()).String()+".pid") - rcfg := revaconfig.FrontendConfigFromStruct(cfg) + rcfg, err := revaconfig.FrontendConfigFromStruct(cfg) + if err != nil { + return err + } gr.Add(func() error { runtime.RunWithOptions(rcfg, pidFile, runtime.WithLogger(&logger.Logger)) diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index a0ee3bc800..7a6c8cabfe 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -1,6 +1,7 @@ package revaconfig import ( + "net/url" "path" "strconv" @@ -9,7 +10,15 @@ import ( ) // FrontendConfigFromStruct will adapt an oCIS config struct into a reva mapstructure to start a reva service. -func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { +func FrontendConfigFromStruct(cfg *config.Config) (map[string]interface{}, error) { + + webURL, err := url.Parse(cfg.PublicURL) + if err != nil { + return map[string]interface{}{}, err + } + webURL.Path = "/external" + webOpenInAppURL := webURL.String() + archivers := []map[string]interface{}{ { "enabled": true, @@ -27,7 +36,7 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { "version": "1.1.0", "apps_url": "/app/list", "open_url": "/app/open", - "open_web_url": "/app/open-in-web", + "open_web_url": "/app/open-with-web", "new_url": "/app/new", }, } @@ -89,15 +98,16 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { "transfer_shared_secret": cfg.TransferSecret, "timeout": 86400, "insecure": cfg.AppHandler.Insecure, - "webbaseuri": "https://ocis.owncloud.test/external", + "webbaseuri": webOpenInAppURL, "web": map[string]interface{}{ "urlparamsmapping": map[string]string{ // param -> value mapper + // these mappers are static and are only subject to change when changed in oC Web "fileId": "fileid", "app": "appname", }, "staticurlparams": map[string]string{ - "contextRouteName": "files-spaces-personal", + "contextRouteName": "files-spaces-personal", // TODO: remove when https://github.com/owncloud/web/pull/7437 arrived in oCIS }, }, }, @@ -239,5 +249,5 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { }, }, }, - } + }, nil } From c3a021512ba55f0cc5092452f09eabca0ed98671 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 12:11:26 +0200 Subject: [PATCH 039/103] update reva --- changelog/unreleased/update-reva-beta.7.md | 7 +++++++ go.mod | 2 +- go.sum | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/update-reva-beta.7.md diff --git a/changelog/unreleased/update-reva-beta.7.md b/changelog/unreleased/update-reva-beta.7.md new file mode 100644 index 0000000000..b81c362c0e --- /dev/null +++ b/changelog/unreleased/update-reva-beta.7.md @@ -0,0 +1,7 @@ +Enhancement: update reva to vx.x.x + +Updated reva to version x.x.x. This update includes: + +* TODO: + +https://github.com/owncloud/ocis/pull/4376 diff --git a/go.mod b/go.mod index 2ff7116ab2..77b2731c4e 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 - github.com/cs3org/reva/v2 v2.7.4 + github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 6480caa8e2..070ecf5758 100644 --- a/go.sum +++ b/go.sum @@ -291,6 +291,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 h1:cFnankJOCWndn github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva/v2 v2.7.4 h1:hmx3qtBsLG1ijwAM4wwBcB4ozqu5jDW9UNFGukKtHRw= github.com/cs3org/reva/v2 v2.7.4/go.mod h1:AKcCJX2IWLxKGA60eaM7A43nB6urQYuE9phbJabKkm0= +github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620 h1:OZc0njRbjujMofFuhF3DYpZ+0k29jZJ0S7Ft8A/0xQM= +github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= From 067e61471325b6659019964a9bcd731a4dbd474d Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 12:25:55 +0200 Subject: [PATCH 040/103] implement review feedback --- services/frontend/pkg/revaconfig/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index 7a6c8cabfe..f53e1202d3 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -14,9 +14,9 @@ func FrontendConfigFromStruct(cfg *config.Config) (map[string]interface{}, error webURL, err := url.Parse(cfg.PublicURL) if err != nil { - return map[string]interface{}{}, err + return nil, err } - webURL.Path = "/external" + webURL.Path = path.Join(webURL.Path, "/external") webOpenInAppURL := webURL.String() archivers := []map[string]interface{}{ From c0f0b0efb48ce87d0e50e362f06d5a0d38aa1177 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 12:40:02 +0200 Subject: [PATCH 041/103] move the uploads command into a category --- services/storage-users/pkg/command/uploads.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index 0aa7174c34..de208e49b4 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -19,8 +19,9 @@ import ( func Uploads(cfg *config.Config) *cli.Command { return &cli.Command{ - Name: "uploads", - Usage: "manage uploads", + Name: "uploads", + Usage: "manage uploads", + Category: "maintenance", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { fmt.Printf("%v", err) From fe53db9440f46b7dc668dade70ef77914961b797 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 12:45:19 +0200 Subject: [PATCH 042/103] tidy go mod --- go.mod | 1 + go.sum | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 77b2731c4e..06f8e99a35 100644 --- a/go.mod +++ b/go.mod @@ -141,6 +141,7 @@ require ( github.com/dlclark/regexp2 v1.4.0 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/emirpasic/gods v1.12.0 // indirect + github.com/emvi/iso-639-1 v1.0.1 // indirect github.com/eternnoir/gncp v0.0.0-20170707042257-c70df2d0cd68 // indirect github.com/evanphx/json-patch/v5 v5.5.0 // indirect github.com/fatih/color v1.13.0 // indirect diff --git a/go.sum b/go.sum index 070ecf5758..9343284ef6 100644 --- a/go.sum +++ b/go.sum @@ -289,8 +289,6 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 h1:cFnankJOCWndnOns4sKRG7yzH61ammK2Am6rEGWCK40= github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.7.4 h1:hmx3qtBsLG1ijwAM4wwBcB4ozqu5jDW9UNFGukKtHRw= -github.com/cs3org/reva/v2 v2.7.4/go.mod h1:AKcCJX2IWLxKGA60eaM7A43nB6urQYuE9phbJabKkm0= github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620 h1:OZc0njRbjujMofFuhF3DYpZ+0k29jZJ0S7Ft8A/0xQM= github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= @@ -326,6 +324,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/emvi/iso-639-1 v1.0.1 h1:4s6P8Uxc/RDkwCpxAr4NHOT/15a1swy9IQkB8PJCWVI= +github.com/emvi/iso-639-1 v1.0.1/go.mod h1:mghC4MDFyszxzH98ujf/K5whvB6B0nV4qCa5u94dP84= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= From 82acd83c617ed2c723f354f85c66258572d1d8ee Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 12:56:12 +0200 Subject: [PATCH 043/103] remove fmt.Sprintf --- services/storage-users/pkg/command/uploads.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index de208e49b4..415ec34ef0 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -40,7 +40,7 @@ func Uploads(cfg *config.Config) *cli.Command { func ListUploads(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "list", - Usage: fmt.Sprintf("Print a list of all incomplete uploads"), + Usage: "Print a list of all incomplete uploads", Category: "services", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) From 66ff20442f8fc528d5dd9c48ca47bc735c6f4e82 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 11 Aug 2022 14:04:08 +0200 Subject: [PATCH 044/103] use .golangci.yml Signed-off-by: jkoberg --- .bingo/Variables.mk | 6 +- .bingo/golangci-lint.mod | 2 +- .bingo/golangci-lint.sum | 17 ++++ .bingo/variables.env | 2 +- .golangci.yml | 146 ++++++++++++++++++++++++++++++++ .make/go.mk | 8 +- Makefile | 12 +++ services/settings/.golangci.yml | 38 --------- services/store/.golangci.yaml | 29 ------- sonar-project.properties | 2 +- 10 files changed, 187 insertions(+), 75 deletions(-) create mode 100644 .golangci.yml delete mode 100644 services/settings/.golangci.yml delete mode 100644 services/store/.golangci.yaml diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index 54a8f3c2f3..282c1fc057 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -47,11 +47,11 @@ $(GO_LICENSES): $(BINGO_DIR)/go-licenses.mod @echo "(re)installing $(GOBIN)/go-licenses-v1.0.1-0.20220408034444-fd2d9ec868aa" @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=go-licenses.mod -o=$(GOBIN)/go-licenses-v1.0.1-0.20220408034444-fd2d9ec868aa "github.com/google/go-licenses" -GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.47.0 +GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.47.3 $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. - @echo "(re)installing $(GOBIN)/golangci-lint-v1.47.0" - @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.47.0 "github.com/golangci/golangci-lint/cmd/golangci-lint" + @echo "(re)installing $(GOBIN)/golangci-lint-v1.47.3" + @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.47.3 "github.com/golangci/golangci-lint/cmd/golangci-lint" HUGO := $(GOBIN)/hugo-v0.94.0 $(HUGO): $(BINGO_DIR)/hugo.mod diff --git a/.bingo/golangci-lint.mod b/.bingo/golangci-lint.mod index 6a438823a2..d5bb739b45 100644 --- a/.bingo/golangci-lint.mod +++ b/.bingo/golangci-lint.mod @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT go 1.17 -require github.com/golangci/golangci-lint v1.47.0 // cmd/golangci-lint +require github.com/golangci/golangci-lint v1.47.3 // cmd/golangci-lint diff --git a/.bingo/golangci-lint.sum b/.bingo/golangci-lint.sum index c5078aa9a7..785ac534fa 100644 --- a/.bingo/golangci-lint.sum +++ b/.bingo/golangci-lint.sum @@ -61,10 +61,12 @@ github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU= github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I= +github.com/BurntSushi/toml v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v2 v2.2.0 h1:V9xVvhKbLt7unNEGAruK1xXglyc668Pq3Xx0MNTNqpo= +github.com/GaijinEntertainment/go-exhaustruct/v2 v2.2.2 h1:DGdS4FlsdM6OkluXOhgkvwx05ZjD3Idm9WqtYnOmSuY= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= @@ -83,6 +85,7 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.10 h1:qqGPDTV0ff0tWHN/nnIlSdjlU/EwRPaUY4SfpE1rnms= +github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= @@ -162,6 +165,7 @@ github.com/daixiang0/gci v0.2.9 h1:iwJvwQpBZmMg31w+QQ6jsyZ54KEATn6/nfARbBNW294= github.com/daixiang0/gci v0.2.9/go.mod h1:+4dZ7TISfSmqfAGv59ePaHfNzgGtIkHAhhdKggP1JAc= github.com/daixiang0/gci v0.3.3 h1:55xJKH7Gl9Vk6oQ1cMkwrDWjAkT1D+D1G9kNmRcAIY4= github.com/daixiang0/gci v0.4.2 h1:PyT/Y4a265wDhPCZo2ip/YH33M4zEuFA3nDMdAvcKSA= +github.com/daixiang0/gci v0.5.0 h1:3+Z8nb/4dhJQYjpEbG4wt5na+KFJJTZ++PVEq/MVKX4= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -302,6 +306,8 @@ github.com/golangci/golangci-lint v1.45.2 h1:9I3PzkvscJkFAQpTQi5Ga0V4qWdJERajX1U github.com/golangci/golangci-lint v1.45.2/go.mod h1:f20dpzMmUTRp+oYnX0OGjV1Au3Jm2JeI9yLqHq1/xsI= github.com/golangci/golangci-lint v1.47.0 h1:h2s+ZGGF63fdzUtac+VYUHPsEO0ADTqHouI7Vase+FY= github.com/golangci/golangci-lint v1.47.0/go.mod h1:3TZhfF5KolbIkXYjUFvER6G9CoxzLEaafr/u/QI1S5A= +github.com/golangci/golangci-lint v1.47.3 h1:ri7A2DgtFpxgqcMSsU3qIT0IBm/SCdYgXlvmJx4szUU= +github.com/golangci/golangci-lint v1.47.3/go.mod h1:IvT5xyPX1W8JUJJrV60gcMzgQe1ttW/38yAzn6LuHOk= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= @@ -695,6 +701,7 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.2.3 h1:ww2fsjqocGCAFamzvv/b8IsRduuHHeK2MHTcTxZTQX8= github.com/ryancurrah/gomodguard v1.2.3/go.mod h1:rYbA/4Tg5c54mV1sv4sQTP5WOPBcoLtnBZ7/TEhXAbg= +github.com/ryancurrah/gomodguard v1.2.4 h1:CpMSDKan0LtNGGhPrvupAoLeObRFjND8/tU1rEOtBp4= github.com/ryanrolds/sqlclosecheck v0.3.0 h1:AZx+Bixh8zdUBxUA1NxbxVAS78vTPq4rCb8OUZI9xFw= github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= @@ -719,11 +726,14 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sivchari/containedctx v1.0.2 h1:0hLQKpgC53OVF1VT7CeoFHk9YKstur1XOgfYIc1yrHI= github.com/sivchari/nosnakecase v1.5.0 h1:ZBvAu1H3uteN0KQ0IsLpIFOwYgPEhKLyv2ahrVkub6M= +github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt95do8= github.com/sivchari/tenv v1.4.7 h1:FdTpgRlTue5eb5nXIYgS/lyVXSjugU8UUVDwhP1NLU8= github.com/sivchari/tenv v1.4.7/go.mod h1:5nF+bITvkebQVanjU6IuMbvIot/7ReNsUV7I5NbprB0= github.com/sivchari/tenv v1.6.0 h1:FyE4WysxLwYljKqWhTfOMjgKjBSnmzzg7lWOmpDiAcc= +github.com/sivchari/tenv v1.7.0 h1:d4laZMBK6jpe5PWepxlV9S+LC0yXqvYHiq8E6ceoVVE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -841,6 +851,7 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= gitlab.com/bosi/decorder v0.2.1 h1:ehqZe8hI4w7O4b1vgsDZw1YU1PE7iJXrQWFMsocbQ1w= gitlab.com/bosi/decorder v0.2.2 h1:LRfb3lP6mZWjUzpMOCLTVjcnl/SqZWBWmKNqQvMocQs= +gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= @@ -898,6 +909,7 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM= +golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d h1:+W8Qf4iJtMGKkyAygcKohjxTk4JPsL9DpzApJ22m5Ic= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1005,6 +1017,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1085,6 +1098,7 @@ golang.org/x/sys v0.0.0-20211013075003-97ac67df715c h1:taxlMj0D/1sOAuv/CbSD+MMDo golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= golang.org/x/sys v0.0.0-20220702020025-31831981b65f h1:xdsejrW/0Wf2diT5CPp3XmKUNbr7Xvw8kYilQ+6qjRY= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1206,6 +1220,7 @@ golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= golang.org/x/tools v0.1.11 h1:loJ25fNOEhSXfHrpoGj91eCUThwdNX6u24rO1xnNteY= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1395,6 +1410,7 @@ honnef.co/go/tools v0.2.1 h1:/EPr//+UMMXwMTkXvCCoaJDq8cpjMO80Ou+L4PDo2mY= honnef.co/go/tools v0.2.1/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= honnef.co/go/tools v0.2.2 h1:MNh1AVMyVX23VUHE2O27jm6lNj3vjO5DexS4A1xvnzk= honnef.co/go/tools v0.3.2 h1:ytYb4rOqyp1TSa2EPvNVwtPQJctSELKaMyLfqNP4+34= +honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA= mvdan.cc/gofumpt v0.1.1 h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA= mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48= mvdan.cc/gofumpt v0.3.0 h1:kTojdZo9AcEYbQYhGuLf/zszYthRdhDNDUi2JKTxas4= @@ -1406,6 +1422,7 @@ mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jC mvdan.cc/unparam v0.0.0-20210104141923-aac4ce9116a7 h1:HT3e4Krq+IE44tiN36RvVEb6tvqeIdtsVSsxmNPqlFU= mvdan.cc/unparam v0.0.0-20210104141923-aac4ce9116a7/go.mod h1:hBpJkZE8H/sb+VRFvw2+rBpHNsTBcvSpk61hr8mzXZE= mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5 h1:Jh3LAeMt1eGpxomyu3jVkmVZWW2MxZ1qIIV2TZ/nRio= +mvdan.cc/unparam v0.0.0-20220706161116-678bad134442 h1:seuXWbRB1qPrS3NQnHmFKLJLtskWyueeIzmLXghMGgk= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/.bingo/variables.env b/.bingo/variables.env index baa1809bbf..d36805336b 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -18,7 +18,7 @@ CALENS="${GOBIN}/calens-v0.2.0" GO_LICENSES="${GOBIN}/go-licenses-v1.0.1-0.20220408034444-fd2d9ec868aa" -GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.47.0" +GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.47.3" HUGO="${GOBIN}/hugo-v0.94.0" diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000000..ec7c6065c7 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,146 @@ +linters: + enable-all: true + disable: + - contextcheck # FIXME: causes panic in graph service + - lll # 760 issues in the codebase + - exhaustivestruct + - exhaustruct + - exhaustive # 634 issues in the codebase + - wrapcheck # 398 issues in the codebase + - wsl # 379 issues in the codebase + - varnamelen # 305 issues in the codebase + - tagliatelle # 216 issues in the codebase + - godox + - forbidigo + - gochecknoglobals + - nlreturn + - nosnakecase # each 100-200 issues in codebase + - gci + - godot + - funlen + - gomnd + - gofumpt + - ireturn + - goerr113 + - containedctx + - paralleltest + - gocritic # each 50-100 issues in codebase + - whitespace + - cyclop + - noctx + - testpackage + - maligned + - golint + - forcetypeassert + - nonamedreturns + - dupl + - errorlint + - unparam + - stylecheck + - gocognit + - nestif # each 10-50 issues in codebase + +severity: + default-severity: error + +issues: + exclude-use-default: false + +# Enabled by default linters: +# deadcode: Finds unused code [fast: false, auto-fix: false] +# errcheck: Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false] +# gosimple (megacheck): Linter for Go source code that specializes in simplifying code [fast: false, auto-fix: false] +# govet (vet, vetshadow): Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: false, auto-fix: false] +# ineffassign: Detects when assignments to existing variables are not used [fast: true, auto-fix: false] +# staticcheck (megacheck): It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint. [fast: false, auto-fix: false] +# typecheck: Like the front-end of a Go compiler, parses and type-checks Go code [fast: false, auto-fix: false] +# unused (megacheck): Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false] +# varcheck: Finds unused global variables and constants [fast: false, auto-fix: false] + +# Disabled by default linters: +# asasalint: check for pass []any as any in variadic func(...any) [fast: false, auto-fix: false] +# asciicheck: Simple linter to check that your code does not contain non-ASCII identifiers [fast: true, auto-fix: false] +# bidichk: Checks for dangerous unicode character sequences [fast: true, auto-fix: false] +# bodyclose: checks whether HTTP response body is closed successfully [fast: false, auto-fix: false] +# containedctx: containedctx is a linter that detects struct contained context.Context field [fast: true, auto-fix: false] +# contextcheck: check the function whether use a non-inherited context [fast: false, auto-fix: false] +# cyclop: checks function and package cyclomatic complexity [fast: false, auto-fix: false] +# decorder: check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false] +# depguard: Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] +# dogsled: Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false] +# dupl: Tool for code clone detection [fast: true, auto-fix: false] +# durationcheck: check for two durations multiplied together [fast: false, auto-fix: false] +# errchkjson: Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted. [fast: false, auto-fix: false] +# errname: Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. [fast: false, auto-fix: false] +# errorlint: errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false] +# execinquery: execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false] +# exhaustive: check exhaustiveness of enum switch statements [fast: false, auto-fix: false] +# exhaustivestruct [deprecated]: Checks if all struct's fields are initialized [fast: false, auto-fix: false] +# exhaustruct: Checks if all structure fields are initialized [fast: false, auto-fix: false] +# exportloopref: checks for pointers to enclosing loop variables [fast: false, auto-fix: false] +# forbidigo: Forbids identifiers [fast: true, auto-fix: false] +# forcetypeassert: finds forced type assertions [fast: true, auto-fix: false] +# funlen: Tool for detection of long functions [fast: true, auto-fix: false] +# gci: Gci controls golang package import order and makes it always deterministic. [fast: true, auto-fix: false] +# gochecknoglobals: check that no global variables exist [fast: true, auto-fix: false] +# gochecknoinits: Checks that no init functions are present in Go code [fast: true, auto-fix: false] +# gocognit: Computes and checks the cognitive complexity of functions [fast: true, auto-fix: false] +# goconst: Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false] +# gocritic: Provides diagnostics that check for bugs, performance and style issues. [fast: false, auto-fix: false] +# gocyclo: Computes and checks the cyclomatic complexity of functions [fast: true, auto-fix: false] +# godot: Check if comments end in a period [fast: true, auto-fix: true] +# godox: Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false] +# goerr113: Golang linter to check the errors handling expressions [fast: false, auto-fix: false] +# gofmt: Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true] +# gofumpt: Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true] +# goheader: Checks is file header matches to pattern [fast: true, auto-fix: false] +# goimports: In addition to fixing imports, goimports also formats your code in the same style as gofmt. [fast: true, auto-fix: true] +# golint [deprecated]: Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: false, auto-fix: false] +# gomnd: An analyzer to detect magic numbers. [fast: true, auto-fix: false] +# gomoddirectives: Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false] +# gomodguard: Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. [fast: true, auto-fix: false] +# goprintffuncname: Checks that printf-like functions are named with `f` at the end [fast: true, auto-fix: false] +# gosec (gas): Inspects source code for security problems [fast: false, auto-fix: false] +# grouper: An analyzer to analyze expression groups. [fast: true, auto-fix: false] +# ifshort: Checks that your code uses short syntax for if-statements whenever possible [fast: true, auto-fix: false] +# importas: Enforces consistent import aliases [fast: false, auto-fix: false] +# interfacer [deprecated]: Linter that suggests narrower interface types [fast: false, auto-fix: false] +# ireturn: Accept Interfaces, Return Concrete Types [fast: false, auto-fix: false] +# lll: Reports long lines [fast: true, auto-fix: false] +# maintidx: maintidx measures the maintainability index of each function. [fast: true, auto-fix: false] +# makezero: Finds slice declarations with non-zero initial length [fast: false, auto-fix: false] +# maligned [deprecated]: Tool to detect Go structs that would take less memory if their fields were sorted [fast: false, auto-fix: false] +# misspell: Finds commonly misspelled English words in comments [fast: true, auto-fix: true] +# nakedret: Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false] +# nestif: Reports deeply nested if statements [fast: true, auto-fix: false] +# nilerr: Finds the code that returns nil even if it checks that the error is not nil. [fast: false, auto-fix: false] +# nilnil: Checks that there is no simultaneous return of `nil` error and an invalid value. [fast: false, auto-fix: false] +# nlreturn: nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false] +# noctx: noctx finds sending http request without context.Context [fast: false, auto-fix: false] +# nolintlint: Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false] +# nonamedreturns: Reports all named returns [fast: false, auto-fix: false] +# nosnakecase: nosnakecase is a linter that detects snake case of variable naming and function name. [fast: true, auto-fix: false] +# nosprintfhostport: Checks for misuse of Sprintf to construct a host with port in a URL. [fast: true, auto-fix: false] +# paralleltest: paralleltest detects missing usage of t.Parallel() method in your Go test [fast: false, auto-fix: false] +# prealloc: Finds slice declarations that could potentially be pre-allocated [fast: true, auto-fix: false] +# predeclared: find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false] +# promlinter: Check Prometheus metrics naming via promlint [fast: true, auto-fix: false] +# revive: Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false] +# rowserrcheck: checks whether Err of rows is checked successfully [fast: false, auto-fix: false] +# scopelint [deprecated]: Scopelint checks for unpinned variables in go programs [fast: true, auto-fix: false] +# sqlclosecheck: Checks that sql.Rows and sql.Stmt are closed. [fast: false, auto-fix: false] +# structcheck: Finds unused struct fields [fast: false, auto-fix: false] +# stylecheck: Stylecheck is a replacement for golint [fast: false, auto-fix: false] +# tagliatelle: Checks the struct tags. [fast: true, auto-fix: false] +# tenv: tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false] +# testpackage: linter that makes you use a separate _test package [fast: true, auto-fix: false] +# thelper: thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers [fast: false, auto-fix: false] +# tparallel: tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: false, auto-fix: false] +# unconvert: Remove unnecessary type conversions [fast: false, auto-fix: false] +# unparam: Reports unused function parameters [fast: false, auto-fix: false] +# varnamelen: checks that the length of a variable's name matches its scope [fast: false, auto-fix: false] +# wastedassign: wastedassign finds wasted assignment statements. [fast: false, auto-fix: false] +# whitespace: Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true] +# wrapcheck: Checks that errors returned from external packages are wrapped [fast: false, auto-fix: false] +# wsl: Whitespace Linter - Forces you to use empty lines! [fast: true, auto-fix: false] + diff --git a/.make/go.mk b/.make/go.mk index 1dec932a09..dca874c8f8 100644 --- a/.make/go.mk +++ b/.make/go.mk @@ -64,13 +64,17 @@ go-mod-tidy: fmt: gofmt -s -w $(SOURCES) +.PHONY: golangci-lint-fix +golangci-lint-fix: $(GOLANGCI_LINT) + $(GOLANGCI_LINT) run $(LINTERS) --fix + .PHONY: golangci-lint golangci-lint: $(GOLANGCI_LINT) - $(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E revive -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME) + $(GOLANGCI_LINT) run --path-prefix services/$(NAME) .PHONY: ci-golangci-lint ci-golangci-lint: $(GOLANGCI_LINT) - $(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E revive -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME) --timeout 10m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml + $(GOLANGCI_LINT) run --path-prefix services/$(NAME) --timeout 10m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml .PHONY: test test: diff --git a/Makefile b/Makefile index 0c29bbe836..49d9ac8951 100644 --- a/Makefile +++ b/Makefile @@ -185,6 +185,18 @@ protobuf: echo -n "% protobuf $$mod: "; $(MAKE) --no-print-directory -C $$mod protobuf || exit 1; \ done +.PHONY: golangci-lint +golangci-lint: + @for mod in $(OCIS_MODULES); do \ + $(MAKE) --no-print-directory -C $$mod golangci-lint; \ + done + +.PHONY: golangci-lint-fix +golangci-lint-fix: + @for mod in $(OCIS_MODULES); do \ + $(MAKE) --no-print-directory -C $$mod golangci-lint-fix; \ + done + .PHONY: bingo-update bingo-update: $(BINGO) $(BINGO) get -l -u diff --git a/services/settings/.golangci.yml b/services/settings/.golangci.yml deleted file mode 100644 index 4bb1586f74..0000000000 --- a/services/settings/.golangci.yml +++ /dev/null @@ -1,38 +0,0 @@ -issues: - exclude-rules: - - path: pkg/proto/v0/settings.pb.go - text: "SA1019:" - linters: - - staticcheck - - path: pkg/store/filesystem/io.go - text: "SA1019:" - linters: - - staticcheck - # Exclude scopelint for tests files because of https://github.com/kyoh86/scopelint/issues/4 - - path: _test\.go - linters: - - scopelint -linters: - enable: - - bodyclose - - deadcode - - errcheck - - gosimple - - govet - - ineffassign - - staticcheck - - structcheck - - typecheck - - unused - - varcheck - - depguard - - revive - - goimports - - unconvert - - scopelint - - maligned - - misspell - # - gocritic - - prealloc - #- gosec - diff --git a/services/store/.golangci.yaml b/services/store/.golangci.yaml deleted file mode 100644 index 85a4bf3feb..0000000000 --- a/services/store/.golangci.yaml +++ /dev/null @@ -1,29 +0,0 @@ -issues: - exclude-rules: - - path: pkg/proto/v0 - text: "SA1019:" - linters: - - staticcheck -linters: - enable: - - bodyclose - - deadcode - - errcheck - - gosimple - - govet - - ineffassign - - staticcheck - - structcheck - - typecheck - - unused - - varcheck - - depguard - - revive - - goimports - - unconvert - - scopelint - - maligned - - misspell - - gocritic - - prealloc - #- gosec diff --git a/sonar-project.properties b/sonar-project.properties index e3ccc2ac9d..7eac08a867 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -33,7 +33,7 @@ sonar.go.coverage.reportPaths=cache/coverage/* # golangci-lint does not support wildcard # https://github.com/SonarSource/slang/blob/85b05160bc1b31c6072a35f8818da4376b107afa/sonar-go-plugin/src/main/java/org/sonar/go/externalreport/GolangCILintReportSensor.java#L37 # https://github.com/SonarSource/slang/blob/85b05160bc1b31c6072a35f8818da4376b107afa/sonar-go-plugin/src/main/java/org/sonar/go/externalreport/AbstractReportSensor.java#L76-L90 -sonar.go.golangci-lint.reportPaths=cache/checkstyle/accounts_checkstyle.xml,cache/checkstyle/audit_checkstyle.xml,cache/checkstyle/glauth_checkstyle.xml,cache/checkstyle/graph_checkstyle.xml,cache/checkstyle/graph-explorer_checkstyle.xml,cache/checkstyle/idm_checkstyle.xml,cache/checkstyle/idp_checkstyle.xml,cache/checkstyle/nats_checkstyle.xml,cache/checkstyle/notifications_checkstyle.xml,cache/checkstyle/ocis_checkstyle.xml,cache/checkstyle/ocis-pkg_checkstyle.xml,cache/checkstyle/ocs_checkstyle.xml,cache/checkstyle/proxy_checkstyle.xml,cache/checkstyle/settings_checkstyle.xml,cache/checkstyle/storage_checkstyle.xml,cache/checkstyle/store_checkstyle.xml,cache/checkstyle/thumbnails_checkstyle.xml,cache/checkstyle/web_checkstyle.xml,cache/checkstyle/webdav_checkstyle.xml +sonar.go.golangci-lint.reportPaths=cache/checkstyle/app-provider_checkstyle.xml,cache/checkstyle/app-registry_checkstyle.xml,cache/checkstyle/audit_checkstyle.xml,cache/checkstyle/auth-basic_checkstyle.xml,cache/checkstyle/auth-bearer_checkstyle.xml,cache/checkstyle/auth-machine_checkstyle.xml,cache/checkstyle/frontend_checkstyle.xml,cache/checkstyle/gateway_checkstyle.xml,cache/checkstyle/graph_checkstyle.xml,cache/checkstyle/graph-explorer_checkstyle.xml,cache/checkstyle/groups_checkstyle.xml,cache/checkstyle/idm_checkstyle.xml,cache/checkstyle/idp_checkstyle.xml,cache/checkstyle/nats_checkstyle.xml,cache/checkstyle/notifications_checkstyle.xml,cache/checkstyle/ocdav_checkstyle.xml,cache/checkstyle/ocs_checkstyle.xml,cache/checkstyle/proxy_checkstyle.xml,cache/checkstyle/search_checkstyle.xml,cache/checkstyle/settings_checkstyle.xml,cache/checkstyle/sharing_checkstyle.xml,cache/checkstyle/storage-publiclink_checkstyle.xml,cache/checkstyle/storage-shares_checkstyle.xml,cache/checkstyle/storage-system_checkstyle.xml,cache/checkstyle/storage-users_checkstyle.xml,cache/checkstyle/store_checkstyle.xml,cache/checkstyle/thumbnails_checkstyle.xml,cache/checkstyle/users_checkstyle.xml,cache/checkstyle/web_checkstyle.xml,cache/checkstyle/webdav_checkstyle.xml # Exclude files sonar.exclusions=**/third_party,docs/**,changelog/**,*/pkg/assets/embed.go,idp/assets/identifier/**,**/package.json,**/rollup.config.js,CHANGELOG.md,**/pkg/proto/**/*.pb.*,deployments/**,tests/**,vendor-bin/**,README.md,**/mocks/ From 152ce60d874024dabd5ff491ea430e8ac16d9bae Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 11 Aug 2022 15:19:49 +0200 Subject: [PATCH 045/103] fix audit service Signed-off-by: jkoberg --- .golangci.yml | 16 +++++++++++++++- services/audit/pkg/command/root.go | 1 + services/audit/pkg/config/config.go | 2 +- .../audit/pkg/config/defaults/defaultconfig.go | 4 ++++ services/audit/pkg/config/parser/parse.go | 1 + services/audit/pkg/logging/logging.go | 2 +- services/audit/pkg/service/service.go | 2 +- services/audit/pkg/types/conversion.go | 8 +++++--- 8 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ec7c6065c7..11a419de01 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -40,11 +40,25 @@ linters: - gocognit - nestif # each 10-50 issues in codebase +linters-settings: + gocyclo: + min-complexity: 35 # there are some func unforuntately who need this - should we refactor them? + severity: default-severity: error issues: - exclude-use-default: false + exclude-use-default: true + exclude-rules: + - path: _test.go + source: "." # exclude _test.go files from linting + include: # include comment errors. We want comments! + - EXC0002 + - EXC0011 + - EXC0012 + - EXC0013 + - EXC0014 + - EXC0015 # Enabled by default linters: # deadcode: Finds unused code [fast: false, auto-fix: false] diff --git a/services/audit/pkg/command/root.go b/services/audit/pkg/command/root.go index 025dc925d6..cfe85a7090 100644 --- a/services/audit/pkg/command/root.go +++ b/services/audit/pkg/command/root.go @@ -49,6 +49,7 @@ func NewSutureService(cfg *ociscfg.Config) suture.Service { } } +// Serve implements Server interface func (s SutureService) Serve(ctx context.Context) error { s.cfg.Context = ctx if err := Execute(s.cfg); err != nil { diff --git a/services/audit/pkg/config/config.go b/services/audit/pkg/config/config.go index d0ccca9e91..48cadb0db6 100644 --- a/services/audit/pkg/config/config.go +++ b/services/audit/pkg/config/config.go @@ -23,7 +23,7 @@ type Config struct { // Events combines the configuration options for the event bus. type Events struct { - Endpoint string `yaml:"endpoint" env:"AUDIT_EVENTS_ENDPOINT" desc:"The address of the event system. The event system is the message queuing service. It is used as message broker for the microservice architecture.` + Endpoint string `yaml:"endpoint" env:"AUDIT_EVENTS_ENDPOINT" desc:"The address of the event system. The event system is the message queuing service. It is used as message broker for the microservice architecture."` Cluster string `yaml:"cluster" env:"AUDIT_EVENTS_CLUSTER" desc:"The clusterID of the event system. The event system is the message queuing service. It is used as message broker for the microservice architecture. Mandatory when using NATS as event system."` ConsumerGroup string `yaml:"group" env:"AUDIT_EVENTS_GROUP" desc:"The consumergroup of the service. One group will only get one copy of an event."` } diff --git a/services/audit/pkg/config/defaults/defaultconfig.go b/services/audit/pkg/config/defaults/defaultconfig.go index 34af1c788d..5a4286cbc5 100644 --- a/services/audit/pkg/config/defaults/defaultconfig.go +++ b/services/audit/pkg/config/defaults/defaultconfig.go @@ -4,6 +4,7 @@ import ( "github.com/owncloud/ocis/v2/services/audit/pkg/config" ) +// FullDefaultConfig returns a fully initialized default configuration func FullDefaultConfig() *config.Config { cfg := DefaultConfig() EnsureDefaults(cfg) @@ -11,6 +12,7 @@ func FullDefaultConfig() *config.Config { return cfg } +// DefaultConfig returns a basic default configuration func DefaultConfig() *config.Config { return &config.Config{ Debug: config.Debug{ @@ -31,6 +33,7 @@ func DefaultConfig() *config.Config { } } +// EnsureDefaults adds default values to the configuration if they are not set yet func EnsureDefaults(cfg *config.Config) { // provide with defaults for shared logging, since we need a valid destination address for "envdecode". if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil { @@ -45,6 +48,7 @@ func EnsureDefaults(cfg *config.Config) { } } +// Sanitize sanitized the configuration func Sanitize(cfg *config.Config) { // sanitize config } diff --git a/services/audit/pkg/config/parser/parse.go b/services/audit/pkg/config/parser/parse.go index 43adabd426..f4e5f3d683 100644 --- a/services/audit/pkg/config/parser/parse.go +++ b/services/audit/pkg/config/parser/parse.go @@ -32,6 +32,7 @@ func ParseConfig(cfg *config.Config) error { return Validate(cfg) } +// Validate validates the configuration func Validate(cfg *config.Config) error { return nil } diff --git a/services/audit/pkg/logging/logging.go b/services/audit/pkg/logging/logging.go index 4acd0282b9..01f0569fa4 100644 --- a/services/audit/pkg/logging/logging.go +++ b/services/audit/pkg/logging/logging.go @@ -5,7 +5,7 @@ import ( "github.com/owncloud/ocis/v2/services/audit/pkg/config" ) -// LoggerFromConfig initializes a service-specific logger instance. +// Configure initializes a service-specific logger instance. func Configure(name string, cfg *config.Log) log.Logger { return log.NewLogger( log.Name(name), diff --git a/services/audit/pkg/service/service.go b/services/audit/pkg/service/service.go index 961c419634..621eaf8ec8 100644 --- a/services/audit/pkg/service/service.go +++ b/services/audit/pkg/service/service.go @@ -34,7 +34,7 @@ func AuditLoggerFromConfig(ctx context.Context, cfg config.Auditlog, ch <-chan i } -// StartAuditLogger will block. run in seperate go routine +// StartAuditLogger will block. run in separate go routine func StartAuditLogger(ctx context.Context, ch <-chan interface{}, log log.Logger, marshaller Marshaller, logto ...Log) { for { select { diff --git a/services/audit/pkg/types/conversion.go b/services/audit/pkg/types/conversion.go index 14cea5a015..c98b2caf49 100644 --- a/services/audit/pkg/types/conversion.go +++ b/services/audit/pkg/types/conversion.go @@ -13,6 +13,8 @@ import ( types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" ) +const _linktype = "link" + // BasicAuditEvent creates an AuditEvent from given values func BasicAuditEvent(uid string, ctime string, msg string, action string) AuditEvent { return AuditEvent{ @@ -68,7 +70,7 @@ func ShareCreated(ev events.ShareCreated) AuditEventShareCreated { // LinkCreated converts a ShareCreated Event to an AuditEventShareCreated func LinkCreated(ev events.LinkCreated) AuditEventShareCreated { uid := ev.Sharer.OpaqueId - with, typ := "", "link" + with, typ := "", _linktype base := BasicAuditEvent(uid, formatTime(ev.CTime), MessageLinkCreated(uid, ev.ItemID.OpaqueId, ev.ShareID.OpaqueId), ActionShareCreated) return AuditEventShareCreated{ AuditEventSharing: SharingAuditEvent("", ev.ItemID.OpaqueId, uid, base), @@ -108,7 +110,7 @@ func ShareUpdated(ev events.ShareUpdated) AuditEventShareUpdated { // LinkUpdated converts a LinkUpdated event to an AuditEventShareUpdated func LinkUpdated(ev events.LinkUpdated) AuditEventShareUpdated { uid := ev.Sharer.OpaqueId - with, typ := "", "link" + with, typ := "", _linktype base := BasicAuditEvent(uid, formatTime(ev.CTime), MessageLinkUpdated(uid, ev.ShareID.OpaqueId, ev.FieldUpdated), updateType(ev.FieldUpdated)) return AuditEventShareUpdated{ AuditEventSharing: SharingAuditEvent(ev.ShareID.GetOpaqueId(), ev.ItemID.OpaqueId, uid, base), @@ -150,7 +152,7 @@ func ShareRemoved(ev events.ShareRemoved) AuditEventShareRemoved { // LinkRemoved converts a LinkRemoved event to an AuditEventShareRemoved func LinkRemoved(ev events.LinkRemoved) AuditEventShareRemoved { - uid, sid, typ := ev.Executant.GetOpaqueId(), "", "link" + uid, sid, typ := ev.Executant.GetOpaqueId(), "", _linktype if ev.ShareID != nil { sid = ev.ShareID.GetOpaqueId() } else { From ea1484250ff0b264084ee8a1732b2501725c4798 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Wed, 17 Aug 2022 14:29:42 +0200 Subject: [PATCH 046/103] improve usage text Co-authored-by: Martin --- services/storage-users/pkg/command/uploads.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index 415ec34ef0..08fa6ce059 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -40,7 +40,7 @@ func Uploads(cfg *config.Config) *cli.Command { func ListUploads(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "list", - Usage: "Print a list of all incomplete uploads", + Usage: "Print a list of all expired or aborted uploads", Category: "services", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) From 7d76650e5fad66bd3c1249d35f1e5807cc6f00bf Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 14:58:31 +0200 Subject: [PATCH 047/103] further improve descriptions --- services/storage-users/pkg/command/uploads.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index 08fa6ce059..8327cc0b5f 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -20,7 +20,7 @@ import ( func Uploads(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "uploads", - Usage: "manage uploads", + Usage: "manage unfinished uploads", Category: "maintenance", Before: func(c *cli.Context) error { if err := parser.ParseConfig(cfg); err != nil { @@ -40,7 +40,7 @@ func Uploads(cfg *config.Config) *cli.Command { func ListUploads(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "list", - Usage: "Print a list of all expired or aborted uploads", + Usage: "Print a list of all incomplete uploads", Category: "services", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -87,7 +87,7 @@ func ListUploads(cfg *config.Config) *cli.Command { func PurgeExpiredUploads(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "purge", - Usage: fmt.Sprintf("Let %s extension clean up leftovers from expired downloads", cfg.Service.Name), + Usage: "Clean up leftovers from expired uploads", Category: "services", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) From 12204e4d914d30db64d02e304d111e55711750bf Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 15:05:26 +0200 Subject: [PATCH 048/103] remove category from uploads section --- services/storage-users/pkg/command/uploads.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index 8327cc0b5f..3a796c4a3f 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -39,9 +39,8 @@ func Uploads(cfg *config.Config) *cli.Command { // ListUploads prints a list of all incomplete uploads func ListUploads(cfg *config.Config) *cli.Command { return &cli.Command{ - Name: "list", - Usage: "Print a list of all incomplete uploads", - Category: "services", + Name: "list", + Usage: "Print a list of all incomplete uploads", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) if err != nil { @@ -86,9 +85,8 @@ func ListUploads(cfg *config.Config) *cli.Command { // PurgeExpiredUploads is the entry point for the server command. func PurgeExpiredUploads(cfg *config.Config) *cli.Command { return &cli.Command{ - Name: "purge", - Usage: "Clean up leftovers from expired uploads", - Category: "services", + Name: "clean", + Usage: "Clean up leftovers from expired uploads", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) if err != nil { From 6154466bbc9350782be748e5494332232f26ffa6 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 15:36:52 +0200 Subject: [PATCH 049/103] rename extensions to services (leftover occurences) --- ocis-pkg/config/config.go | 8 +- ocis-pkg/config/helpers.go | 6 +- ocis-pkg/config/parser/parse.go | 4 +- ocis-pkg/flags/overrides.go | 10 +-- ocis-pkg/shared/shared_types.go | 2 +- ocis/pkg/command/helper/common.go | 2 +- ocis/pkg/command/version.go | 2 +- ocis/pkg/init/init.go | 90 +++++++++---------- ocis/pkg/runtime/cmd/list.go | 2 +- ocis/pkg/runtime/service/service.go | 12 +-- services/app-provider/pkg/command/server.go | 4 +- services/app-provider/pkg/command/version.go | 2 +- services/app-registry/pkg/command/server.go | 4 +- services/app-registry/pkg/command/version.go | 2 +- services/audit/pkg/command/server.go | 2 +- services/audit/pkg/command/version.go | 2 +- services/auth-basic/pkg/command/server.go | 4 +- services/auth-basic/pkg/command/version.go | 2 +- services/auth-bearer/pkg/command/server.go | 4 +- services/auth-bearer/pkg/command/version.go | 2 +- services/auth-machine/pkg/command/server.go | 4 +- services/auth-machine/pkg/command/version.go | 2 +- services/frontend/pkg/command/server.go | 4 +- services/frontend/pkg/command/version.go | 2 +- services/gateway/pkg/command/server.go | 4 +- services/gateway/pkg/command/version.go | 2 +- services/graph-explorer/pkg/command/server.go | 2 +- .../graph-explorer/pkg/command/version.go | 2 +- .../graph-explorer/pkg/service/v0/service.go | 2 +- services/graph/pkg/command/server.go | 2 +- services/graph/pkg/command/version.go | 2 +- services/graph/pkg/service/v0/service.go | 2 +- services/groups/pkg/command/server.go | 4 +- services/groups/pkg/command/version.go | 2 +- services/idm/pkg/command/server.go | 2 +- services/idm/pkg/command/version.go | 2 +- services/idp/pkg/command/server.go | 2 +- services/idp/pkg/command/version.go | 2 +- services/idp/pkg/service/v0/service.go | 2 +- services/nats/pkg/command/server.go | 2 +- services/nats/pkg/command/version.go | 2 +- services/notifications/pkg/command/server.go | 2 +- services/notifications/pkg/command/version.go | 2 +- services/ocdav/pkg/command/server.go | 4 +- services/ocdav/pkg/command/version.go | 2 +- services/ocs/pkg/command/server.go | 2 +- services/ocs/pkg/command/version.go | 2 +- services/ocs/pkg/service/v0/service.go | 2 +- services/proxy/pkg/command/server.go | 2 +- services/proxy/pkg/command/version.go | 2 +- services/search/pkg/command/server.go | 2 +- services/search/pkg/command/version.go | 2 +- services/settings/pkg/command/server.go | 2 +- services/settings/pkg/command/version.go | 2 +- services/sharing/pkg/command/server.go | 4 +- services/sharing/pkg/command/version.go | 2 +- services/sharing/pkg/config/config.go | 2 +- .../storage-publiclink/pkg/command/server.go | 4 +- .../storage-publiclink/pkg/command/version.go | 2 +- services/storage-shares/pkg/command/server.go | 4 +- .../storage-shares/pkg/command/version.go | 2 +- services/storage-system/pkg/command/server.go | 4 +- .../storage-system/pkg/command/version.go | 2 +- services/storage-users/pkg/command/server.go | 4 +- services/storage-users/pkg/command/version.go | 2 +- services/store/pkg/command/server.go | 2 +- services/store/pkg/command/version.go | 2 +- services/thumbnails/pkg/command/server.go | 2 +- services/thumbnails/pkg/command/version.go | 2 +- .../thumbnails/pkg/service/http/v0/service.go | 2 +- services/users/pkg/command/server.go | 4 +- services/users/pkg/command/version.go | 2 +- services/web/pkg/command/server.go | 2 +- services/web/pkg/command/version.go | 2 +- services/web/pkg/service/v0/service.go | 2 +- services/webdav/pkg/command/server.go | 2 +- services/webdav/pkg/command/version.go | 2 +- 77 files changed, 151 insertions(+), 151 deletions(-) diff --git a/ocis-pkg/config/config.go b/ocis-pkg/config/config.go index 342652caba..2fd90f9506 100644 --- a/ocis-pkg/config/config.go +++ b/ocis-pkg/config/config.go @@ -47,10 +47,10 @@ type Mode int // Runtime configures the oCIS runtime when running in supervised mode. type Runtime struct { - Port string `yaml:"port" env:"OCIS_RUNTIME_PORT"` - Host string `yaml:"host" env:"OCIS_RUNTIME_HOST"` - Extensions string `yaml:"services" env:"OCIS_RUN_EXTENSIONS;OCIS_RUN_SERVICES" desc:"Expects a comma separated list of service names. Will start only the listed services."` - Disabled string `yaml:"disabled_services" env:"OCIS_EXCLUDE_RUN_SERVICES" desc:"Expects a comma separated list of service names. Will start all services except of the ones listed. Has no effect when OCIS_RUN_SERVICES is set."` + Port string `yaml:"port" env:"OCIS_RUNTIME_PORT"` + Host string `yaml:"host" env:"OCIS_RUNTIME_HOST"` + Services string `yaml:"services" env:"OCIS_RUN_EXTENSIONS;OCIS_RUN_SERVICES" desc:"Expects a comma separated list of service names. Will start only the listed services."` + Disabled string `yaml:"disabled_services" env:"OCIS_EXCLUDE_RUN_SERVICES" desc:"Expects a comma separated list of service names. Will start all services except of the ones listed. Has no effect when OCIS_RUN_SERVICES is set."` } // Config combines all available configuration parts. diff --git a/ocis-pkg/config/helpers.go b/ocis-pkg/config/helpers.go index df4ec4437f..7b72333e92 100644 --- a/ocis-pkg/config/helpers.go +++ b/ocis-pkg/config/helpers.go @@ -17,14 +17,14 @@ var ( // BindSourcesToStructs assigns any config value from a config file / env variable to struct `dst`. Its only purpose // is to solely modify `dst`, not dealing with the config structs; and do so in a thread safe manner. -func BindSourcesToStructs(extension string, dst interface{}) (*gofig.Config, error) { - cnf := gofig.NewWithOptions(extension) +func BindSourcesToStructs(service string, dst interface{}) (*gofig.Config, error) { + cnf := gofig.NewWithOptions(service) cnf.WithOptions(func(options *gofig.Options) { options.DecoderConfig.TagName = decoderConfigTagName }) cnf.AddDriver(gooyaml.Driver) - cfgFile := path.Join(defaults.BaseConfigPath(), extension+".yaml") + cfgFile := path.Join(defaults.BaseConfigPath(), service+".yaml") _ = cnf.LoadFiles([]string{cfgFile}...) err := cnf.BindStruct("", &dst) diff --git a/ocis-pkg/config/parser/parse.go b/ocis-pkg/config/parser/parse.go index 0354b222b0..81e1ede7b2 100644 --- a/ocis-pkg/config/parser/parse.go +++ b/ocis-pkg/config/parser/parse.go @@ -10,7 +10,7 @@ import ( // ParseConfig loads the ocis configuration and // copies applicable parts into the commons part, from -// where the extensions can copy it into their own config +// where the services can copy it into their own config func ParseConfig(cfg *config.Config, skipValidate bool) error { _, err := config.BindSourcesToStructs("ocis", cfg) if err != nil { @@ -37,7 +37,7 @@ func ParseConfig(cfg *config.Config, skipValidate bool) error { } // EnsureDefaults, ensures that all pointers in the -// oCIS config (not the extensions configs) are initialized +// oCIS config (not the services configs) are initialized func EnsureDefaults(cfg *config.Config) { if cfg.Tracing == nil { cfg.Tracing = &shared.Tracing{} diff --git a/ocis-pkg/flags/overrides.go b/ocis-pkg/flags/overrides.go index f641cf00be..d65e815d07 100644 --- a/ocis-pkg/flags/overrides.go +++ b/ocis-pkg/flags/overrides.go @@ -2,7 +2,7 @@ package flags // OverrideDefaultString checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultString(v, def string) string { if v != "" { return v @@ -13,7 +13,7 @@ func OverrideDefaultString(v, def string) string { // OverrideDefaultBool checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultBool(v, def bool) bool { if v { return v @@ -24,7 +24,7 @@ func OverrideDefaultBool(v, def bool) bool { // OverrideDefaultInt checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultInt(v, def int) int { if v != 0 { return v @@ -35,7 +35,7 @@ func OverrideDefaultInt(v, def int) int { // OverrideDefaultInt64 checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultInt64(v, def int64) int64 { if v != 0 { return v @@ -46,7 +46,7 @@ func OverrideDefaultInt64(v, def int64) int64 { // OverrideDefaultUint64 checks whether the default value of v is the zero value, if so, ensure the flag has a correct // value by providing one. A value different than zero would mean that it was read from a config file either from an -// extension or from a higher source (i.e: ocis command). +// service or from a higher source (i.e: ocis command). func OverrideDefaultUint64(v, def uint64) uint64 { if v != 0 { return v diff --git a/ocis-pkg/shared/shared_types.go b/ocis-pkg/shared/shared_types.go index 942ab0a20d..d633f79bfe 100644 --- a/ocis-pkg/shared/shared_types.go +++ b/ocis-pkg/shared/shared_types.go @@ -34,7 +34,7 @@ type Reva struct { Address string `yaml:"address" env:"REVA_GATEWAY" desc:"The CS3 gateway endpoint."` } -// Commons holds configuration that are common to all extensions. Each extension can then decide whether +// Commons holds configuration that are common to all services. Each service can then decide whether // to overwrite its values. type Commons struct { Log *Log `yaml:"log"` diff --git a/ocis/pkg/command/helper/common.go b/ocis/pkg/command/helper/common.go index af71e93b09..1c2fdd990b 100644 --- a/ocis/pkg/command/helper/common.go +++ b/ocis/pkg/command/helper/common.go @@ -5,5 +5,5 @@ import ( ) func SubcommandDescription(serviceName string) string { - return fmt.Sprintf("%s extension commands", serviceName) + return fmt.Sprintf("%s service commands", serviceName) } diff --git a/ocis/pkg/command/version.go b/ocis/pkg/command/version.go index 882e6925eb..3e251f953e 100644 --- a/ocis/pkg/command/version.go +++ b/ocis/pkg/command/version.go @@ -17,7 +17,7 @@ import ( func VersionCommand(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and all running extension instances", + Usage: "print the version of this binary and all running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/ocis/pkg/init/init.go b/ocis/pkg/init/init.go index 733092c5c2..a700bcdee6 100644 --- a/ocis/pkg/init/init.go +++ b/ocis/pkg/init/init.go @@ -23,24 +23,24 @@ type TokenManager struct { JWTSecret string `yaml:"jwt_secret"` } -type InsecureExtension struct { +type InsecureService struct { Insecure bool } -type InsecureProxyExtension struct { +type InsecureProxyService struct { InsecureBackends bool `yaml:"insecure_backends"` } type LdapSettings struct { BindPassword string `yaml:"bind_password"` } -type LdapBasedExtension struct { +type LdapBasedService struct { Ldap LdapSettings } -type GraphExtension struct { - Spaces InsecureExtension - Identity LdapBasedExtension +type GraphService struct { + Spaces InsecureService + Identity LdapBasedService } type ServiceUserPasswordsSettings struct { @@ -49,27 +49,27 @@ type ServiceUserPasswordsSettings struct { RevaPassword string `yaml:"reva_password"` IdpPassword string `yaml:"idp_password"` } -type IdmExtension struct { +type IdmService struct { ServiceUserPasswords ServiceUserPasswordsSettings `yaml:"service_user_passwords"` } -type FrontendExtension struct { - Archiver InsecureExtension +type FrontendService struct { + Archiver InsecureService } -type AuthbasicExtension struct { - AuthProviders LdapBasedExtension `yaml:"auth_providers"` +type AuthbasicService struct { + AuthProviders LdapBasedService `yaml:"auth_providers"` } type AuthProviderSettings struct { - Oidc InsecureExtension + Oidc InsecureService } -type AuthbearerExtension struct { +type AuthbearerService struct { AuthProviders AuthProviderSettings `yaml:"auth_providers"` } -type UsersAndGroupsExtension struct { - Drivers LdapBasedExtension +type UsersAndGroupsService struct { + Drivers LdapBasedService } type ThumbnailSettings struct { @@ -78,7 +78,7 @@ type ThumbnailSettings struct { Cs3AllowInsecure bool `yaml:"cs3_allow_insecure"` } -type ThumbnailExtension struct { +type ThumbnailService struct { Thumbnail ThumbnailSettings } @@ -101,17 +101,17 @@ type OcisConfig struct { TransferSecret string `yaml:"transfer_secret"` SystemUserID string `yaml:"system_user_id"` AdminUserID string `yaml:"admin_user_id"` - Graph GraphExtension - Idp LdapBasedExtension - Idm IdmExtension - Proxy InsecureProxyExtension - Frontend FrontendExtension - AuthBasic AuthbasicExtension `yaml:"auth_basic"` - AuthBearer AuthbearerExtension `yaml:"auth_bearer"` - Users UsersAndGroupsExtension - Groups UsersAndGroupsExtension - Ocdav InsecureExtension - Thumbnails ThumbnailExtension + Graph GraphService + Idp LdapBasedService + Idm IdmService + Proxy InsecureProxyService + Frontend FrontendService + AuthBasic AuthbasicService `yaml:"auth_basic"` + AuthBearer AuthbearerService `yaml:"auth_bearer"` + Users UsersAndGroupsService + Groups UsersAndGroupsService + Ocdav InsecureService + Thumbnails ThumbnailService } func checkConfigPath(configPath string) error { @@ -213,7 +213,7 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin TransferSecret: revaTransferSecret, SystemUserID: systemUserID, AdminUserID: adminUserID, - Idm: IdmExtension{ + Idm: IdmService{ ServiceUserPasswords: ServiceUserPasswordsSettings{ AdminPassword: ocisAdminServicePassword, IdpPassword: idpServicePassword, @@ -221,40 +221,40 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin IdmPassword: idmServicePassword, }, }, - Idp: LdapBasedExtension{ + Idp: LdapBasedService{ Ldap: LdapSettings{ BindPassword: idpServicePassword, }, }, - AuthBasic: AuthbasicExtension{ - AuthProviders: LdapBasedExtension{ + AuthBasic: AuthbasicService{ + AuthProviders: LdapBasedService{ Ldap: LdapSettings{ BindPassword: revaServicePassword, }, }, }, - Groups: UsersAndGroupsExtension{ - Drivers: LdapBasedExtension{ + Groups: UsersAndGroupsService{ + Drivers: LdapBasedService{ Ldap: LdapSettings{ BindPassword: revaServicePassword, }, }, }, - Users: UsersAndGroupsExtension{ - Drivers: LdapBasedExtension{ + Users: UsersAndGroupsService{ + Drivers: LdapBasedService{ Ldap: LdapSettings{ BindPassword: revaServicePassword, }, }, }, - Graph: GraphExtension{ - Identity: LdapBasedExtension{ + Graph: GraphService{ + Identity: LdapBasedService{ Ldap: LdapSettings{ BindPassword: idmServicePassword, }, }, }, - Thumbnails: ThumbnailExtension{ + Thumbnails: ThumbnailService{ Thumbnail: ThumbnailSettings{ TransferSecret: thumbnailsTransferSecret, }, @@ -262,25 +262,25 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin } if insecure { - cfg.AuthBearer = AuthbearerExtension{ + cfg.AuthBearer = AuthbearerService{ AuthProviders: AuthProviderSettings{ - Oidc: InsecureExtension{ + Oidc: InsecureService{ Insecure: true, }, }, } - cfg.Frontend = FrontendExtension{ - Archiver: InsecureExtension{ + cfg.Frontend = FrontendService{ + Archiver: InsecureService{ Insecure: true, }, } - cfg.Graph.Spaces = InsecureExtension{ + cfg.Graph.Spaces = InsecureService{ Insecure: true, } - cfg.Ocdav = InsecureExtension{ + cfg.Ocdav = InsecureService{ Insecure: true, } - cfg.Proxy = InsecureProxyExtension{ + cfg.Proxy = InsecureProxyService{ InsecureBackends: true, } diff --git a/ocis/pkg/runtime/cmd/list.go b/ocis/pkg/runtime/cmd/list.go index b4d54dd299..7f59da14d3 100644 --- a/ocis/pkg/runtime/cmd/list.go +++ b/ocis/pkg/runtime/cmd/list.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -// List running extensions. +// List running service. func List(cfg *config.Config) *cobra.Command { return &cobra.Command{ Use: "list", diff --git a/ocis/pkg/runtime/service/service.go b/ocis/pkg/runtime/service/service.go index ed9fa60e00..7083ba7838 100644 --- a/ocis/pkg/runtime/service/service.go +++ b/ocis/pkg/runtime/service/service.go @@ -53,7 +53,7 @@ import ( ) var ( - // runset keeps track of which extensions to start supervised. + // runset keeps track of which services to start supervised. runset map[string]struct{} ) @@ -138,7 +138,7 @@ func NewService(options ...Option) (*Service, error) { return s, nil } -// Start an rpc service. By default the package scope Start will run all default extensions to provide with a working +// Start an rpc service. By default the package scope Start will run all default services to provide with a working // oCIS instance. func Start(o ...Option) error { // Start the runtime. Most likely this was called ONLY by the `ocis server` subcommand, but since we cannot protect @@ -237,12 +237,12 @@ func scheduleServiceTokens(s *Service, funcSet serviceFuncMap) { } } -// generateRunSet interprets the cfg.Runtime.Extensions config option to cherry-pick which services to start using +// generateRunSet interprets the cfg.Runtime.Services config option to cherry-pick which services to start using // the runtime. func (s *Service) generateRunSet(cfg *ociscfg.Config) { runset = make(map[string]struct{}) - if cfg.Runtime.Extensions != "" { - e := strings.Split(strings.ReplaceAll(cfg.Runtime.Extensions, " ", ""), ",") + if cfg.Runtime.Services != "" { + e := strings.Split(strings.ReplaceAll(cfg.Runtime.Services, " ", ""), ",") for _, name := range e { runset[name] = struct{}{} } @@ -269,7 +269,7 @@ func (s *Service) generateRunSet(cfg *ociscfg.Config) { func (s *Service) List(args struct{}, reply *string) error { tableString := &strings.Builder{} table := tablewriter.NewWriter(tableString) - table.SetHeader([]string{"Extension"}) + table.SetHeader([]string{"Service"}) names := []string{} for t := range s.serviceToken { diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index 72fe31104e..a1290ac29b 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/app-provider/pkg/command/version.go b/services/app-provider/pkg/command/version.go index c191fbcfff..ee143919f5 100644 --- a/services/app-provider/pkg/command/version.go +++ b/services/app-provider/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/app-registry/pkg/command/server.go b/services/app-registry/pkg/command/server.go index f09619d595..5e22ec453e 100644 --- a/services/app-registry/pkg/command/server.go +++ b/services/app-registry/pkg/command/server.go @@ -24,7 +24,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -92,7 +92,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/app-registry/pkg/command/version.go b/services/app-registry/pkg/command/version.go index 380a308626..c4e1adc1f0 100644 --- a/services/app-registry/pkg/command/version.go +++ b/services/app-registry/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/audit/pkg/command/server.go b/services/audit/pkg/command/server.go index fd904a0095..60e2a997d9 100644 --- a/services/audit/pkg/command/server.go +++ b/services/audit/pkg/command/server.go @@ -20,7 +20,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/audit/pkg/command/version.go b/services/audit/pkg/command/version.go index c3d0eb0b5a..8b08928c3f 100644 --- a/services/audit/pkg/command/version.go +++ b/services/audit/pkg/command/version.go @@ -9,7 +9,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { // not implemented diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index 4e6a3b5742..7041d330ba 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -110,7 +110,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/auth-basic/pkg/command/version.go b/services/auth-basic/pkg/command/version.go index 9e2291bf41..f2bbc5eb3e 100644 --- a/services/auth-basic/pkg/command/version.go +++ b/services/auth-basic/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index cfa598e5c0..2e26e0482e 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/auth-bearer/pkg/command/version.go b/services/auth-bearer/pkg/command/version.go index 030171e169..1f1af58f68 100644 --- a/services/auth-bearer/pkg/command/version.go +++ b/services/auth-bearer/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running services instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index 7424c30200..a2e0418deb 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/auth-machine/pkg/command/version.go b/services/auth-machine/pkg/command/version.go index 1db2354e44..6912c33824 100644 --- a/services/auth-machine/pkg/command/version.go +++ b/services/auth-machine/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index 20719e36cc..dbfa2eb43b 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/frontend/pkg/command/version.go b/services/frontend/pkg/command/version.go index 77ec32121a..348b33d6ab 100644 --- a/services/frontend/pkg/command/version.go +++ b/services/frontend/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/gateway/pkg/command/server.go b/services/gateway/pkg/command/server.go index adb9d6cf5c..6bf6eac0e2 100644 --- a/services/gateway/pkg/command/server.go +++ b/services/gateway/pkg/command/server.go @@ -24,7 +24,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -92,7 +92,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/gateway/pkg/command/version.go b/services/gateway/pkg/command/version.go index 6e4fcfc078..52768b243e 100644 --- a/services/gateway/pkg/command/version.go +++ b/services/gateway/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/graph-explorer/pkg/command/server.go b/services/graph-explorer/pkg/command/server.go index 60586a267c..a427e4d33b 100644 --- a/services/graph-explorer/pkg/command/server.go +++ b/services/graph-explorer/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(ctx *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/graph-explorer/pkg/command/version.go b/services/graph-explorer/pkg/command/version.go index 49b923e9a5..3152b2b4b7 100644 --- a/services/graph-explorer/pkg/command/version.go +++ b/services/graph-explorer/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/graph-explorer/pkg/service/v0/service.go b/services/graph-explorer/pkg/service/v0/service.go index 055f82388a..f95b5b806a 100644 --- a/services/graph-explorer/pkg/service/v0/service.go +++ b/services/graph-explorer/pkg/service/v0/service.go @@ -12,7 +12,7 @@ import ( "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) ConfigJs(http.ResponseWriter, *http.Request) diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index bdcccc2f38..3fead9ea79 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/graph/pkg/command/version.go b/services/graph/pkg/command/version.go index ebf93b1436..fd95546f0f 100644 --- a/services/graph/pkg/command/version.go +++ b/services/graph/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/graph/pkg/service/v0/service.go b/services/graph/pkg/service/v0/service.go index 4f6799339a..a60e61583a 100644 --- a/services/graph/pkg/service/v0/service.go +++ b/services/graph/pkg/service/v0/service.go @@ -27,7 +27,7 @@ const ( HeaderPurge = "Purge" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) GetMe(http.ResponseWriter, *http.Request) diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index d1e872c422..f5afcf72c4 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -110,7 +110,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/groups/pkg/command/version.go b/services/groups/pkg/command/version.go index 1800ebcf27..270cb99c6e 100644 --- a/services/groups/pkg/command/version.go +++ b/services/groups/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index bd1cca2b10..cf3670e021 100644 --- a/services/idm/pkg/command/server.go +++ b/services/idm/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/idm/pkg/command/version.go b/services/idm/pkg/command/version.go index f18727e12f..b9834afe39 100644 --- a/services/idm/pkg/command/version.go +++ b/services/idm/pkg/command/version.go @@ -9,7 +9,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { // not implemented diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index 4991a385e3..de87b03b2c 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -32,7 +32,7 @@ const _rsaKeySize = 4096 func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/idp/pkg/command/version.go b/services/idp/pkg/command/version.go index 59652acf50..392d9178f6 100644 --- a/services/idp/pkg/command/version.go +++ b/services/idp/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/idp/pkg/service/v0/service.go b/services/idp/pkg/service/v0/service.go index a32a0ecb29..ce47018cca 100644 --- a/services/idp/pkg/service/v0/service.go +++ b/services/idp/pkg/service/v0/service.go @@ -29,7 +29,7 @@ import ( "stash.kopano.io/kgol/rndm" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) } diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index 08ef0b4426..c040d609ac 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -18,7 +18,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/nats/pkg/command/version.go b/services/nats/pkg/command/version.go index cedb412b1e..7e82763e15 100644 --- a/services/nats/pkg/command/version.go +++ b/services/nats/pkg/command/version.go @@ -9,7 +9,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { // not implemented diff --git a/services/notifications/pkg/command/server.go b/services/notifications/pkg/command/server.go index 91f43b1b93..9d521795c2 100644 --- a/services/notifications/pkg/command/server.go +++ b/services/notifications/pkg/command/server.go @@ -19,7 +19,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/notifications/pkg/command/version.go b/services/notifications/pkg/command/version.go index 153f65af38..3d288bb776 100644 --- a/services/notifications/pkg/command/version.go +++ b/services/notifications/pkg/command/version.go @@ -9,7 +9,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { // not implemented diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index d98d9e2f91..3fc7d05a0b 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -20,7 +20,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -109,7 +109,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/ocdav/pkg/command/version.go b/services/ocdav/pkg/command/version.go index 71ab3f9019..6025ef4824 100644 --- a/services/ocdav/pkg/command/version.go +++ b/services/ocdav/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/ocs/pkg/command/server.go b/services/ocs/pkg/command/server.go index 669fea4f6e..f3ddc42762 100644 --- a/services/ocs/pkg/command/server.go +++ b/services/ocs/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/ocs/pkg/command/version.go b/services/ocs/pkg/command/version.go index 4d3bf8bba2..06e48e76ef 100644 --- a/services/ocs/pkg/command/version.go +++ b/services/ocs/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/ocs/pkg/service/v0/service.go b/services/ocs/pkg/service/v0/service.go index 372d0c9c95..6a568ee35f 100644 --- a/services/ocs/pkg/service/v0/service.go +++ b/services/ocs/pkg/service/v0/service.go @@ -23,7 +23,7 @@ import ( "github.com/owncloud/ocis/v2/services/proxy/pkg/user/backend" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) GetConfig(http.ResponseWriter, *http.Request) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 81342945f1..37d11e4997 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -38,7 +38,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/proxy/pkg/command/version.go b/services/proxy/pkg/command/version.go index b24caa11ba..0cf3e85b1d 100644 --- a/services/proxy/pkg/command/version.go +++ b/services/proxy/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "Print the version of this binary and the running extension instances", + Usage: "Print the version of this binary and the running service instances", Category: "Version", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/search/pkg/command/server.go b/services/search/pkg/command/server.go index 967fd96bf2..013b27bdc8 100644 --- a/services/search/pkg/command/server.go +++ b/services/search/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/search/pkg/command/version.go b/services/search/pkg/command/version.go index 9aba6033b0..fd176dc9a7 100644 --- a/services/search/pkg/command/version.go +++ b/services/search/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/settings/pkg/command/server.go b/services/settings/pkg/command/server.go index 9306b00bf9..2bde2df760 100644 --- a/services/settings/pkg/command/server.go +++ b/services/settings/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/settings/pkg/command/version.go b/services/settings/pkg/command/version.go index 9ac087f77d..ac123be776 100644 --- a/services/settings/pkg/command/version.go +++ b/services/settings/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index a08cd09266..054663a504 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -110,7 +110,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/sharing/pkg/command/version.go b/services/sharing/pkg/command/version.go index 368f0710d2..71582ede30 100644 --- a/services/sharing/pkg/command/version.go +++ b/services/sharing/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/sharing/pkg/config/config.go b/services/sharing/pkg/config/config.go index bada48551b..a9341bc765 100644 --- a/services/sharing/pkg/config/config.go +++ b/services/sharing/pkg/config/config.go @@ -124,7 +124,7 @@ type PublicSharingSQLDriver struct { } type PublicSharingCS3Driver struct { - ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_CS3_PROVIDER_ADDR" desc:"GRPC address of the STORAGE-SYSTEM extension."` + ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_CS3_PROVIDER_ADDR" desc:"GRPC address of the STORAGE-SYSTEM service."` SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_PUBLIC_CS3_SYSTEM_USER_ID" desc:"ID of the oCIS STORAGE-SYSTEM system user. Admins need to set the ID for the STORAGE-SYSTEM system user in this config option which is then used to reference the user. Any reasonable long string is possible, preferably this would be an UUIDv4 format."` SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_SYSTEM_USER_IDP;SHARING_PUBLIC_CS3_SYSTEM_USER_IDP" desc:"IDP of the oCIS STORAGE-SYSTEM system user."` SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_USER_CS3_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user."` diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index ece1c444d0..9bd9e2456d 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/storage-publiclink/pkg/command/version.go b/services/storage-publiclink/pkg/command/version.go index 31e23c9f38..3a96eba8e9 100644 --- a/services/storage-publiclink/pkg/command/version.go +++ b/services/storage-publiclink/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index 243baa43d7..d872b941bb 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/storage-shares/pkg/command/version.go b/services/storage-shares/pkg/command/version.go index df3e40b2fc..e88d717d94 100644 --- a/services/storage-shares/pkg/command/version.go +++ b/services/storage-shares/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index 1e5aecd39f..f86426db0d 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -108,7 +108,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/storage-system/pkg/command/version.go b/services/storage-system/pkg/command/version.go index 43898d1490..d1c3b7170a 100644 --- a/services/storage-system/pkg/command/version.go +++ b/services/storage-system/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index 1b93469990..9c3435a0b3 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -97,7 +97,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/storage-users/pkg/command/version.go b/services/storage-users/pkg/command/version.go index 153d72e551..b305b0d615 100644 --- a/services/storage-users/pkg/command/version.go +++ b/services/storage-users/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/store/pkg/command/server.go b/services/store/pkg/command/server.go index ceb0d0c84e..8ea9a0f974 100644 --- a/services/store/pkg/command/server.go +++ b/services/store/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/store/pkg/command/version.go b/services/store/pkg/command/version.go index b1cfe57429..81fcb3533a 100644 --- a/services/store/pkg/command/version.go +++ b/services/store/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/thumbnails/pkg/command/server.go b/services/thumbnails/pkg/command/server.go index a6cfd16e68..cafd70258b 100644 --- a/services/thumbnails/pkg/command/server.go +++ b/services/thumbnails/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/thumbnails/pkg/command/version.go b/services/thumbnails/pkg/command/version.go index 5b893a8979..b52381f04a 100644 --- a/services/thumbnails/pkg/command/version.go +++ b/services/thumbnails/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/thumbnails/pkg/service/http/v0/service.go b/services/thumbnails/pkg/service/http/v0/service.go index a124ab7e63..8b201658c4 100644 --- a/services/thumbnails/pkg/service/http/v0/service.go +++ b/services/thumbnails/pkg/service/http/v0/service.go @@ -21,7 +21,7 @@ const ( keyContextKey contextKey = "key" ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) GetThumbnail(http.ResponseWriter, *http.Request) diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index 81d849d879..e06bd8e78d 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) @@ -110,7 +110,7 @@ func Server(cfg *config.Config) *cli.Command { } } -// defineContext sets the context for the extension. If there is a context configured it will create a new child from it, +// defineContext sets the context for the service. If there is a context configured it will create a new child from it, // if not, it will create a root context that can be cancelled. func defineContext(cfg *config.Config) (context.Context, context.CancelFunc) { return func() (context.Context, context.CancelFunc) { diff --git a/services/users/pkg/command/version.go b/services/users/pkg/command/version.go index d4f8c4038a..7fd54b70ae 100644 --- a/services/users/pkg/command/version.go +++ b/services/users/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/web/pkg/command/server.go b/services/web/pkg/command/server.go index 2a90ff4e8a..85283bbcf0 100644 --- a/services/web/pkg/command/server.go +++ b/services/web/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/web/pkg/command/version.go b/services/web/pkg/command/version.go index faef4e15bc..6b1111fca1 100644 --- a/services/web/pkg/command/version.go +++ b/services/web/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) diff --git a/services/web/pkg/service/v0/service.go b/services/web/pkg/service/v0/service.go index 342c39e254..a99c4c2930 100644 --- a/services/web/pkg/service/v0/service.go +++ b/services/web/pkg/service/v0/service.go @@ -22,7 +22,7 @@ var ( ErrConfigInvalid = `Invalid or missing config` ) -// Service defines the extension handlers. +// Service defines the service handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) Config(http.ResponseWriter, *http.Request) diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index 43f1744e0d..c3f0fa1b26 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/webdav/pkg/command/version.go b/services/webdav/pkg/command/version.go index fed75e7920..b70abaaf7d 100644 --- a/services/webdav/pkg/command/version.go +++ b/services/webdav/pkg/command/version.go @@ -16,7 +16,7 @@ import ( func Version(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "version", - Usage: "print the version of this binary and the running extension instances", + Usage: "print the version of this binary and the running service instances", Category: "info", Action: func(c *cli.Context) error { fmt.Println("Version: " + version.GetString()) From 1f12753e13cc8a7fb1ff5ecae0af3e0f2979b5ab Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 17 Aug 2022 15:42:04 +0200 Subject: [PATCH 050/103] add changelog --- changelog/unreleased/change-rename-uploads-purge-clean.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/change-rename-uploads-purge-clean.md diff --git a/changelog/unreleased/change-rename-uploads-purge-clean.md b/changelog/unreleased/change-rename-uploads-purge-clean.md new file mode 100644 index 0000000000..7b131b65d3 --- /dev/null +++ b/changelog/unreleased/change-rename-uploads-purge-clean.md @@ -0,0 +1,6 @@ +Change: rename "uploads purge" command to "uploads clean" + +We've renamed the storage-users service's "uploads purge" command +to "upload clean". + +https://github.com/owncloud/ocis/pull/4403 From c430c1868b1ba4197a5b34a9d6454921ccdf1be1 Mon Sep 17 00:00:00 2001 From: Kiran Parajuli Date: Tue, 16 Aug 2022 11:38:21 +0545 Subject: [PATCH 051/103] Zip before cache Signed-off-by: Kiran Parajuli --- .drone.star | 81 ++++++++++++++++++++------- tests/config/drone/check_web_cache.sh | 2 +- 2 files changed, 61 insertions(+), 22 deletions(-) diff --git a/.drone.star b/.drone.star index 865ea74bbb..1ac30b7352 100644 --- a/.drone.star +++ b/.drone.star @@ -43,6 +43,10 @@ DEFAULT_NODEJS_VERSION = "14" dirs = { "base": "/drone/src", "web": "/drone/src/webTestRunner", + "zip": "/drone/src/zip", + "webZip": "/drone/src/zip/web.tar.gz", + "e2eYarnZip": "/drone/src/zip/e2e.tar.gz", + "acceptanceYarnZip": "/drone/src/zip/acceptance.tar.gz", # relative path from the base directory dirs["base"] # this is because the PLUGINS_S3_CACHE does not support absolute paths # PLUGINS_S3_CACHE is used to cache the core and testing app @@ -220,7 +224,7 @@ def main(ctx): test_pipelines = \ cancelPreviousBuilds() + \ - buildCacheWeb(ctx) + \ + buildWebCache(ctx) + \ [buildOcisBinaryForTesting(ctx)] + \ cacheCoreReposForTesting(ctx) + \ testOcisModules(ctx) + \ @@ -270,11 +274,11 @@ def main(ctx): pipelineSanityChecks(ctx, pipelines) return pipelines -def buildCacheWeb(ctx): +def buildWebCache(ctx): return [{ "kind": "pipeline", "type": "docker", - "name": "cache-web", + "name": "build-web-cache", "clone": { "disable": True, }, @@ -809,7 +813,7 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "name": "uploads", "temp": {}, }], - "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]), + "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)] + buildWebCache(ctx)), "trigger": { "ref": [ "refs/heads/master", @@ -874,7 +878,7 @@ def e2eTests(ctx): "type": "docker", "name": "e2e-tests", "steps": e2eTestsSteps, - "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]), + "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)] + buildWebCache(ctx)), "trigger": e2e_trigger, "volumes": e2e_volumes, }] @@ -1006,7 +1010,7 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4): "name": "uploads", "temp": {}, }], - "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]), + "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)] + buildWebCache(ctx)), "trigger": { "ref": [ "refs/heads/master", @@ -2808,7 +2812,14 @@ def generateWebCache(ctx): "rm -rf %s" % dirs["web"], "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git %s" % dirs["web"], "cd %s && git checkout $WEB_COMMITID" % dirs["web"], - "ls -la", + ], + }, + { + "name": "zip-web", + "image": OC_UBUNTU, + "commands": [ + "if [ ! -d '%s' ]; then mkdir -p %s; fi" % (dirs["zip"], dirs["zip"]), + "tar -czvf %s webTestRunner" % dirs["webZip"], ], }, { @@ -2819,7 +2830,7 @@ def generateWebCache(ctx): "source ./.drone.env", # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror --overwrite --remove %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["web"], + "mc cp -r -a %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["webZip"], ], }, { @@ -2828,20 +2839,40 @@ def generateWebCache(ctx): "commands": [ "cd %s" % dirs["web"], "retry -t 3 'yarn install --immutable --frozen-lockfile'", - "cd %s/tests/acceptance" % dirs["web"], + "cd tests/acceptance", "retry -t 3 'yarn install --immutable --frozen-lockfile'", ], }, + { + "name": "zip-yarn", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + # zip the yarn deps before caching + "cd %s" % dirs["web"], + "tar -czvf %s .yarn" % dirs["e2eYarnZip"], + "cd tests/acceptance", + "tar -czvf %s .yarn" % dirs["acceptanceYarnZip"], + ], + }, { "name": "cache-yarn", "image": MINIO_MC, "environment": MINIO_MC_ENV, "commands": [ "source ./.drone.env", - # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) + # cache using the minio/mc client to the public bucket (long term bucket) "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror --overwrite --remove %s/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-e2e-$WEB_COMMITID" % dirs["web"], - "mc mirror --overwrite --remove %s/tests/acceptance/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-acceptance-$WEB_COMMITID" % dirs["web"], + "mc cp -r -a %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["e2eYarnZip"], + "mc cp -r -a %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["acceptanceYarnZip"], + ], + }, + { + "name": "list-web-cache", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc ls --recursive s3/$CACHE_BUCKET/ocis/web-test-runner", ], }, ] @@ -2853,10 +2884,16 @@ def restoreWebCache(): "environment": MINIO_MC_ENV, "commands": [ "source ./.drone.env", + "rm -rf %s" % dirs["web"], + "mkdir -p %s" % dirs["web"], "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID %s" % dirs["web"], - "ls -la %s" % dirs["web"], - "chmod +x %s/tests/acceptance/*.sh" % dirs["web"], + "mc cp -r -a s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID/web.tar.gz %s" % dirs["zip"], + ], + }, { + "name": "unzip-web-cache", + "image": OC_UBUNTU, + "commands": [ + "tar -xvf %s -C ." % dirs["webZip"], ], }] @@ -2868,15 +2905,16 @@ def restoreWebE2EYarnCache(): "commands": [ "source ./.drone.env", "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-e2e-$WEB_COMMITID %s/.yarn" % dirs["web"], - "ls -la %s/.yarn" % dirs["web"], + "mc cp -r -a s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID/e2e.tar.gz %s" % dirs["zip"], ], }, { # we need to install again becase the node_modules are not cached - "name": "install-yarn-e2e", + "name": "unzip-and-install-yarn-e2e", "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, "commands": [ "cd %s" % dirs["web"], + "rm -rf .yarn", + "tar -xvf %s" % dirs["e2eYarnZip"], "retry -t 3 'yarn install --immutable'", ], }] @@ -2889,15 +2927,16 @@ def restoreWebAcceptanceYarnCache(): "commands": [ "source ./.drone.env", "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-acceptance-$WEB_COMMITID %s/tests/acceptance/.yarn" % dirs["web"], - "ls -la %s/tests/acceptance/.yarn" % dirs["web"], + "mc cp -r -a s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID/acceptance.tar.gz %s" % dirs["zip"], ], }, { # we need to install again becase the node_modules are not cached - "name": "install-yarn-acceptance", + "name": "unzip-and-install-yarn-acceptance", "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, "commands": [ "cd %s/tests/acceptance" % dirs["web"], + "rm -rf .yarn", + "tar -xvf %s -C ." % dirs["acceptanceYarnZip"], "retry -t 3 'yarn install --immutable'", ], }] diff --git a/tests/config/drone/check_web_cache.sh b/tests/config/drone/check_web_cache.sh index 6ef83fa553..0226db5001 100644 --- a/tests/config/drone/check_web_cache.sh +++ b/tests/config/drone/check_web_cache.sh @@ -3,7 +3,7 @@ source .drone.env echo "Checking web version - $WEB_COMMITID in cache" -URL="$CACHE_ENDPOINT/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID/README.md" +URL="$CACHE_ENDPOINT/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID/web.tar.gz" echo "Checking for the web cache at '$URL'." From ff1fea33598338302f9110da803317b09a20bd22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Aug 2022 06:41:51 +0000 Subject: [PATCH 052/103] Bump github.com/go-chi/render from 1.0.1 to 1.0.2 Bumps [github.com/go-chi/render](https://github.com/go-chi/render) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/go-chi/render/releases) - [Commits](https://github.com/go-chi/render/compare/v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: github.com/go-chi/render dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 3 ++- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2ff7116ab2..c9217507bd 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 github.com/go-chi/cors v1.2.1 - github.com/go-chi/render v1.0.1 + github.com/go-chi/render v1.0.2 github.com/go-ldap/ldap/v3 v3.4.4 github.com/go-ldap/ldif v0.0.0-20200320164324-fd88d9b715b3 github.com/go-micro/plugins/v4/client/grpc v1.1.0 @@ -96,6 +96,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3 // indirect github.com/RoaringBitmap/roaring v0.9.4 // indirect github.com/acomagu/bufpipe v1.0.3 // indirect + github.com/ajg/form v1.5.1 // indirect github.com/alexedwards/argon2id v0.0.0-20211130144151-3585854a6387 // indirect github.com/amoghe/go-crypt v0.0.0-20220222110647-20eada5f5964 // indirect github.com/armon/go-metrics v0.3.10 // indirect diff --git a/go.sum b/go.sum index 6480caa8e2..26b180c9d0 100644 --- a/go.sum +++ b/go.sum @@ -123,6 +123,8 @@ github.com/Songmu/prompter v0.5.1/go.mod h1:CS3jEPD6h9IaLaG6afrl1orTgII9+uDWuw95 github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= +github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/akamai/AkamaiOPEN-edgegrid-golang v1.1.0/go.mod h1:kX6YddBkXqqywAe8c9LyvgTCyFuZCTMF4cRPQhc3Fy8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -378,8 +380,8 @@ github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8= github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= -github.com/go-chi/render v1.0.1 h1:4/5tis2cKaNdnv9zFLfXzcquC9HbeZgCnxGnKrltBS8= -github.com/go-chi/render v1.0.1/go.mod h1:pq4Rr7HbnsdaeHagklXub+p6Wd16Af5l9koip1OvJns= +github.com/go-chi/render v1.0.2 h1:4ER/udB0+fMWB2Jlf15RV3F4A2FDuYi/9f+lFttR/Lg= +github.com/go-chi/render v1.0.2/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0= github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= From 08c7743df91fb6015a94e24afda8ca6e3300f921 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 18 Aug 2022 09:20:58 +0200 Subject: [PATCH 053/103] add header to clean up and rename purge to clean in leftover places --- services/storage-users/pkg/command/uploads.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index 3a796c4a3f..ea553de013 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -110,7 +110,7 @@ func PurgeExpiredUploads(cfg *config.Config) *cli.Command { managingFS, ok := fs.(storage.UploadsManager) if !ok { - fmt.Fprintf(os.Stderr, "'%s' storage does not support purging expired uploads\n", cfg.Driver) + fmt.Fprintf(os.Stderr, "'%s' storage does not support clean expired uploads\n", cfg.Driver) os.Exit(1) } @@ -118,11 +118,10 @@ func PurgeExpiredUploads(cfg *config.Config) *cli.Command { wg.Add(1) purgedChannel := make(chan tusd.FileInfo) + fmt.Println("Cleaned uploads:") go func() { for purged := range purgedChannel { - fmt.Printf("Purging %s (Filename: %s, Size: %d, Expires: %s)\n", - purged.ID, purged.MetaData["filename"], purged.Size, expiredString(purged.MetaData["expires"])) - + fmt.Printf(" - %s (%s, Size: %d, Expires: %s)\n", purged.ID, purged.MetaData["filename"], purged.Size, expiredString(purged.MetaData["expires"])) } wg.Done() }() @@ -131,7 +130,7 @@ func PurgeExpiredUploads(cfg *config.Config) *cli.Command { close(purgedChannel) wg.Wait() if err != nil { - fmt.Fprintf(os.Stderr, "Failed to purge expired uploads '%s'\n", err) + fmt.Fprintf(os.Stderr, "Failed to clean expired uploads '%s'\n", err) return err } return nil From cf12ecf356cab70004be120a964f31b80f813553 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 18 Aug 2022 07:27:08 +0000 Subject: [PATCH 054/103] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db8eac1aa7..8f0647b373 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1405,7 +1405,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -1573,28 +1573,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -1763,6 +1746,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 70bce6b3f0df342383c0a83f0451219e479e2d08 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 18 Aug 2022 09:35:48 +0200 Subject: [PATCH 055/103] remove leading slash --- services/frontend/pkg/revaconfig/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index f53e1202d3..a247f7b5bd 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -16,7 +16,7 @@ func FrontendConfigFromStruct(cfg *config.Config) (map[string]interface{}, error if err != nil { return nil, err } - webURL.Path = path.Join(webURL.Path, "/external") + webURL.Path = path.Join(webURL.Path, "external") webOpenInAppURL := webURL.String() archivers := []map[string]interface{}{ From a6c662931b4fce1ea85357027c00e10d76e9c420 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:21:26 +0000 Subject: [PATCH 056/103] Automated changelog update [skip ci] --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f0647b373..236d459e7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ The following sections list the changes for unreleased. ## Summary * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) +* Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) +* Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) ## Details @@ -18,6 +20,14 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4394 +* Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) + + We've added an /app/open-with-web endpoint to the app provider, so that clients that are no + browser or have only limited browser access can also open apps with the help of a Web URL. + + https://github.com/owncloud/ocis/pull/4376 + https://github.com/cs3org/reva/pull/3143 + * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) The new command `ocis idm resetpassword` allows to reset the administrator password when ocis @@ -25,6 +35,14 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/issues/4084 https://github.com/owncloud/ocis/pull/4365 + +* Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) + + Updated reva to version x.x.x. This update includes: + + * TODO: + + https://github.com/owncloud/ocis/pull/4376 # Changelog for [2.0.0-beta.6] (2022-08-11) The following sections list the changes for 2.0.0-beta.6. From 5e166193ad69450dcd8e404b6920c8eb964ea2b4 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:57:27 +0000 Subject: [PATCH 057/103] Automated changelog update [skip ci] --- CHANGELOG.md | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 236d459e7d..5e2848f129 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The following sections list the changes for unreleased. ## Summary * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) +* Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) * Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) @@ -20,6 +21,12 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4394 +* Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) + + We've renamed the storage-users service's "uploads purge" command to "upload clean". + + https://github.com/owncloud/ocis/pull/4403 + * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) We've added an /app/open-with-web endpoint to the app provider, so that clients that are no @@ -1423,7 +1430,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -1591,11 +1598,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -1764,23 +1788,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 60689c9c1a9ad4dcdabc52db496af950f6d91429 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 18 Aug 2022 10:59:35 +0200 Subject: [PATCH 058/103] improve unsupervised description --- .../unreleased/bugfix-rename-extensions-to-services.md | 6 ++++++ services/app-provider/pkg/command/server.go | 2 +- services/app-registry/pkg/command/server.go | 2 +- services/audit/pkg/command/server.go | 2 +- services/auth-basic/pkg/command/server.go | 2 +- services/auth-bearer/pkg/command/server.go | 2 +- services/auth-machine/pkg/command/server.go | 2 +- services/frontend/pkg/command/server.go | 2 +- services/gateway/pkg/command/server.go | 2 +- services/graph-explorer/pkg/command/server.go | 2 +- services/graph/pkg/command/server.go | 2 +- services/groups/pkg/command/server.go | 2 +- services/idm/pkg/command/server.go | 2 +- services/idp/pkg/command/server.go | 2 +- services/nats/pkg/command/server.go | 2 +- services/notifications/pkg/command/server.go | 2 +- services/ocdav/pkg/command/server.go | 2 +- services/ocs/pkg/command/server.go | 2 +- services/proxy/pkg/command/server.go | 2 +- services/search/pkg/command/server.go | 2 +- services/settings/pkg/command/server.go | 2 +- services/sharing/pkg/command/server.go | 2 +- services/storage-publiclink/pkg/command/server.go | 2 +- services/storage-shares/pkg/command/server.go | 2 +- services/storage-system/pkg/command/server.go | 2 +- services/storage-users/pkg/command/server.go | 2 +- services/store/pkg/command/server.go | 2 +- services/thumbnails/pkg/command/server.go | 2 +- services/users/pkg/command/server.go | 2 +- services/web/pkg/command/server.go | 2 +- services/webdav/pkg/command/server.go | 2 +- 31 files changed, 36 insertions(+), 30 deletions(-) create mode 100644 changelog/unreleased/bugfix-rename-extensions-to-services.md diff --git a/changelog/unreleased/bugfix-rename-extensions-to-services.md b/changelog/unreleased/bugfix-rename-extensions-to-services.md new file mode 100644 index 0000000000..fb38688cae --- /dev/null +++ b/changelog/unreleased/bugfix-rename-extensions-to-services.md @@ -0,0 +1,6 @@ +Bugfix: Rename extensions to services (leftover occurences) + +We've already renamed extensions to services in previous PRs and this +PR peforms this rename for leftover occurences. + +https://github.com/owncloud/ocis/pull/4407 diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index a1290ac29b..9f4e940f7f 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/app-registry/pkg/command/server.go b/services/app-registry/pkg/command/server.go index 5e22ec453e..f104d405ab 100644 --- a/services/app-registry/pkg/command/server.go +++ b/services/app-registry/pkg/command/server.go @@ -24,7 +24,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/audit/pkg/command/server.go b/services/audit/pkg/command/server.go index 60e2a997d9..8942312894 100644 --- a/services/audit/pkg/command/server.go +++ b/services/audit/pkg/command/server.go @@ -20,7 +20,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index 7041d330ba..59fd65cef9 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index 2e26e0482e..d43f0dc1e9 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index a2e0418deb..1818693728 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index dbfa2eb43b..872c0b2de5 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/gateway/pkg/command/server.go b/services/gateway/pkg/command/server.go index 6bf6eac0e2..b24d05b9db 100644 --- a/services/gateway/pkg/command/server.go +++ b/services/gateway/pkg/command/server.go @@ -24,7 +24,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/graph-explorer/pkg/command/server.go b/services/graph-explorer/pkg/command/server.go index a427e4d33b..01a7a58e40 100644 --- a/services/graph-explorer/pkg/command/server.go +++ b/services/graph-explorer/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(ctx *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index 3fead9ea79..636ff4544f 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index f5afcf72c4..e6883793e7 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index cf3670e021..92a30f7baf 100644 --- a/services/idm/pkg/command/server.go +++ b/services/idm/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index de87b03b2c..70bc123d7d 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -32,7 +32,7 @@ const _rsaKeySize = 4096 func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index c040d609ac..abb3ec7d0c 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -18,7 +18,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/notifications/pkg/command/server.go b/services/notifications/pkg/command/server.go index 9d521795c2..9071bee148 100644 --- a/services/notifications/pkg/command/server.go +++ b/services/notifications/pkg/command/server.go @@ -19,7 +19,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index 3fc7d05a0b..19d4a351c4 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -20,7 +20,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/ocs/pkg/command/server.go b/services/ocs/pkg/command/server.go index f3ddc42762..04b3701c4d 100644 --- a/services/ocs/pkg/command/server.go +++ b/services/ocs/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 37d11e4997..16cb959d43 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -38,7 +38,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/search/pkg/command/server.go b/services/search/pkg/command/server.go index 013b27bdc8..3faf1e061c 100644 --- a/services/search/pkg/command/server.go +++ b/services/search/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/settings/pkg/command/server.go b/services/settings/pkg/command/server.go index 2bde2df760..4dd9b9a40b 100644 --- a/services/settings/pkg/command/server.go +++ b/services/settings/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index 054663a504..a690f6d23b 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index 9bd9e2456d..80ebfaff2a 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index d872b941bb..7a4c208c66 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index f86426db0d..a9257b9858 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index 9c3435a0b3..caf1de68f2 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -25,7 +25,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/store/pkg/command/server.go b/services/store/pkg/command/server.go index 8ea9a0f974..c548b786da 100644 --- a/services/store/pkg/command/server.go +++ b/services/store/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/thumbnails/pkg/command/server.go b/services/thumbnails/pkg/command/server.go index cafd70258b..404a9815c9 100644 --- a/services/thumbnails/pkg/command/server.go +++ b/services/thumbnails/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index e06bd8e78d..2fc836d364 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -26,7 +26,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/web/pkg/command/server.go b/services/web/pkg/command/server.go index 85283bbcf0..247e249631 100644 --- a/services/web/pkg/command/server.go +++ b/services/web/pkg/command/server.go @@ -22,7 +22,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index c3f0fa1b26..4b2290ae16 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -21,7 +21,7 @@ import ( func Server(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "server", - Usage: fmt.Sprintf("start %s service without runtime (unsupervised mode)", cfg.Service.Name), + Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { err := parser.ParseConfig(cfg) From b43448f071d604724a1068ed983c14d6abb2df23 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 16 Aug 2022 15:16:45 +0200 Subject: [PATCH 059/103] add language selection for app provider --- ...ncement-app-provider-language-selection.md | 8 ++++++++ docs/services/app-registry/apps.md | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 changelog/unreleased/enhancement-app-provider-language-selection.md diff --git a/changelog/unreleased/enhancement-app-provider-language-selection.md b/changelog/unreleased/enhancement-app-provider-language-selection.md new file mode 100644 index 0000000000..0a2dca3c3c --- /dev/null +++ b/changelog/unreleased/enhancement-app-provider-language-selection.md @@ -0,0 +1,8 @@ +Enhancement: Added language option to the app provider + +We've added an language option to the app provider which will in the +end be passed to the app a user opens so that the web ui is displayed in the users language. + +https://github.com/owncloud/ocis/pull/4399 +https://github.com/cs3org/reva/pull/3156 +https://github.com/owncloud/ocis/issues/4367 diff --git a/docs/services/app-registry/apps.md b/docs/services/app-registry/apps.md index e9726849cb..457e2294fb 100644 --- a/docs/services/app-registry/apps.md +++ b/docs/services/app-registry/apps.md @@ -245,12 +245,21 @@ See error cases for [Open a file with the app provider](#open-a-file-with-the-ap - `write`: user can edit and download in the opening app - `read`: user can view and download from the opening app - `view`: user can view in the opening app (download is not possible) +- `lang` (optional) + - default (not given): default language of the application (which might maybe use the browser language) + - possible value is any ISO 639-1 language code. Examples: + - de + - en + - es + - ... **Request examples**: ```bash curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=' +curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&lang=de' + curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&app_name=Collabora' curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&view_mode=read' @@ -362,6 +371,17 @@ HTTP status code: 200 } ``` +- invalid language code + + HTTP status code: 400 + + ```json + { + "code": "INVALID_PARAMETER", + "message": "lang parameter does not contain a valid ISO 639-1 language code" + } + ``` + ### Creating a file with the app provider **Endpoint**: specified in the capabilities in `new_file_url`, currently `/app/new` From 84f8f797c995318ddf0864700bc5416b93778e7c Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Thu, 18 Aug 2022 11:23:57 +0200 Subject: [PATCH 060/103] [test-only]Api test. check that link or share exist for space members (#4348) Co-authored-by: Saw-jan --- .vscode/launch.json | 5 ++ .../apiSpaces/editPublicLinkOfSpace.feature | 12 ++-- .../apiSpaces/shareSubItemOfSpace.feature | 12 ++++ .../shareSubItemOfSpaceViaPublicLink.feature | 14 ++++ .../features/bootstrap/SpacesContext.php | 69 ++++++++++++++++--- 5 files changed, 95 insertions(+), 17 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 0ecba45fa3..7eae324211 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,11 @@ { "version": "0.2.0", "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch" + }, { "name": "oCIS server", "type": "go", diff --git a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature index 764d0f63e5..29e4a96f90 100644 --- a/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature +++ b/tests/acceptance/features/apiSpaces/editPublicLinkOfSpace.feature @@ -52,18 +52,18 @@ Feature: A manager of the space can edit public link | 15 | read,update,create,delete | | newName | 2042-03-25T23:59:59+0100 | - Scenario Outline: Only users with manager role can see a created public link + Scenario Outline: All members can see a created public link Given using OCS API version "2" When user "Alice" shares a space "edit space" to user "Brian" with role "" Then the HTTP status code should be "200" And the OCS status code should be "200" And for user "Alice" the space "edit space" should contain the last created public link - And for user "Brian" the space "edit space" contain the last created public link + And for user "Brian" the space "edit space" should contain the last created public link Examples: - | role | shouldOrNot | - | manager | should | - | editor | should | - | viewer | should | + | role | + | manager | + | editor | + | viewer | Scenario Outline: Members of the space try to edit a public link diff --git a/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature b/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature index 4a22178e1f..184fae7da6 100644 --- a/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature +++ b/tests/acceptance/features/apiSpaces/shareSubItemOfSpace.feature @@ -62,3 +62,15 @@ Feature: Share a file or folder that is inside a space | file.txt | editor | 404 | No share permission | | file.txt | viewer | 404 | No share permission | | folder | viewer | 404 | No share permission | + + + Scenario Outline: An user participant of the project space can see the created resources share + Given user "Alice" has shared a space "share sub-item" to user "Brian" with role "" + When user "Alice" shares the following entity "file.txt" inside of space "share sub-item" with user "Bob" with role "editor" + Then for user "Alice" the space "share sub-item" should contain the last created share of the file "file.txt" + And for user "Brian" the space "share sub-item" should contain the last created share of the file "file.txt" + Examples: + | spaceRole | + | editor | + | viewer | + | manager | diff --git a/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature b/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature index 017ef55b9a..e9bb47d8af 100644 --- a/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature +++ b/tests/acceptance/features/apiSpaces/shareSubItemOfSpaceViaPublicLink.feature @@ -117,3 +117,17 @@ Feature: Share a file or folder that is inside a space via public link | ocs_api_version | ocs_status_code | | 1 | 100 | | 2 | 200 | + + + Scenario Outline: An user participant of the project space can see the created public resources link + Given user "Alice" has shared a space "share sub-item" to user "Brian" with role "" + When user "Alice" creates a public link share inside of space "share sub-item" with settings: + | path | folder/file.txt | + | shareType | 3 | + | permissions | 1 | + Then for user "Brian" the space "share sub-item" should contain the last created public link of the file "folder/file.txt" + Examples: + | spaceRole | + | editor | + | viewer | + | manager | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 6d0f3c8858..470a9d0fd9 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -376,6 +376,20 @@ class SpacesContext implements Context { throw new Exception(__METHOD__ . " user with name $userName not found"); } + /** + * using method from core to set share data + * + * @return void + */ + public function setLastShareData(): void { + // set last response as PublicShareData + $this->featureContext->setLastPublicShareData($this->featureContext->getResponseXml(null, __METHOD__)); + // set last shareId if ShareData exists + if (isset($this->featureContext->getLastPublicShareData()->data)) { + $this->featureContext->setLastPublicLinkShareId((string) $this->featureContext->getLastPublicShareData()->data[0]->id); + } + } + /** * @BeforeScenario * @@ -2055,6 +2069,7 @@ class SpacesContext implements Context { $body ) ); + $this->setLastShareData(); } /** @@ -2062,7 +2077,7 @@ class SpacesContext implements Context { * * @param string $user * @param string $spaceName - * @param TableNode|null $table + * @param TableNode $table * * @return void * @throws GuzzleException @@ -2070,7 +2085,7 @@ class SpacesContext implements Context { public function createPublicLinkToEntityInsideOfSpaceRequest( string $user, string $spaceName, - ?TableNode $table + TableNode $table ): void { $space = $this->getSpaceByName($user, $spaceName); $rows = $table->getRowsHash(); @@ -2101,6 +2116,32 @@ class SpacesContext implements Context { $body ) ); + + $this->setLastShareData(); + } + + /** + * @Given /^user "([^"]*)" has created a public link share inside of space "([^"]*)" with settings:$/ + * + * @param string $user + * @param string $spaceName + * @param TableNode $table + * + * @return void + * @throws GuzzleException + */ + public function userHasCreatedPublicLinkToEntityInsideOfSpaceRequest( + string $user, + string $spaceName, + TableNode $table + ): void { + $this->createPublicLinkToEntityInsideOfSpaceRequest($user, $spaceName, $table); + + $expectedHTTPStatus = "200"; + $this->featureContext->theHTTPStatusCodeShouldBe( + $expectedHTTPStatus, + "Expected response status code should be $expectedHTTPStatus" + ); } /** @@ -2917,12 +2958,7 @@ class SpacesContext implements Context { ) ); - // set last response as PublicShareData. using method from core - $this->featureContext->setLastPublicShareData($this->featureContext->getResponseXml(null, __METHOD__)); - // set last shareId if ShareData exists. using method from core - if (isset($this->featureContext->getLastPublicShareData()->data)) { - $this->featureContext->setLastPublicLinkShareId((string) $this->featureContext->getLastPublicShareData()->data[0]->id); - } + $this->setLastShareData(); } /** @@ -2952,10 +2988,13 @@ class SpacesContext implements Context { /** * @Then /^for user "([^"]*)" the space "([^"]*)" should (not|)\s?contain the last created public link$/ + * @Then /^for user "([^"]*)" the space "([^"]*)" should (not|)\s?contain the last created public link of the file "([^"]*)"$/ + * @Then /^for user "([^"]*)" the space "([^"]*)" should (not|)\s?contain the last created share of the file "([^"]*)"$/ * * @param string $user * @param string $spaceName * @param string $shouldOrNot (not|) + * @param string $fileName * * @return void * @@ -2964,10 +3003,18 @@ class SpacesContext implements Context { public function forUserSpaceShouldContainLinks( string $user, string $spaceName, - string $shouldOrNot + string $shouldOrNot, + string $fileName = '' ): void { - $space = $this->getSpaceByName($user, $spaceName); - $url = "/apps/files_sharing/api/v1/shares?reshares=true&space_ref=" . $space['id']; + $body = ''; + if (!empty ($fileName)) { + $body = $this->getFileId($user, $spaceName, $fileName); + } else { + $space = $this->getSpaceByName($user, $spaceName); + $body = $space['id']; + } + + $url = "/apps/files_sharing/api/v1/shares?reshares=true&space_ref=" . $body; $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody( $user, From c271c9ab8093c51de6d03163e2780feb092ba02d Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Thu, 18 Aug 2022 09:24:42 +0000 Subject: [PATCH 061/103] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e2848f129..6e948bc783 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1430,7 +1430,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -1598,28 +1598,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -1788,6 +1771,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 771e7e8e345353fd7378cb232738c18e5f3ad502 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 18 Aug 2022 11:41:42 +0200 Subject: [PATCH 062/103] fix typo Co-authored-by: Benedikt Kulmann --- .../unreleased/enhancement-app-provider-language-selection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/enhancement-app-provider-language-selection.md b/changelog/unreleased/enhancement-app-provider-language-selection.md index 0a2dca3c3c..35fb7b8bef 100644 --- a/changelog/unreleased/enhancement-app-provider-language-selection.md +++ b/changelog/unreleased/enhancement-app-provider-language-selection.md @@ -1,6 +1,6 @@ Enhancement: Added language option to the app provider -We've added an language option to the app provider which will in the +We've added a language option to the app provider which will in the end be passed to the app a user opens so that the web ui is displayed in the users language. https://github.com/owncloud/ocis/pull/4399 From 034c57af08bbd511d6519267ecde70c610d30838 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 18 Aug 2022 09:49:46 +0000 Subject: [PATCH 063/103] Automated changelog update [skip ci] --- CHANGELOG.md | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e948bc783..10f35bcc85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The following sections list the changes for unreleased. * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) +* Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) * Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) @@ -35,6 +36,15 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4376 https://github.com/cs3org/reva/pull/3143 +* Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) + + We've added a language option to the app provider which will in the end be passed to the app a user + opens so that the web ui is displayed in the users language. + + https://github.com/owncloud/ocis/issues/4367 + https://github.com/owncloud/ocis/pull/4399 + https://github.com/cs3org/reva/pull/3156 + * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) The new command `ocis idm resetpassword` allows to reset the administrator password when ocis @@ -1430,7 +1440,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -1598,11 +1608,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -1771,23 +1798,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From d93fd7ab4d7fe9188c787dbf65e77c1648608cee Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 18 Aug 2022 11:55:19 +0200 Subject: [PATCH 064/103] fix configuration of mimetypes for the app registry --- .../unreleased/bugfix-app-registry-default-mimetypes.md | 8 ++++++++ ...pty-file => bugfix-idp-init-certificate-empty-file.md} | 0 .../app-registry/pkg/config/defaults/defaultconfig.go | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/bugfix-app-registry-default-mimetypes.md rename changelog/unreleased/{bugfix-idp-init-certificate-empty-file => bugfix-idp-init-certificate-empty-file.md} (100%) diff --git a/changelog/unreleased/bugfix-app-registry-default-mimetypes.md b/changelog/unreleased/bugfix-app-registry-default-mimetypes.md new file mode 100644 index 0000000000..4d51f87133 --- /dev/null +++ b/changelog/unreleased/bugfix-app-registry-default-mimetypes.md @@ -0,0 +1,8 @@ +Bugfix: Fix configuration of mimetypes for the app registry + +We've fixed the configuration option for mimetypes in the app registry. +Previously the default config would always be merged over the user provided +configuration. Now the default mimetype configuration is only used if the user does not +providy any mimetype configuration (like it is already done in the proxy with the routes configuration). + +https://github.com/owncloud/ocis/pull/4411 diff --git a/changelog/unreleased/bugfix-idp-init-certificate-empty-file b/changelog/unreleased/bugfix-idp-init-certificate-empty-file.md similarity index 100% rename from changelog/unreleased/bugfix-idp-init-certificate-empty-file rename to changelog/unreleased/bugfix-idp-init-certificate-empty-file.md diff --git a/services/app-registry/pkg/config/defaults/defaultconfig.go b/services/app-registry/pkg/config/defaults/defaultconfig.go index 4846146f98..c754f4e506 100644 --- a/services/app-registry/pkg/config/defaults/defaultconfig.go +++ b/services/app-registry/pkg/config/defaults/defaultconfig.go @@ -30,9 +30,6 @@ func DefaultConfig() *config.Config { Reva: &config.Reva{ Address: "127.0.0.1:9142", }, - AppRegistry: config.AppRegistry{ - MimeTypeConfig: defaultMimeTypeConfig(), - }, } } @@ -150,6 +147,9 @@ func EnsureDefaults(cfg *config.Config) { } +// Sanitize the config func Sanitize(cfg *config.Config) { - // nothing to sanitize here atm + if cfg.AppRegistry.MimeTypeConfig == nil { + cfg.AppRegistry.MimeTypeConfig = defaultMimeTypeConfig() + } } From a1ea39f645dc11d013ebc89390c5271ddc7e64a4 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Thu, 18 Aug 2022 13:26:03 +0200 Subject: [PATCH 065/103] bump reva version Signed-off-by: jkoberg --- changelog/unreleased/bump-reva.md | 5 +++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelog/unreleased/bump-reva.md diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md new file mode 100644 index 0000000000..dc839ad3ab --- /dev/null +++ b/changelog/unreleased/bump-reva.md @@ -0,0 +1,5 @@ +Enhancement: Bump reva version + +Bumps reva version + +https://github.com/owncloud/ocis/pull/4412 diff --git a/go.mod b/go.mod index 6d2350d953..170a342815 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 - github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620 + github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 61ac75368f..814b0b3bd2 100644 --- a/go.sum +++ b/go.sum @@ -291,8 +291,8 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 h1:cFnankJOCWndnOns4sKRG7yzH61ammK2Am6rEGWCK40= github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620 h1:OZc0njRbjujMofFuhF3DYpZ+0k29jZJ0S7Ft8A/0xQM= -github.com/cs3org/reva/v2 v2.7.5-0.20220817100552-b0f72d755620/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= +github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa h1:v7dsI1tidpyQ0oiElSc30NO9rNcgpvJuzLileslTN1s= +github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= From d1f0dbc4c928539fe0a97af8aeb224f5fafb8d22 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 18 Aug 2022 12:03:48 +0000 Subject: [PATCH 066/103] Automated changelog update [skip ci] --- CHANGELOG.md | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10f35bcc85..890f2b5743 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The following sections list the changes for unreleased. ## Summary * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) +* Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) @@ -22,6 +23,13 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4394 +* Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) + + We've already renamed extensions to services in previous PRs and this PR peforms this rename + for leftover occurences. + + https://github.com/owncloud/ocis/pull/4407 + * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) We've renamed the storage-users service's "uploads purge" command to "upload clean". @@ -1440,7 +1448,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -1608,28 +1616,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -1798,6 +1789,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 5a51a24bbd36ad5b998130752106e52953aba54e Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 18 Aug 2022 14:08:47 +0200 Subject: [PATCH 067/103] fix url in open-with-web documentation --- docs/services/app-registry/apps.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/services/app-registry/apps.md b/docs/services/app-registry/apps.md index 457e2294fb..a6185c6714 100644 --- a/docs/services/app-registry/apps.md +++ b/docs/services/app-registry/apps.md @@ -200,9 +200,9 @@ HTTP status code: 200 **Request examples**: ```bash -curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=' +curl -X POST 'https://ocis.test/app/open-with-web?file_id=ZmlsZTppZAo=' -curl -X POST 'https://ocis.test/app/open?file_id=ZmlsZTppZAo=&app_name=Collabora' +curl -X POST 'https://ocis.test/app/open-with-web?file_id=ZmlsZTppZAo=&app_name=Collabora' ``` **Response examples**: From e58eaabdeb1bb89575efe2a65c0bdb00b0cc9f8f Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:57:27 +0000 Subject: [PATCH 068/103] move config parse error logging into function to ensure new lines and don't parse config for help --- .../unreleased/bugfix-help-config-newline.md | 6 +++ ocis-pkg/config/configlog/log.go | 30 +++++++++++++++ ocis/pkg/command/app-provider.go | 7 +--- ocis/pkg/command/app-registry.go | 7 +--- ocis/pkg/command/audit.go | 7 +--- ocis/pkg/command/auth-basic.go | 7 +--- ocis/pkg/command/auth-bearer.go | 7 +--- ocis/pkg/command/auth-machine.go | 7 +--- ocis/pkg/command/frontend.go | 7 +--- ocis/pkg/command/gateway.go | 7 +--- ocis/pkg/command/graph-explorer.go | 7 +--- ocis/pkg/command/graph.go | 7 +--- ocis/pkg/command/groups.go | 7 +--- ocis/pkg/command/idm.go | 7 +--- ocis/pkg/command/idp.go | 7 +--- ocis/pkg/command/migrate.go | 37 +++++++++++-------- ocis/pkg/command/nats.go | 7 +--- ocis/pkg/command/notifications.go | 7 +--- ocis/pkg/command/ocdav.go | 7 +--- ocis/pkg/command/ocs.go | 7 +--- ocis/pkg/command/proxy.go | 7 +--- ocis/pkg/command/search.go | 7 +--- ocis/pkg/command/server.go | 9 +---- ocis/pkg/command/settings.go | 7 +--- ocis/pkg/command/sharing.go | 7 +--- ocis/pkg/command/storage-publiclink.go | 7 +--- ocis/pkg/command/storage-shares.go | 7 +--- ocis/pkg/command/storage-system.go | 7 +--- ocis/pkg/command/storage-users.go | 7 +--- ocis/pkg/command/store.go | 7 +--- ocis/pkg/command/thumbnails.go | 7 +--- ocis/pkg/command/users.go | 7 +--- ocis/pkg/command/web.go | 7 +--- ocis/pkg/command/webdav.go | 7 +--- services/app-provider/pkg/command/health.go | 7 +--- services/app-provider/pkg/command/server.go | 8 +--- services/app-registry/pkg/command/health.go | 7 +--- services/app-registry/pkg/command/server.go | 8 +--- services/audit/pkg/command/server.go | 9 +---- services/auth-basic/pkg/command/health.go | 7 +--- services/auth-basic/pkg/command/server.go | 8 +--- services/auth-bearer/pkg/command/health.go | 7 +--- services/auth-bearer/pkg/command/server.go | 8 +--- services/auth-machine/pkg/command/health.go | 7 +--- services/auth-machine/pkg/command/server.go | 8 +--- services/frontend/pkg/command/health.go | 7 +--- services/frontend/pkg/command/server.go | 8 +--- services/gateway/pkg/command/health.go | 7 +--- services/gateway/pkg/command/server.go | 8 +--- services/graph-explorer/pkg/command/health.go | 7 +--- services/graph-explorer/pkg/command/server.go | 9 +---- services/graph/pkg/command/health.go | 7 +--- services/graph/pkg/command/server.go | 9 +---- services/groups/pkg/command/health.go | 7 +--- services/groups/pkg/command/server.go | 8 +--- services/idm/pkg/command/health.go | 7 +--- services/idm/pkg/command/resetpw.go | 10 ++--- services/idm/pkg/command/server.go | 8 +--- services/idp/pkg/command/health.go | 7 +--- services/idp/pkg/command/server.go | 9 ++--- services/nats/pkg/command/server.go | 9 +---- services/notifications/pkg/command/server.go | 9 +---- services/ocdav/pkg/command/health.go | 7 +--- services/ocdav/pkg/command/server.go | 9 +---- services/ocs/pkg/command/health.go | 7 +--- services/ocs/pkg/command/server.go | 9 +---- services/proxy/pkg/command/health.go | 7 +--- services/proxy/pkg/command/server.go | 9 +---- services/search/pkg/command/server.go | 9 +---- services/settings/pkg/command/health.go | 7 +--- services/settings/pkg/command/server.go | 9 +---- services/sharing/pkg/command/health.go | 7 +--- services/sharing/pkg/command/server.go | 8 +--- .../storage-publiclink/pkg/command/health.go | 7 +--- .../storage-publiclink/pkg/command/server.go | 8 +--- services/storage-shares/pkg/command/health.go | 7 +--- services/storage-shares/pkg/command/server.go | 8 +--- services/storage-system/pkg/command/health.go | 7 +--- services/storage-system/pkg/command/server.go | 8 +--- services/storage-users/pkg/command/health.go | 7 +--- services/storage-users/pkg/command/server.go | 8 +--- services/storage-users/pkg/command/uploads.go | 28 +++----------- services/store/pkg/command/health.go | 7 +--- services/store/pkg/command/server.go | 9 +---- services/thumbnails/pkg/command/health.go | 7 +--- services/thumbnails/pkg/command/server.go | 9 +---- services/users/pkg/command/health.go | 7 +--- services/users/pkg/command/server.go | 8 +--- services/web/pkg/command/health.go | 7 +--- services/web/pkg/command/server.go | 9 +---- services/webdav/pkg/command/health.go | 7 +--- services/webdav/pkg/command/server.go | 9 +---- 92 files changed, 241 insertions(+), 526 deletions(-) create mode 100644 changelog/unreleased/bugfix-help-config-newline.md create mode 100644 ocis-pkg/config/configlog/log.go diff --git a/changelog/unreleased/bugfix-help-config-newline.md b/changelog/unreleased/bugfix-help-config-newline.md new file mode 100644 index 0000000000..1470de3e56 --- /dev/null +++ b/changelog/unreleased/bugfix-help-config-newline.md @@ -0,0 +1,6 @@ +Bugfix: Show help for some commands when unconfigured + +We've fixed some commands to show the help also when oCIS is not yet configured. +Previously the help was not displayed to the user but instead a configuration validation error. + +https://github.com/owncloud/ocis/pull/4405 diff --git a/ocis-pkg/config/configlog/log.go b/ocis-pkg/config/configlog/log.go new file mode 100644 index 0000000000..c5ff40d04e --- /dev/null +++ b/ocis-pkg/config/configlog/log.go @@ -0,0 +1,30 @@ +package configlog + +import ( + "fmt" + "os" +) + +// LogError logs the error +func LogError(err error) { + if err != nil { + fmt.Printf("%v\n", err) + } +} + +// LogError logs the error and returns it unchanged +func LogReturnError(err error) error { + if err != nil { + fmt.Printf("%v\n", err) + } + return err +} + +// LogReturnFatal logs the error and calls os.Exit(1) and returns nil if no error is passed +func LogReturnFatal(err error) error { + if err != nil { + fmt.Printf("%v\n", err) + os.Exit(1) + } + return nil +} diff --git a/ocis/pkg/command/app-provider.go b/ocis/pkg/command/app-provider.go index 89120bd57f..74cdbecd48 100644 --- a/ocis/pkg/command/app-provider.go +++ b/ocis/pkg/command/app-provider.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AppProviderCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AppProvider.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AppProvider.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/app-registry.go b/ocis/pkg/command/app-registry.go index b16df293a8..d39e08201d 100644 --- a/ocis/pkg/command/app-registry.go +++ b/ocis/pkg/command/app-registry.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AppRegistryCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AppRegistry.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AppRegistry.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/audit.go b/ocis/pkg/command/audit.go index 58b4d4e0a6..ffc8b335eb 100644 --- a/ocis/pkg/command/audit.go +++ b/ocis/pkg/command/audit.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AuditCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Audit.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Audit.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-basic.go b/ocis/pkg/command/auth-basic.go index 3a850faa67..8503851d3b 100644 --- a/ocis/pkg/command/auth-basic.go +++ b/ocis/pkg/command/auth-basic.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AuthBasicCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthBasic.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AuthBasic.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-bearer.go b/ocis/pkg/command/auth-bearer.go index be1e360503..213146f212 100644 --- a/ocis/pkg/command/auth-bearer.go +++ b/ocis/pkg/command/auth-bearer.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AuthBearerCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthBearer.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AuthBearer.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-machine.go b/ocis/pkg/command/auth-machine.go index 336823efab..4561203c08 100644 --- a/ocis/pkg/command/auth-machine.go +++ b/ocis/pkg/command/auth-machine.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func AuthMachineCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthMachine.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.AuthMachine.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/frontend.go b/ocis/pkg/command/frontend.go index 741e96cdce..0ca6a4c6be 100644 --- a/ocis/pkg/command/frontend.go +++ b/ocis/pkg/command/frontend.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func FrontendCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Frontend.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Frontend.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/gateway.go b/ocis/pkg/command/gateway.go index b771d3c9e9..1107587c37 100644 --- a/ocis/pkg/command/gateway.go +++ b/ocis/pkg/command/gateway.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func GatewayCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Gateway.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Gateway.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/graph-explorer.go b/ocis/pkg/command/graph-explorer.go index 4c54deec1e..4d295fd825 100644 --- a/ocis/pkg/command/graph-explorer.go +++ b/ocis/pkg/command/graph-explorer.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func GraphExplorerCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.GraphExplorer.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.GraphExplorer.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/graph.go b/ocis/pkg/command/graph.go index ce0acc33e6..6efc8179d2 100644 --- a/ocis/pkg/command/graph.go +++ b/ocis/pkg/command/graph.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func GraphCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Graph.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Graph.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/groups.go b/ocis/pkg/command/groups.go index 5039434894..edaffd9824 100644 --- a/ocis/pkg/command/groups.go +++ b/ocis/pkg/command/groups.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func GroupsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Groups.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Groups.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/idm.go b/ocis/pkg/command/idm.go index 21862ade96..d1e100a056 100644 --- a/ocis/pkg/command/idm.go +++ b/ocis/pkg/command/idm.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func IDMCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.IDM.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.IDM.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/idp.go b/ocis/pkg/command/idp.go index 6b798bf438..b932f2465d 100644 --- a/ocis/pkg/command/idp.go +++ b/ocis/pkg/command/idp.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func IDPCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.IDP.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.IDP.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/migrate.go b/ocis/pkg/command/migrate.go index 3f18b96ece..fa020a1afb 100644 --- a/ocis/pkg/command/migrate.go +++ b/ocis/pkg/command/migrate.go @@ -2,7 +2,6 @@ package command import ( "context" - "fmt" "os" "sync" @@ -13,6 +12,7 @@ import ( "github.com/cs3org/reva/v2/pkg/share/manager/registry" "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/register" sharing "github.com/owncloud/ocis/v2/services/sharing/pkg/config" @@ -27,21 +27,6 @@ func Migrate(cfg *config.Config) *cli.Command { Name: "migrate", Usage: "migrate data from an existing to another instance", Category: "migration", - Before: func(c *cli.Context) error { - // Parse base config - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - return err - } - - // Parse sharing config - cfg.Sharing.Commons = cfg.Commons - if err := sharingparser.ParseConfig(cfg.Sharing); err != nil { - fmt.Printf("%v", err) - return err - } - return nil - }, Subcommands: []*cli.Command{ MigrateShares(cfg), MigratePublicShares(cfg), @@ -69,6 +54,16 @@ func MigrateShares(cfg *config.Config) *cli.Command { Usage: "Share manager to import the data into", }, }, + Before: func(c *cli.Context) error { + // Parse base config + if err := parser.ParseConfig(cfg, true); err != nil { + return configlog.LogReturnError(err) + } + + // Parse sharing config + cfg.Sharing.Commons = cfg.Commons + return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing)) + }, Action: func(c *cli.Context) error { log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger() ctx := log.WithContext(context.Background()) @@ -154,6 +149,16 @@ func MigratePublicShares(cfg *config.Config) *cli.Command { Usage: "Public share manager to import the data into", }, }, + Before: func(c *cli.Context) error { + // Parse base config + if err := parser.ParseConfig(cfg, true); err != nil { + return configlog.LogReturnError(err) + } + + // Parse sharing config + cfg.Sharing.Commons = cfg.Commons + return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing)) + }, Action: func(c *cli.Context) error { log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger() ctx := log.WithContext(context.Background()) diff --git a/ocis/pkg/command/nats.go b/ocis/pkg/command/nats.go index e8c60061ed..a7ec22ad64 100644 --- a/ocis/pkg/command/nats.go +++ b/ocis/pkg/command/nats.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func NatsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Nats.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Nats.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/notifications.go b/ocis/pkg/command/notifications.go index 0599dc86e8..1bdea39f23 100644 --- a/ocis/pkg/command/notifications.go +++ b/ocis/pkg/command/notifications.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func NotificationsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Notifications.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Notifications.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/ocdav.go b/ocis/pkg/command/ocdav.go index cc04d64884..f48683a44e 100644 --- a/ocis/pkg/command/ocdav.go +++ b/ocis/pkg/command/ocdav.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func OCDavCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.OCDav.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.OCDav.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/ocs.go b/ocis/pkg/command/ocs.go index abeb8310bd..1c27e1cddc 100644 --- a/ocis/pkg/command/ocs.go +++ b/ocis/pkg/command/ocs.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func OCSCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.OCS.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.OCS.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/proxy.go b/ocis/pkg/command/proxy.go index 127957bc69..7e1204248b 100644 --- a/ocis/pkg/command/proxy.go +++ b/ocis/pkg/command/proxy.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func ProxyCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Proxy.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Proxy.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/search.go b/ocis/pkg/command/search.go index c649fbce41..050b8b4300 100644 --- a/ocis/pkg/command/search.go +++ b/ocis/pkg/command/search.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func SearchCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Search.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Search.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/server.go b/ocis/pkg/command/server.go index c935aba9f1..685d55ebf5 100644 --- a/ocis/pkg/command/server.go +++ b/ocis/pkg/command/server.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/register" "github.com/owncloud/ocis/v2/ocis/pkg/runtime" @@ -17,11 +16,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: "start a fullstack server (runtime and all services in supervised mode)", Category: "fullstack", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, false); err != nil { - fmt.Printf("%v", err) - return err - } - return nil + return configlog.LogReturnError(parser.ParseConfig(cfg, false)) }, Action: func(c *cli.Context) error { r := runtime.New(cfg) diff --git a/ocis/pkg/command/settings.go b/ocis/pkg/command/settings.go index ec95cf3a17..c9609b10ef 100644 --- a/ocis/pkg/command/settings.go +++ b/ocis/pkg/command/settings.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func SettingsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Settings.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Settings.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/sharing.go b/ocis/pkg/command/sharing.go index 9145f532c5..1df0e15303 100644 --- a/ocis/pkg/command/sharing.go +++ b/ocis/pkg/command/sharing.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func SharingCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Sharing.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Sharing.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-publiclink.go b/ocis/pkg/command/storage-publiclink.go index 04780870c5..4d91368c64 100644 --- a/ocis/pkg/command/storage-publiclink.go +++ b/ocis/pkg/command/storage-publiclink.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func StoragePublicLinkCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StoragePublicLink.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.StoragePublicLink.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-shares.go b/ocis/pkg/command/storage-shares.go index e499e008f6..744b20c12d 100644 --- a/ocis/pkg/command/storage-shares.go +++ b/ocis/pkg/command/storage-shares.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func StorageSharesCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageShares.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.StorageShares.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-system.go b/ocis/pkg/command/storage-system.go index e90af46907..ed790b6c43 100644 --- a/ocis/pkg/command/storage-system.go +++ b/ocis/pkg/command/storage-system.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func StorageSystemCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageSystem.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.StorageSystem.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-users.go b/ocis/pkg/command/storage-users.go index f1598332bb..c3745a8429 100644 --- a/ocis/pkg/command/storage-users.go +++ b/ocis/pkg/command/storage-users.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func StorageUsersCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageUsers.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.StorageUsers.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/store.go b/ocis/pkg/command/store.go index 617af037cd..8dcc455f49 100644 --- a/ocis/pkg/command/store.go +++ b/ocis/pkg/command/store.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -19,9 +18,7 @@ func StoreCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Store.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Store.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/thumbnails.go b/ocis/pkg/command/thumbnails.go index da60a12a18..682020c7b9 100644 --- a/ocis/pkg/command/thumbnails.go +++ b/ocis/pkg/command/thumbnails.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func ThumbnailsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Thumbnails.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Thumbnails.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/users.go b/ocis/pkg/command/users.go index 992a049285..97b7e30be3 100644 --- a/ocis/pkg/command/users.go +++ b/ocis/pkg/command/users.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func UsersCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Users.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Users.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/web.go b/ocis/pkg/command/web.go index dd826d6b99..983134f1f7 100644 --- a/ocis/pkg/command/web.go +++ b/ocis/pkg/command/web.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -18,9 +17,7 @@ func WebCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Web.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.Web.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/webdav.go b/ocis/pkg/command/webdav.go index 20be56b5b0..ea9e42531b 100644 --- a/ocis/pkg/command/webdav.go +++ b/ocis/pkg/command/webdav.go @@ -1,9 +1,8 @@ package command import ( - "fmt" - "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/config/parser" "github.com/owncloud/ocis/v2/ocis/pkg/command/helper" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -19,9 +18,7 @@ func WebDAVCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.WebDAV.Service.Name), Category: "services", Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg, true); err != nil { - fmt.Printf("%v", err) - } + configlog.LogError(parser.ParseConfig(cfg, true)) cfg.WebDAV.Commons = cfg.Commons return nil }, diff --git a/services/app-provider/pkg/command/health.go b/services/app-provider/pkg/command/health.go index 9344b8a9ac..684c2ce42b 100644 --- a/services/app-provider/pkg/command/health.go +++ b/services/app-provider/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/app-provider/pkg/config" "github.com/owncloud/ocis/v2/services/app-provider/pkg/config/parser" "github.com/owncloud/ocis/v2/services/app-provider/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index 9f4e940f7f..eb399c5782 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-registry/pkg/command/health.go b/services/app-registry/pkg/command/health.go index d1227a0544..f9b6737f18 100644 --- a/services/app-registry/pkg/command/health.go +++ b/services/app-registry/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/app-registry/pkg/config" "github.com/owncloud/ocis/v2/services/app-registry/pkg/config/parser" "github.com/owncloud/ocis/v2/services/app-registry/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-registry/pkg/command/server.go b/services/app-registry/pkg/command/server.go index f104d405ab..7339ebd3eb 100644 --- a/services/app-registry/pkg/command/server.go +++ b/services/app-registry/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/app-registry/pkg/config" @@ -27,12 +28,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/audit/pkg/command/server.go b/services/audit/pkg/command/server.go index 8942312894..a3f0121d31 100644 --- a/services/audit/pkg/command/server.go +++ b/services/audit/pkg/command/server.go @@ -3,11 +3,11 @@ package command import ( "context" "fmt" - "os" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/events/server" "github.com/go-micro/plugins/v4/events/natsjs" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/audit/pkg/config" "github.com/owncloud/ocis/v2/services/audit/pkg/config/parser" "github.com/owncloud/ocis/v2/services/audit/pkg/logging" @@ -23,12 +23,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-basic/pkg/command/health.go b/services/auth-basic/pkg/command/health.go index 48f07427d8..357139e603 100644 --- a/services/auth-basic/pkg/command/health.go +++ b/services/auth-basic/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/auth-basic/pkg/config" "github.com/owncloud/ocis/v2/services/auth-basic/pkg/config/parser" "github.com/owncloud/ocis/v2/services/auth-basic/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index 59fd65cef9..908883fca4 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-bearer/pkg/command/health.go b/services/auth-bearer/pkg/command/health.go index 040e695b26..59c619b49e 100644 --- a/services/auth-bearer/pkg/command/health.go +++ b/services/auth-bearer/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/config" "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/config/parser" "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index d43f0dc1e9..d923a0e4ce 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-machine/pkg/command/health.go b/services/auth-machine/pkg/command/health.go index cc26ea7f29..252bca77ca 100644 --- a/services/auth-machine/pkg/command/health.go +++ b/services/auth-machine/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/auth-machine/pkg/config" "github.com/owncloud/ocis/v2/services/auth-machine/pkg/config/parser" "github.com/owncloud/ocis/v2/services/auth-machine/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index 1818693728..31e3572af9 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/frontend/pkg/command/health.go b/services/frontend/pkg/command/health.go index 1585868261..4feeb3d6d2 100644 --- a/services/frontend/pkg/command/health.go +++ b/services/frontend/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/frontend/pkg/config" "github.com/owncloud/ocis/v2/services/frontend/pkg/config/parser" "github.com/owncloud/ocis/v2/services/frontend/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index b5309344e1..8ac2492212 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/gateway/pkg/command/health.go b/services/gateway/pkg/command/health.go index 1dd8229b69..54ca2717ac 100644 --- a/services/gateway/pkg/command/health.go +++ b/services/gateway/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/gateway/pkg/config" "github.com/owncloud/ocis/v2/services/gateway/pkg/config/parser" "github.com/owncloud/ocis/v2/services/gateway/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/gateway/pkg/command/server.go b/services/gateway/pkg/command/server.go index b24d05b9db..18202cf136 100644 --- a/services/gateway/pkg/command/server.go +++ b/services/gateway/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/gateway/pkg/config" @@ -27,12 +28,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph-explorer/pkg/command/health.go b/services/graph-explorer/pkg/command/health.go index b83a33c820..07547d98b2 100644 --- a/services/graph-explorer/pkg/command/health.go +++ b/services/graph-explorer/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config/parser" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph-explorer/pkg/command/server.go b/services/graph-explorer/pkg/command/server.go index 01a7a58e40..564739a539 100644 --- a/services/graph-explorer/pkg/command/server.go +++ b/services/graph-explorer/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config" "github.com/owncloud/ocis/v2/services/graph-explorer/pkg/config/parser" @@ -24,12 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(ctx *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph/pkg/command/health.go b/services/graph/pkg/command/health.go index e1cbbbd641..788ef9feb7 100644 --- a/services/graph/pkg/command/health.go +++ b/services/graph/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/graph/pkg/config" "github.com/owncloud/ocis/v2/services/graph/pkg/config/parser" "github.com/owncloud/ocis/v2/services/graph/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index 636ff4544f..4ad0faa3bf 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/graph/pkg/config" "github.com/owncloud/ocis/v2/services/graph/pkg/config/parser" @@ -24,12 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/groups/pkg/command/health.go b/services/groups/pkg/command/health.go index 9925b7ce68..e0a87a0806 100644 --- a/services/groups/pkg/command/health.go +++ b/services/groups/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/groups/pkg/config" "github.com/owncloud/ocis/v2/services/groups/pkg/config/parser" "github.com/owncloud/ocis/v2/services/groups/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index e6883793e7..7652d2213f 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/health.go b/services/idm/pkg/command/health.go index 1b7d5a4841..1abac500cf 100644 --- a/services/idm/pkg/command/health.go +++ b/services/idm/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/idm/pkg/config" "github.com/owncloud/ocis/v2/services/idm/pkg/config/parser" "github.com/owncloud/ocis/v2/services/idm/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/resetpw.go b/services/idm/pkg/command/resetpw.go index 7fd5c52eba..a98b39946f 100644 --- a/services/idm/pkg/command/resetpw.go +++ b/services/idm/pkg/command/resetpw.go @@ -11,6 +11,7 @@ import ( "github.com/go-ldap/ldap/v3" "github.com/libregraph/idm/pkg/ldbbolt" "github.com/libregraph/idm/server" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/services/idm/pkg/config" "github.com/owncloud/ocis/v2/services/idm/pkg/config/parser" @@ -24,15 +25,10 @@ import ( func ResetPassword(cfg *config.Config) *cli.Command { return &cli.Command{ Name: "resetpassword", - Usage: fmt.Sprintf("Reset admin password"), + Usage: "Reset admin password", Category: "password reset", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index 92a30f7baf..2e0e96d2d8 100644 --- a/services/idm/pkg/command/server.go +++ b/services/idm/pkg/command/server.go @@ -13,6 +13,7 @@ import ( "github.com/libregraph/idm/pkg/ldappassword" "github.com/libregraph/idm/pkg/ldbbolt" "github.com/libregraph/idm/server" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" pkgcrypto "github.com/owncloud/ocis/v2/ocis-pkg/crypto" "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/services/idm" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idp/pkg/command/health.go b/services/idp/pkg/command/health.go index 687d806fe5..108af9d289 100644 --- a/services/idp/pkg/command/health.go +++ b/services/idp/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/idp/pkg/config" "github.com/owncloud/ocis/v2/services/idp/pkg/config/parser" "github.com/owncloud/ocis/v2/services/idp/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index 70bc123d7d..c6a265868c 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -15,6 +15,7 @@ import ( "path/filepath" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/idp/pkg/config" "github.com/owncloud/ocis/v2/services/idp/pkg/config/parser" @@ -35,11 +36,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } + configlog.LogReturnFatal(parser.ParseConfig(cfg)) if cfg.IDP.EncryptionSecretFile != "" { if err := ensureEncryptionSecretExists(cfg.IDP.EncryptionSecretFile); err != nil { @@ -49,7 +46,7 @@ func Server(cfg *config.Config) *cli.Command { return err } } - return err + return nil }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index abb3ec7d0c..1cee11ebbd 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -3,10 +3,10 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/nats/pkg/config" "github.com/owncloud/ocis/v2/services/nats/pkg/config/parser" "github.com/owncloud/ocis/v2/services/nats/pkg/logging" @@ -21,12 +21,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/notifications/pkg/command/server.go b/services/notifications/pkg/command/server.go index 9071bee148..12f5ee5431 100644 --- a/services/notifications/pkg/command/server.go +++ b/services/notifications/pkg/command/server.go @@ -2,11 +2,11 @@ package command import ( "fmt" - "os" "github.com/cs3org/reva/v2/pkg/events" "github.com/cs3org/reva/v2/pkg/events/server" "github.com/go-micro/plugins/v4/events/natsjs" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/notifications/pkg/channels" "github.com/owncloud/ocis/v2/services/notifications/pkg/config" "github.com/owncloud/ocis/v2/services/notifications/pkg/config/parser" @@ -22,12 +22,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocdav/pkg/command/health.go b/services/ocdav/pkg/command/health.go index 8724a43adb..5bee1653e2 100644 --- a/services/ocdav/pkg/command/health.go +++ b/services/ocdav/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/ocdav/pkg/config" "github.com/owncloud/ocis/v2/services/ocdav/pkg/config/parser" "github.com/owncloud/ocis/v2/services/ocdav/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index 19d4a351c4..1474cd9bc6 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -3,10 +3,10 @@ package command import ( "context" "fmt" - "os" "github.com/cs3org/reva/v2/pkg/micro/ocdav" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/ocdav/pkg/config" "github.com/owncloud/ocis/v2/services/ocdav/pkg/config/parser" @@ -23,12 +23,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocs/pkg/command/health.go b/services/ocs/pkg/command/health.go index 197c2e1ca8..dfa9f07779 100644 --- a/services/ocs/pkg/command/health.go +++ b/services/ocs/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/ocs/pkg/config" "github.com/owncloud/ocis/v2/services/ocs/pkg/config/parser" "github.com/owncloud/ocis/v2/services/ocs/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocs/pkg/command/server.go b/services/ocs/pkg/command/server.go index 04b3701c4d..507951fb5c 100644 --- a/services/ocs/pkg/command/server.go +++ b/services/ocs/pkg/command/server.go @@ -3,8 +3,8 @@ package command import ( "context" "fmt" - "os" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/ocs/pkg/config/parser" "github.com/owncloud/ocis/v2/services/ocs/pkg/logging" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/proxy/pkg/command/health.go b/services/proxy/pkg/command/health.go index cb9ee814bf..2646f53c6a 100644 --- a/services/proxy/pkg/command/health.go +++ b/services/proxy/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/proxy/pkg/config" "github.com/owncloud/ocis/v2/services/proxy/pkg/config/parser" "github.com/owncloud/ocis/v2/services/proxy/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 16cb959d43..e5ebcaac84 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -5,7 +5,6 @@ import ( "crypto/tls" "fmt" "net/http" - "os" "time" "github.com/coreos/go-oidc/v3/oidc" @@ -13,6 +12,7 @@ import ( chimiddleware "github.com/go-chi/chi/v5/middleware" "github.com/justinas/alice" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/log" pkgmiddleware "github.com/owncloud/ocis/v2/ocis-pkg/middleware" "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" @@ -41,12 +41,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/search/pkg/command/server.go b/services/search/pkg/command/server.go index 3faf1e061c..0e0dcd0570 100644 --- a/services/search/pkg/command/server.go +++ b/services/search/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/search/pkg/config" "github.com/owncloud/ocis/v2/services/search/pkg/config/parser" @@ -24,12 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/settings/pkg/command/health.go b/services/settings/pkg/command/health.go index 68dee3672a..fc126cad14 100644 --- a/services/settings/pkg/command/health.go +++ b/services/settings/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/settings/pkg/config" "github.com/owncloud/ocis/v2/services/settings/pkg/config/parser" "github.com/owncloud/ocis/v2/services/settings/pkg/logging" @@ -16,11 +17,7 @@ func Health(cfg *config.Config) *cli.Command { Name: "health", Usage: "Check health status", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/settings/pkg/command/server.go b/services/settings/pkg/command/server.go index 4dd9b9a40b..101f070ee7 100644 --- a/services/settings/pkg/command/server.go +++ b/services/settings/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/settings/pkg/config" "github.com/owncloud/ocis/v2/services/settings/pkg/config/parser" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/sharing/pkg/command/health.go b/services/sharing/pkg/command/health.go index 1c2bb37ed4..00a34e5fcb 100644 --- a/services/sharing/pkg/command/health.go +++ b/services/sharing/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/sharing/pkg/config" "github.com/owncloud/ocis/v2/services/sharing/pkg/config/parser" "github.com/owncloud/ocis/v2/services/sharing/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index a690f6d23b..00c675fa1d 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -10,6 +10,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-publiclink/pkg/command/health.go b/services/storage-publiclink/pkg/command/health.go index b2f3889f50..70a392baf8 100644 --- a/services/storage-publiclink/pkg/command/health.go +++ b/services/storage-publiclink/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/config" "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index 80ebfaff2a..257c78d8b5 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-shares/pkg/command/health.go b/services/storage-shares/pkg/command/health.go index 90e68c8ba1..f607aae7b6 100644 --- a/services/storage-shares/pkg/command/health.go +++ b/services/storage-shares/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-shares/pkg/config" "github.com/owncloud/ocis/v2/services/storage-shares/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-shares/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index 7a4c208c66..8cd42e99c6 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-system/pkg/command/health.go b/services/storage-system/pkg/command/health.go index 8b5d5e116a..dcef0c624c 100644 --- a/services/storage-system/pkg/command/health.go +++ b/services/storage-system/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-system/pkg/config" "github.com/owncloud/ocis/v2/services/storage-system/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-system/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index a9257b9858..aba0df8e68 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/health.go b/services/storage-users/pkg/command/health.go index 9dcb45556a..3c92b63bd5 100644 --- a/services/storage-users/pkg/command/health.go +++ b/services/storage-users/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-users/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index caf1de68f2..f7b3f68501 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/version" @@ -28,12 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index ea553de013..90568c97b0 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -12,6 +12,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage" "github.com/cs3org/reva/v2/pkg/storage/fs/registry" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config/parser" "github.com/owncloud/ocis/v2/services/storage-users/pkg/revaconfig" @@ -19,16 +20,9 @@ import ( func Uploads(cfg *config.Config) *cli.Command { return &cli.Command{ - Name: "uploads", - Usage: "manage unfinished uploads", - Category: "maintenance", - Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg); err != nil { - fmt.Printf("%v", err) - return err - } - return nil - }, + + Name: "uploads", + Usage: "manage unfinished uploads", Subcommands: []*cli.Command{ ListUploads(cfg), PurgeExpiredUploads(cfg), @@ -42,12 +36,7 @@ func ListUploads(cfg *config.Config) *cli.Command { Name: "list", Usage: "Print a list of all incomplete uploads", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] @@ -88,12 +77,7 @@ func PurgeExpiredUploads(cfg *config.Config) *cli.Command { Name: "clean", Usage: "Clean up leftovers from expired uploads", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] diff --git a/services/store/pkg/command/health.go b/services/store/pkg/command/health.go index e08ec2c782..7ec9a7b1fe 100644 --- a/services/store/pkg/command/health.go +++ b/services/store/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/store/pkg/config" "github.com/owncloud/ocis/v2/services/store/pkg/config/parser" "github.com/owncloud/ocis/v2/services/store/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/store/pkg/command/server.go b/services/store/pkg/command/server.go index c548b786da..e472e5d815 100644 --- a/services/store/pkg/command/server.go +++ b/services/store/pkg/command/server.go @@ -3,10 +3,10 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/store/pkg/config" "github.com/owncloud/ocis/v2/services/store/pkg/config/parser" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/thumbnails/pkg/command/health.go b/services/thumbnails/pkg/command/health.go index d8e1210b01..341b156f66 100644 --- a/services/thumbnails/pkg/command/health.go +++ b/services/thumbnails/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config/parser" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/thumbnails/pkg/command/server.go b/services/thumbnails/pkg/command/server.go index 404a9815c9..ebe72e8e87 100644 --- a/services/thumbnails/pkg/command/server.go +++ b/services/thumbnails/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config" "github.com/owncloud/ocis/v2/services/thumbnails/pkg/config/parser" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/users/pkg/command/health.go b/services/users/pkg/command/health.go index 729dcf4d09..13841bde09 100644 --- a/services/users/pkg/command/health.go +++ b/services/users/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/users/pkg/config" "github.com/owncloud/ocis/v2/services/users/pkg/config/parser" "github.com/owncloud/ocis/v2/services/users/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index 2fc836d364..008200215a 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -9,6 +9,7 @@ import ( "github.com/cs3org/reva/v2/cmd/revad/runtime" "github.com/gofrs/uuid" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/service/external" "github.com/owncloud/ocis/v2/ocis-pkg/sync" @@ -29,12 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/web/pkg/command/health.go b/services/web/pkg/command/health.go index 633067f856..157e8b434b 100644 --- a/services/web/pkg/command/health.go +++ b/services/web/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/web/pkg/config" "github.com/owncloud/ocis/v2/services/web/pkg/config/parser" "github.com/owncloud/ocis/v2/services/web/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/web/pkg/command/server.go b/services/web/pkg/command/server.go index 247e249631..083074bcc2 100644 --- a/services/web/pkg/command/server.go +++ b/services/web/pkg/command/server.go @@ -5,9 +5,9 @@ import ( "encoding/json" "fmt" "io/ioutil" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/web/pkg/config" "github.com/owncloud/ocis/v2/services/web/pkg/config/parser" "github.com/owncloud/ocis/v2/services/web/pkg/logging" @@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/webdav/pkg/command/health.go b/services/webdav/pkg/command/health.go index e0bc1d5d28..edfec5d6d8 100644 --- a/services/webdav/pkg/command/health.go +++ b/services/webdav/pkg/command/health.go @@ -4,6 +4,7 @@ import ( "fmt" "net/http" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/services/webdav/pkg/config" "github.com/owncloud/ocis/v2/services/webdav/pkg/config/parser" "github.com/owncloud/ocis/v2/services/webdav/pkg/logging" @@ -17,11 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - } - return err + return configlog.LogReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index 4b2290ae16..4c505c5c44 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -3,9 +3,9 @@ package command import ( "context" "fmt" - "os" "github.com/oklog/run" + "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/webdav/pkg/config" "github.com/owncloud/ocis/v2/services/webdav/pkg/config/parser" @@ -24,12 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - err := parser.ParseConfig(cfg) - if err != nil { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.LogReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) From 3df8218067f2016bc00f66e39b967f2bba949d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 19 Aug 2022 07:51:02 +0000 Subject: [PATCH 069/103] bump reva to b272f45c35aa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 170a342815..96e95bcda0 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 - github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa + github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 814b0b3bd2..86599db2d3 100644 --- a/go.sum +++ b/go.sum @@ -293,6 +293,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 h1:cFnankJOCWndn github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa h1:v7dsI1tidpyQ0oiElSc30NO9rNcgpvJuzLileslTN1s= github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= +github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 h1:+VZ5D5rIfT7DHVntyQfr4MNV+vqBixbI/dOAG6MQSaQ= +github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= From ba9f5e42b0eb44fd28384a0d0f8e3c8fdf55ac81 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Fri, 19 Aug 2022 16:17:08 +0545 Subject: [PATCH 070/103] ping selenium to 104.0-20220812 --- .drone.star | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.star b/.drone.star index 1ac30b7352..95fe42377f 100644 --- a/.drone.star +++ b/.drone.star @@ -33,7 +33,7 @@ PLUGINS_S3 = "plugins/s3:latest" PLUGINS_S3_CACHE = "plugins/s3-cache:1" PLUGINS_SLACK = "plugins/slack:1" REDIS = "redis:6-alpine" -SELENIUM_STANDALONE_CHROME_DEBUG = "selenium/standalone-chrome-debug:3.141.59" +SELENIUM_STANDALONE_CHROME = "selenium/standalone-chrome:104.0-20220812" SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:latest" THEGEEKLAB_DRONE_GITHUB_COMMENT = "thegeeklab/drone-github-comment:1" @@ -333,7 +333,7 @@ def testPipelines(ctx): pipelines += litmus(ctx, "ocis") if "skip" not in config["cs3ApiTests"] or not config["cs3ApiTests"]["skip"]: - pipelines += [cs3ApiTests(ctx, "ocis", "default")] + pipelines.append(cs3ApiTests(ctx, "ocis", "default")) if "skip" not in config["localApiTests"] or not config["localApiTests"]["skip"]: pipelines += [ localApiTests(ctx, "ocis", "apiAccountsHashDifficulty"), @@ -1955,7 +1955,7 @@ def selenium(): return [ { "name": "selenium", - "image": SELENIUM_STANDALONE_CHROME_DEBUG, + "image": SELENIUM_STANDALONE_CHROME, "volumes": [{ "name": "uploads", "path": "/uploads", From 145561729105f4c54eee157c94915ad42b20c2d7 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 20 Aug 2022 08:01:11 +0000 Subject: [PATCH 071/103] Automated changelog update [skip ci] --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 890f2b5743..f42de2b8ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The following sections list the changes for unreleased. ## Summary +* Bugfix - Fix configuration of mimetypes for the app registry: [#4411](https://github.com/owncloud/ocis/pull/4411) * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) @@ -16,6 +17,15 @@ The following sections list the changes for unreleased. ## Details +* Bugfix - Fix configuration of mimetypes for the app registry: [#4411](https://github.com/owncloud/ocis/pull/4411) + + We've fixed the configuration option for mimetypes in the app registry. Previously the + default config would always be merged over the user provided configuration. Now the default + mimetype configuration is only used if the user does not providy any mimetype configuration + (like it is already done in the proxy with the routes configuration). + + https://github.com/owncloud/ocis/pull/4411 + * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) We've fixed the behavior for the IDP private key generation so that a private key is also From e17d43a940bd091db7b003b86f4898ca6023f3d9 Mon Sep 17 00:00:00 2001 From: "sagargurung1001@gmail.com" Date: Tue, 16 Aug 2022 11:20:46 +0545 Subject: [PATCH 072/103] Add etag propagation for delete files folder for spaces --- .../apiSpaces/etagPropagation.feature | 123 ++++++++++++++++-- .../features/bootstrap/SpacesContext.php | 4 +- 2 files changed, 117 insertions(+), 10 deletions(-) diff --git a/tests/acceptance/features/apiSpaces/etagPropagation.feature b/tests/acceptance/features/apiSpaces/etagPropagation.feature index c861a89481..34a89dda54 100644 --- a/tests/acceptance/features/apiSpaces/etagPropagation.feature +++ b/tests/acceptance/features/apiSpaces/etagPropagation.feature @@ -81,7 +81,7 @@ Feature: check etag propagation after different file alterations | Alice | / | Personal | | Alice | /upload | Personal | | Brian | / | Shares Jail | - | Brian | /upload | Shares Jail | + | Brian | /upload | Shares Jail | And these etags should not have changed | user | path | space | | Alice | /upload/renamed.txt | Personal | @@ -105,7 +105,7 @@ Feature: check etag propagation after different file alterations | Alice | / | Personal | | Alice | /upload | Personal | | Brian | / | Shares Jail | - | Brian | /upload | Shares Jail | + | Brian | /upload | Shares Jail | And these etags should not have changed | user | path | space | | Alice | /upload/renamed.txt | Personal | @@ -186,7 +186,7 @@ Feature: check etag propagation after different file alterations | Brian | / | Shares Jail | | Brian | /upload | Shares Jail | | Brian | /dst | Shares Jail | - + Scenario: as share reciever moving a folder from one folder to an other changes the etags of both folders for all collaborators Given user "Alice" has created folder "/dst" @@ -229,7 +229,7 @@ Feature: check etag propagation after different file alterations | Brian | / | Shares Jail | | Brian | /upload | Shares Jail | - + Scenario: as sharer creating a folder inside a shared folder changes etag for all collaborators Given user "Alice" has shared folder "/upload" with user "Brian" And user "Brian" has accepted share "/upload" offered by user "Alice" @@ -261,10 +261,10 @@ Feature: check etag propagation after different file alterations | Alice | / | Personal | | Alice | /upload | Personal | | Brian | / | Shares Jail | - | Brian | /upload | Shares Jail | + | Brian | /upload | Shares Jail | - Scenario: as sharer uploading a file inside a shared folder should update etags for all collaborators + Scenario: as sharer uploading a file inside a shared folder should update etags for all collaborators Given user "Alice" has shared folder "/upload" with user "Brian" And user "Brian" has accepted share "/upload" offered by user "Alice" And user "Alice" has stored etag of element "/" inside space "Personal" @@ -298,8 +298,8 @@ Feature: check etag propagation after different file alterations | Brian | / | Shares Jail | | Brian | /upload | Shares Jail | - - Scenario: as sharer overwriting a file inside a shared folder should update etags for all collaborators + + Scenario: as sharer overwriting a file inside a shared folder should update etags for all collaborators Given user "Alice" has uploaded file with content "uploaded content" to "/upload/file.txt" And user "Alice" has shared folder "/upload" with user "Brian" And user "Brian" has accepted share "/upload" offered by user "Alice" @@ -315,3 +315,110 @@ Feature: check etag propagation after different file alterations | Alice | /upload | Personal | | Brian | / | Shares Jail | | Brian | /upload | Shares Jail | + + + Scenario: As share receiver deleting (removing) a file changes the etags of all parents for all collaborators + Given user "Alice" has created folder "/upload/sub" + And user "Alice" has uploaded file with content "uploaded content" to "/upload/sub/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" inside space "Personal" + And user "Alice" has stored etag of element "/upload" inside space "Personal" + And user "Alice" has stored etag of element "/upload/sub" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload/sub" inside space "Shares Jail" + When user "Brian" removes the file "upload/sub/file.txt" from space "Shares Jail" + Then the HTTP status code should be "204" + And these etags should have changed + | user | path | space | + | Alice | / | Personal | + | Alice | /upload | Personal | + | Alice | /upload/sub | Personal | + | Brian | / | Shares Jail | + | Brian | /upload | Shares Jail | + | Brian | /upload/sub | Shares Jail | + And these etags should not have changed + | user | path | space | + | Brian | / | Personal | + + + Scenario: As sharer deleting (removing) a file changes the etags of all parents for all collaborators + Given user "Alice" has created folder "/upload/sub" + And user "Alice" has uploaded file with content "uploaded content" to "/upload/sub/file.txt" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" inside space "Personal" + And user "Alice" has stored etag of element "/upload" inside space "Personal" + And user "Alice" has stored etag of element "/upload/sub" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload/sub" inside space "Shares Jail" + When user "Alice" removes the file "upload/sub/file.txt" from space "Personal" + Then the HTTP status code should be "204" + And these etags should have changed + | user | path | space | + | Alice | / | Personal | + | Alice | /upload | Personal | + | Alice | /upload/sub | Personal | + | Brian | / | Shares Jail | + | Brian | /upload | Shares Jail | + | Brian | /upload/sub | Shares Jail | + And these etags should not have changed + | user | path | space | + | Brian | / | Personal | + + + Scenario: As share receiver deleting (removing) a folder changes the etags of all parents for all collaborators + Given user "Alice" has created folder "/upload/sub" + And user "Alice" has created folder "/upload/sub/toDelete" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" inside space "Personal" + And user "Alice" has stored etag of element "/upload" inside space "Personal" + And user "Alice" has stored etag of element "/upload/sub" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload/sub" inside space "Shares Jail" + When user "Brian" removes the file "upload/sub/toDelete" from space "Shares Jail" + Then the HTTP status code should be "204" + And these etags should have changed + | user | path | space | + | Alice | / | Personal | + | Alice | /upload | Personal | + | Alice | /upload/sub | Personal | + | Brian | / | Shares Jail | + | Brian | /upload | Shares Jail | + | Brian | /upload/sub | Shares Jail | + And these etags should not have changed + | user | path | space | + | Brian | / | Personal | + + Scenario: As sharer deleting (removing) a folder changes the etags of all parents for all collaborators + Given user "Alice" has created folder "/upload/sub" + And user "Alice" has created folder "/upload/sub/toDelete" + And user "Alice" has shared folder "/upload" with user "Brian" + And user "Brian" has accepted share "/upload" offered by user "Alice" + And user "Alice" has stored etag of element "/" inside space "Personal" + And user "Alice" has stored etag of element "/upload" inside space "Personal" + And user "Alice" has stored etag of element "/upload/sub" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Personal" + And user "Brian" has stored etag of element "/" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload" inside space "Shares Jail" + And user "Brian" has stored etag of element "/upload/sub" inside space "Shares Jail" + When user "Alice" removes the file "upload/sub/toDelete" from space "Personal" + Then the HTTP status code should be "204" + And these etags should have changed + | user | path | space | + | Alice | / | Personal | + | Alice | /upload | Personal | + | Alice | /upload/sub | Personal | + | Brian | / | Shares Jail | + | Brian | /upload | Shares Jail | + | Brian | /upload/sub | Shares Jail | + And these etags should not have changed + | user | path | space | + | Brian | / | Personal | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 470a9d0fd9..43c96caeea 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -2215,7 +2215,7 @@ class SpacesContext implements Context { string $spaceName ): void { $space = $this->getSpaceByName($user, $spaceName); - $spaceWebDavUrl = $space["root"]["webDavUrl"] . '/' . $object; + $spaceWebDavUrl = $space["root"]["webDavUrl"] . '/' . ltrim($object, "/"); $this->featureContext->setResponse( HttpRequestHelper::delete( $spaceWebDavUrl, @@ -3035,7 +3035,7 @@ class SpacesContext implements Context { Assert::assertEmpty($responseArray, __METHOD__ . ' Response should be empty'); } } - + /** * @When /^user "([^"]*)" gets the following properties of (?:file|folder|entry|resource) "([^"]*)" inside space "([^"]*)" using the WebDAV API$/ * From 23344fd08eb4a312c57b69cb1f95c22e25ff6a30 Mon Sep 17 00:00:00 2001 From: "sagargurung1001@gmail.com" Date: Tue, 16 Aug 2022 11:49:06 +0545 Subject: [PATCH 073/103] Update expected to failure for etag --- .drone.env | 2 +- tests/acceptance/expected-failures-API-on-OCIS-storage.md | 8 ++++---- .../acceptance/features/apiSpaces/etagPropagation.feature | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.drone.env b/.drone.env index 4cc690e098..bf41b89dff 100644 --- a/.drone.env +++ b/.drone.env @@ -1,5 +1,5 @@ # The test runner source for API tests -CORE_COMMITID=76048f490ac50af03594d181c5baf49f87c18b6e +CORE_COMMITID=f79fbff0a0d129df7b6ec20bc202665c4fda5fad CORE_BRANCH=master # The test runner source for UI tests diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 7da96c76e1..e39067d0ab 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -954,10 +954,6 @@ And other missing implementation of favorites - [apiWebdavUploadTUS/uploadToShare.feature:254](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L254) - [apiWebdavUploadTUS/uploadToShare.feature:301](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L301) - [apiWebdavUploadTUS/uploadToShare.feature:326](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L326) -- [apiWebdavEtagPropagation1/deleteFileFolder.feature:120](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/deleteFileFolder.feature#L120) -- [apiWebdavEtagPropagation1/deleteFileFolder.feature:156](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/deleteFileFolder.feature#L156) -- [apiWebdavEtagPropagation1/deleteFileFolder.feature:194](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/deleteFileFolder.feature#L194) -- [apiWebdavEtagPropagation1/deleteFileFolder.feature:232](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavEtagPropagation1/deleteFileFolder.feature#L232) - [apiWebdavLocks2/resharedSharesToShares.feature:117](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L117) - [apiWebdavLocks2/resharedSharesToShares.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L118) - [apiWebdavLocks2/resharedSharesToShares.feature:144](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L144) @@ -1397,5 +1393,9 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiTrashbin/trashbinFilesFolders.feature:438](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L438) - [apiTrashbin/trashbinFilesFolders.feature:475](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L475) +#### [valid WebDAV (DELETE, COPY or MOVE) requests with body must exit with 415](https://github.com/owncloud/ocis/issues/4332) +- [apiAuthWebDav/webDavDELETEAuth.feature:188](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiAuthWebDav/webDavDELETEAuth.feature#L188) +- [apiAuthWebDav/webDavDELETEAuth.feature:199](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiAuthWebDav/webDavDELETEAuth.feature#L199) + Note: always have an empty line at the end of this file. The bash script that processes this file requires that the last line has a newline on the end. diff --git a/tests/acceptance/features/apiSpaces/etagPropagation.feature b/tests/acceptance/features/apiSpaces/etagPropagation.feature index 34a89dda54..bd93c6598a 100644 --- a/tests/acceptance/features/apiSpaces/etagPropagation.feature +++ b/tests/acceptance/features/apiSpaces/etagPropagation.feature @@ -397,6 +397,7 @@ Feature: check etag propagation after different file alterations | user | path | space | | Brian | / | Personal | + Scenario: As sharer deleting (removing) a folder changes the etags of all parents for all collaborators Given user "Alice" has created folder "/upload/sub" And user "Alice" has created folder "/upload/sub/toDelete" From 9f2be9f4f95dd27553a98576ecc73c72eaf65db7 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Mon, 22 Aug 2022 08:08:18 +0200 Subject: [PATCH 074/103] remove Log prefix from configlog functions --- ocis-pkg/config/configlog/log.go | 12 ++++++------ ocis/pkg/command/app-provider.go | 2 +- ocis/pkg/command/app-registry.go | 2 +- ocis/pkg/command/audit.go | 2 +- ocis/pkg/command/auth-basic.go | 2 +- ocis/pkg/command/auth-bearer.go | 2 +- ocis/pkg/command/auth-machine.go | 2 +- ocis/pkg/command/frontend.go | 2 +- ocis/pkg/command/gateway.go | 2 +- ocis/pkg/command/graph-explorer.go | 2 +- ocis/pkg/command/graph.go | 2 +- ocis/pkg/command/groups.go | 2 +- ocis/pkg/command/idm.go | 2 +- ocis/pkg/command/idp.go | 2 +- ocis/pkg/command/migrate.go | 8 ++++---- ocis/pkg/command/nats.go | 2 +- ocis/pkg/command/notifications.go | 2 +- ocis/pkg/command/ocdav.go | 2 +- ocis/pkg/command/ocs.go | 2 +- ocis/pkg/command/proxy.go | 2 +- ocis/pkg/command/search.go | 2 +- ocis/pkg/command/server.go | 2 +- ocis/pkg/command/settings.go | 2 +- ocis/pkg/command/sharing.go | 2 +- ocis/pkg/command/storage-publiclink.go | 2 +- ocis/pkg/command/storage-shares.go | 2 +- ocis/pkg/command/storage-system.go | 2 +- ocis/pkg/command/storage-users.go | 2 +- ocis/pkg/command/store.go | 2 +- ocis/pkg/command/thumbnails.go | 2 +- ocis/pkg/command/users.go | 2 +- ocis/pkg/command/web.go | 2 +- ocis/pkg/command/webdav.go | 2 +- services/app-provider/pkg/command/health.go | 2 +- services/app-provider/pkg/command/server.go | 2 +- services/app-registry/pkg/command/health.go | 2 +- services/app-registry/pkg/command/server.go | 2 +- services/audit/pkg/command/server.go | 2 +- services/auth-basic/pkg/command/health.go | 2 +- services/auth-basic/pkg/command/server.go | 2 +- services/auth-bearer/pkg/command/health.go | 2 +- services/auth-bearer/pkg/command/server.go | 2 +- services/auth-machine/pkg/command/health.go | 2 +- services/auth-machine/pkg/command/server.go | 2 +- services/frontend/pkg/command/health.go | 2 +- services/frontend/pkg/command/server.go | 2 +- services/gateway/pkg/command/health.go | 2 +- services/gateway/pkg/command/server.go | 2 +- services/graph-explorer/pkg/command/health.go | 2 +- services/graph-explorer/pkg/command/server.go | 2 +- services/graph/pkg/command/health.go | 2 +- services/graph/pkg/command/server.go | 2 +- services/groups/pkg/command/health.go | 2 +- services/groups/pkg/command/server.go | 2 +- services/idm/pkg/command/health.go | 2 +- services/idm/pkg/command/resetpw.go | 2 +- services/idm/pkg/command/server.go | 2 +- services/idp/pkg/command/health.go | 2 +- services/idp/pkg/command/server.go | 2 +- services/nats/pkg/command/server.go | 2 +- services/notifications/pkg/command/server.go | 2 +- services/ocdav/pkg/command/health.go | 2 +- services/ocdav/pkg/command/server.go | 2 +- services/ocs/pkg/command/health.go | 2 +- services/ocs/pkg/command/server.go | 2 +- services/proxy/pkg/command/health.go | 2 +- services/proxy/pkg/command/server.go | 2 +- services/search/pkg/command/server.go | 2 +- services/settings/pkg/command/health.go | 2 +- services/settings/pkg/command/server.go | 2 +- services/sharing/pkg/command/health.go | 2 +- services/sharing/pkg/command/server.go | 2 +- services/storage-publiclink/pkg/command/health.go | 2 +- services/storage-publiclink/pkg/command/server.go | 2 +- services/storage-shares/pkg/command/health.go | 2 +- services/storage-shares/pkg/command/server.go | 2 +- services/storage-system/pkg/command/health.go | 2 +- services/storage-system/pkg/command/server.go | 2 +- services/storage-users/pkg/command/health.go | 2 +- services/storage-users/pkg/command/server.go | 2 +- services/storage-users/pkg/command/uploads.go | 4 ++-- services/store/pkg/command/health.go | 2 +- services/store/pkg/command/server.go | 2 +- services/thumbnails/pkg/command/health.go | 2 +- services/thumbnails/pkg/command/server.go | 2 +- services/users/pkg/command/health.go | 2 +- services/users/pkg/command/server.go | 2 +- services/web/pkg/command/health.go | 2 +- services/web/pkg/command/server.go | 2 +- services/webdav/pkg/command/health.go | 2 +- services/webdav/pkg/command/server.go | 2 +- 91 files changed, 100 insertions(+), 100 deletions(-) diff --git a/ocis-pkg/config/configlog/log.go b/ocis-pkg/config/configlog/log.go index c5ff40d04e..33079e846d 100644 --- a/ocis-pkg/config/configlog/log.go +++ b/ocis-pkg/config/configlog/log.go @@ -5,23 +5,23 @@ import ( "os" ) -// LogError logs the error -func LogError(err error) { +// Error logs the error +func Error(err error) { if err != nil { fmt.Printf("%v\n", err) } } -// LogError logs the error and returns it unchanged -func LogReturnError(err error) error { +// ReturnError logs the error and returns it unchanged +func ReturnError(err error) error { if err != nil { fmt.Printf("%v\n", err) } return err } -// LogReturnFatal logs the error and calls os.Exit(1) and returns nil if no error is passed -func LogReturnFatal(err error) error { +// ReturnFatal logs the error and calls os.Exit(1) and returns nil if no error is passed +func ReturnFatal(err error) error { if err != nil { fmt.Printf("%v\n", err) os.Exit(1) diff --git a/ocis/pkg/command/app-provider.go b/ocis/pkg/command/app-provider.go index 74cdbecd48..50f20ce766 100644 --- a/ocis/pkg/command/app-provider.go +++ b/ocis/pkg/command/app-provider.go @@ -17,7 +17,7 @@ func AppProviderCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AppProvider.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AppProvider.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/app-registry.go b/ocis/pkg/command/app-registry.go index d39e08201d..d35fcabb42 100644 --- a/ocis/pkg/command/app-registry.go +++ b/ocis/pkg/command/app-registry.go @@ -17,7 +17,7 @@ func AppRegistryCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AppRegistry.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AppRegistry.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/audit.go b/ocis/pkg/command/audit.go index ffc8b335eb..7299a71a84 100644 --- a/ocis/pkg/command/audit.go +++ b/ocis/pkg/command/audit.go @@ -17,7 +17,7 @@ func AuditCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Audit.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Audit.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-basic.go b/ocis/pkg/command/auth-basic.go index 8503851d3b..48a026647c 100644 --- a/ocis/pkg/command/auth-basic.go +++ b/ocis/pkg/command/auth-basic.go @@ -17,7 +17,7 @@ func AuthBasicCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthBasic.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AuthBasic.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-bearer.go b/ocis/pkg/command/auth-bearer.go index 213146f212..413e15e9ef 100644 --- a/ocis/pkg/command/auth-bearer.go +++ b/ocis/pkg/command/auth-bearer.go @@ -17,7 +17,7 @@ func AuthBearerCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthBearer.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AuthBearer.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/auth-machine.go b/ocis/pkg/command/auth-machine.go index 4561203c08..17c23b632f 100644 --- a/ocis/pkg/command/auth-machine.go +++ b/ocis/pkg/command/auth-machine.go @@ -17,7 +17,7 @@ func AuthMachineCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.AuthMachine.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.AuthMachine.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/frontend.go b/ocis/pkg/command/frontend.go index 0ca6a4c6be..ae28f41059 100644 --- a/ocis/pkg/command/frontend.go +++ b/ocis/pkg/command/frontend.go @@ -17,7 +17,7 @@ func FrontendCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Frontend.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Frontend.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/gateway.go b/ocis/pkg/command/gateway.go index 1107587c37..3562ffade5 100644 --- a/ocis/pkg/command/gateway.go +++ b/ocis/pkg/command/gateway.go @@ -17,7 +17,7 @@ func GatewayCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Gateway.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Gateway.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/graph-explorer.go b/ocis/pkg/command/graph-explorer.go index 4d295fd825..87e6fe71f6 100644 --- a/ocis/pkg/command/graph-explorer.go +++ b/ocis/pkg/command/graph-explorer.go @@ -17,7 +17,7 @@ func GraphExplorerCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.GraphExplorer.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.GraphExplorer.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/graph.go b/ocis/pkg/command/graph.go index 6efc8179d2..4ff45e2313 100644 --- a/ocis/pkg/command/graph.go +++ b/ocis/pkg/command/graph.go @@ -17,7 +17,7 @@ func GraphCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Graph.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Graph.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/groups.go b/ocis/pkg/command/groups.go index edaffd9824..630f1060ee 100644 --- a/ocis/pkg/command/groups.go +++ b/ocis/pkg/command/groups.go @@ -17,7 +17,7 @@ func GroupsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Groups.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Groups.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/idm.go b/ocis/pkg/command/idm.go index d1e100a056..3adc837388 100644 --- a/ocis/pkg/command/idm.go +++ b/ocis/pkg/command/idm.go @@ -17,7 +17,7 @@ func IDMCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.IDM.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.IDM.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/idp.go b/ocis/pkg/command/idp.go index b932f2465d..b8f0449c78 100644 --- a/ocis/pkg/command/idp.go +++ b/ocis/pkg/command/idp.go @@ -17,7 +17,7 @@ func IDPCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.IDP.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.IDP.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/migrate.go b/ocis/pkg/command/migrate.go index fa020a1afb..985c44ba97 100644 --- a/ocis/pkg/command/migrate.go +++ b/ocis/pkg/command/migrate.go @@ -57,12 +57,12 @@ func MigrateShares(cfg *config.Config) *cli.Command { Before: func(c *cli.Context) error { // Parse base config if err := parser.ParseConfig(cfg, true); err != nil { - return configlog.LogReturnError(err) + return configlog.ReturnError(err) } // Parse sharing config cfg.Sharing.Commons = cfg.Commons - return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing)) + return configlog.ReturnError(sharingparser.ParseConfig(cfg.Sharing)) }, Action: func(c *cli.Context) error { log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger() @@ -152,12 +152,12 @@ func MigratePublicShares(cfg *config.Config) *cli.Command { Before: func(c *cli.Context) error { // Parse base config if err := parser.ParseConfig(cfg, true); err != nil { - return configlog.LogReturnError(err) + return configlog.ReturnError(err) } // Parse sharing config cfg.Sharing.Commons = cfg.Commons - return configlog.LogReturnError(sharingparser.ParseConfig(cfg.Sharing)) + return configlog.ReturnError(sharingparser.ParseConfig(cfg.Sharing)) }, Action: func(c *cli.Context) error { log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger() diff --git a/ocis/pkg/command/nats.go b/ocis/pkg/command/nats.go index a7ec22ad64..989286c0ae 100644 --- a/ocis/pkg/command/nats.go +++ b/ocis/pkg/command/nats.go @@ -17,7 +17,7 @@ func NatsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Nats.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Nats.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/notifications.go b/ocis/pkg/command/notifications.go index 1bdea39f23..0fc591f146 100644 --- a/ocis/pkg/command/notifications.go +++ b/ocis/pkg/command/notifications.go @@ -17,7 +17,7 @@ func NotificationsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Notifications.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Notifications.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/ocdav.go b/ocis/pkg/command/ocdav.go index f48683a44e..a46cd3ecf5 100644 --- a/ocis/pkg/command/ocdav.go +++ b/ocis/pkg/command/ocdav.go @@ -17,7 +17,7 @@ func OCDavCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.OCDav.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.OCDav.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/ocs.go b/ocis/pkg/command/ocs.go index 1c27e1cddc..89091138c4 100644 --- a/ocis/pkg/command/ocs.go +++ b/ocis/pkg/command/ocs.go @@ -17,7 +17,7 @@ func OCSCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.OCS.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.OCS.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/proxy.go b/ocis/pkg/command/proxy.go index 7e1204248b..0bdbf71e25 100644 --- a/ocis/pkg/command/proxy.go +++ b/ocis/pkg/command/proxy.go @@ -17,7 +17,7 @@ func ProxyCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Proxy.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Proxy.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/search.go b/ocis/pkg/command/search.go index 050b8b4300..59cb691e9e 100644 --- a/ocis/pkg/command/search.go +++ b/ocis/pkg/command/search.go @@ -17,7 +17,7 @@ func SearchCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Search.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Search.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/server.go b/ocis/pkg/command/server.go index 685d55ebf5..a83ffd585f 100644 --- a/ocis/pkg/command/server.go +++ b/ocis/pkg/command/server.go @@ -16,7 +16,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: "start a fullstack server (runtime and all services in supervised mode)", Category: "fullstack", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg, false)) + return configlog.ReturnError(parser.ParseConfig(cfg, false)) }, Action: func(c *cli.Context) error { r := runtime.New(cfg) diff --git a/ocis/pkg/command/settings.go b/ocis/pkg/command/settings.go index c9609b10ef..d5950b2096 100644 --- a/ocis/pkg/command/settings.go +++ b/ocis/pkg/command/settings.go @@ -17,7 +17,7 @@ func SettingsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Settings.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Settings.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/sharing.go b/ocis/pkg/command/sharing.go index 1df0e15303..31ccc40ca2 100644 --- a/ocis/pkg/command/sharing.go +++ b/ocis/pkg/command/sharing.go @@ -17,7 +17,7 @@ func SharingCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Sharing.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Sharing.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-publiclink.go b/ocis/pkg/command/storage-publiclink.go index 4d91368c64..1819089247 100644 --- a/ocis/pkg/command/storage-publiclink.go +++ b/ocis/pkg/command/storage-publiclink.go @@ -17,7 +17,7 @@ func StoragePublicLinkCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StoragePublicLink.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.StoragePublicLink.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-shares.go b/ocis/pkg/command/storage-shares.go index 744b20c12d..6def892696 100644 --- a/ocis/pkg/command/storage-shares.go +++ b/ocis/pkg/command/storage-shares.go @@ -17,7 +17,7 @@ func StorageSharesCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageShares.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.StorageShares.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-system.go b/ocis/pkg/command/storage-system.go index ed790b6c43..cd933eeeaa 100644 --- a/ocis/pkg/command/storage-system.go +++ b/ocis/pkg/command/storage-system.go @@ -17,7 +17,7 @@ func StorageSystemCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageSystem.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.StorageSystem.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/storage-users.go b/ocis/pkg/command/storage-users.go index c3745a8429..980cc953d6 100644 --- a/ocis/pkg/command/storage-users.go +++ b/ocis/pkg/command/storage-users.go @@ -17,7 +17,7 @@ func StorageUsersCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.StorageUsers.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.StorageUsers.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/store.go b/ocis/pkg/command/store.go index 8dcc455f49..947779d71e 100644 --- a/ocis/pkg/command/store.go +++ b/ocis/pkg/command/store.go @@ -18,7 +18,7 @@ func StoreCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Store.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Store.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/thumbnails.go b/ocis/pkg/command/thumbnails.go index 682020c7b9..235edfafb3 100644 --- a/ocis/pkg/command/thumbnails.go +++ b/ocis/pkg/command/thumbnails.go @@ -17,7 +17,7 @@ func ThumbnailsCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Thumbnails.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Thumbnails.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/users.go b/ocis/pkg/command/users.go index 97b7e30be3..905c757187 100644 --- a/ocis/pkg/command/users.go +++ b/ocis/pkg/command/users.go @@ -17,7 +17,7 @@ func UsersCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Users.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Users.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/web.go b/ocis/pkg/command/web.go index 983134f1f7..e7b1f001df 100644 --- a/ocis/pkg/command/web.go +++ b/ocis/pkg/command/web.go @@ -17,7 +17,7 @@ func WebCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.Web.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.Web.Commons = cfg.Commons return nil }, diff --git a/ocis/pkg/command/webdav.go b/ocis/pkg/command/webdav.go index ea9e42531b..6acd8ec596 100644 --- a/ocis/pkg/command/webdav.go +++ b/ocis/pkg/command/webdav.go @@ -18,7 +18,7 @@ func WebDAVCommand(cfg *config.Config) *cli.Command { Usage: helper.SubcommandDescription(cfg.WebDAV.Service.Name), Category: "services", Before: func(c *cli.Context) error { - configlog.LogError(parser.ParseConfig(cfg, true)) + configlog.Error(parser.ParseConfig(cfg, true)) cfg.WebDAV.Commons = cfg.Commons return nil }, diff --git a/services/app-provider/pkg/command/health.go b/services/app-provider/pkg/command/health.go index 684c2ce42b..23db3c5011 100644 --- a/services/app-provider/pkg/command/health.go +++ b/services/app-provider/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index eb399c5782..a7fc216d07 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-registry/pkg/command/health.go b/services/app-registry/pkg/command/health.go index f9b6737f18..f8331072cc 100644 --- a/services/app-registry/pkg/command/health.go +++ b/services/app-registry/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/app-registry/pkg/command/server.go b/services/app-registry/pkg/command/server.go index 7339ebd3eb..aa230570fb 100644 --- a/services/app-registry/pkg/command/server.go +++ b/services/app-registry/pkg/command/server.go @@ -28,7 +28,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/audit/pkg/command/server.go b/services/audit/pkg/command/server.go index a3f0121d31..2537adfdd5 100644 --- a/services/audit/pkg/command/server.go +++ b/services/audit/pkg/command/server.go @@ -23,7 +23,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-basic/pkg/command/health.go b/services/auth-basic/pkg/command/health.go index 357139e603..269847ebb8 100644 --- a/services/auth-basic/pkg/command/health.go +++ b/services/auth-basic/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index 908883fca4..4dc4ffba2a 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-bearer/pkg/command/health.go b/services/auth-bearer/pkg/command/health.go index 59c619b49e..b562eaa4a3 100644 --- a/services/auth-bearer/pkg/command/health.go +++ b/services/auth-bearer/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index d923a0e4ce..4c181bfab9 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-machine/pkg/command/health.go b/services/auth-machine/pkg/command/health.go index 252bca77ca..2e04d3a5b5 100644 --- a/services/auth-machine/pkg/command/health.go +++ b/services/auth-machine/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index 31e3572af9..bf2ad19cca 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/frontend/pkg/command/health.go b/services/frontend/pkg/command/health.go index 4feeb3d6d2..041dea70a3 100644 --- a/services/frontend/pkg/command/health.go +++ b/services/frontend/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index 8ac2492212..6508799699 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/gateway/pkg/command/health.go b/services/gateway/pkg/command/health.go index 54ca2717ac..e2b5231ce9 100644 --- a/services/gateway/pkg/command/health.go +++ b/services/gateway/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/gateway/pkg/command/server.go b/services/gateway/pkg/command/server.go index 18202cf136..f2ddf03afa 100644 --- a/services/gateway/pkg/command/server.go +++ b/services/gateway/pkg/command/server.go @@ -28,7 +28,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph-explorer/pkg/command/health.go b/services/graph-explorer/pkg/command/health.go index 07547d98b2..96a4302963 100644 --- a/services/graph-explorer/pkg/command/health.go +++ b/services/graph-explorer/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph-explorer/pkg/command/server.go b/services/graph-explorer/pkg/command/server.go index 564739a539..aa2e5be077 100644 --- a/services/graph-explorer/pkg/command/server.go +++ b/services/graph-explorer/pkg/command/server.go @@ -24,7 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(ctx *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph/pkg/command/health.go b/services/graph/pkg/command/health.go index 788ef9feb7..b3cf03e9be 100644 --- a/services/graph/pkg/command/health.go +++ b/services/graph/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/graph/pkg/command/server.go b/services/graph/pkg/command/server.go index 4ad0faa3bf..36a8a5cf94 100644 --- a/services/graph/pkg/command/server.go +++ b/services/graph/pkg/command/server.go @@ -24,7 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/groups/pkg/command/health.go b/services/groups/pkg/command/health.go index e0a87a0806..8a48fe36c8 100644 --- a/services/groups/pkg/command/health.go +++ b/services/groups/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index 7652d2213f..6605c3dfd3 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/health.go b/services/idm/pkg/command/health.go index 1abac500cf..328ac39690 100644 --- a/services/idm/pkg/command/health.go +++ b/services/idm/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/resetpw.go b/services/idm/pkg/command/resetpw.go index a98b39946f..415b047922 100644 --- a/services/idm/pkg/command/resetpw.go +++ b/services/idm/pkg/command/resetpw.go @@ -28,7 +28,7 @@ func ResetPassword(cfg *config.Config) *cli.Command { Usage: "Reset admin password", Category: "password reset", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index 2e0e96d2d8..f8e8561dc1 100644 --- a/services/idm/pkg/command/server.go +++ b/services/idm/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idp/pkg/command/health.go b/services/idp/pkg/command/health.go index 108af9d289..461bd5cbef 100644 --- a/services/idp/pkg/command/health.go +++ b/services/idp/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/idp/pkg/command/server.go b/services/idp/pkg/command/server.go index c6a265868c..a17d0c42d4 100644 --- a/services/idp/pkg/command/server.go +++ b/services/idp/pkg/command/server.go @@ -36,7 +36,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - configlog.LogReturnFatal(parser.ParseConfig(cfg)) + configlog.ReturnFatal(parser.ParseConfig(cfg)) if cfg.IDP.EncryptionSecretFile != "" { if err := ensureEncryptionSecretExists(cfg.IDP.EncryptionSecretFile); err != nil { diff --git a/services/nats/pkg/command/server.go b/services/nats/pkg/command/server.go index 1cee11ebbd..d281759079 100644 --- a/services/nats/pkg/command/server.go +++ b/services/nats/pkg/command/server.go @@ -21,7 +21,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/notifications/pkg/command/server.go b/services/notifications/pkg/command/server.go index 12f5ee5431..8685b4e429 100644 --- a/services/notifications/pkg/command/server.go +++ b/services/notifications/pkg/command/server.go @@ -22,7 +22,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocdav/pkg/command/health.go b/services/ocdav/pkg/command/health.go index 5bee1653e2..c207e17f2d 100644 --- a/services/ocdav/pkg/command/health.go +++ b/services/ocdav/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocdav/pkg/command/server.go b/services/ocdav/pkg/command/server.go index 1474cd9bc6..f7bc2a91ad 100644 --- a/services/ocdav/pkg/command/server.go +++ b/services/ocdav/pkg/command/server.go @@ -23,7 +23,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocs/pkg/command/health.go b/services/ocs/pkg/command/health.go index dfa9f07779..e4939db9e1 100644 --- a/services/ocs/pkg/command/health.go +++ b/services/ocs/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/ocs/pkg/command/server.go b/services/ocs/pkg/command/server.go index 507951fb5c..7c3b6c989b 100644 --- a/services/ocs/pkg/command/server.go +++ b/services/ocs/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/proxy/pkg/command/health.go b/services/proxy/pkg/command/health.go index 2646f53c6a..824d626e51 100644 --- a/services/proxy/pkg/command/health.go +++ b/services/proxy/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index e5ebcaac84..b59b6eefb1 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -41,7 +41,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/search/pkg/command/server.go b/services/search/pkg/command/server.go index 0e0dcd0570..e1bfac3a3e 100644 --- a/services/search/pkg/command/server.go +++ b/services/search/pkg/command/server.go @@ -24,7 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/settings/pkg/command/health.go b/services/settings/pkg/command/health.go index fc126cad14..59519140fd 100644 --- a/services/settings/pkg/command/health.go +++ b/services/settings/pkg/command/health.go @@ -17,7 +17,7 @@ func Health(cfg *config.Config) *cli.Command { Name: "health", Usage: "Check health status", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/settings/pkg/command/server.go b/services/settings/pkg/command/server.go index 101f070ee7..6e9571495c 100644 --- a/services/settings/pkg/command/server.go +++ b/services/settings/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/sharing/pkg/command/health.go b/services/sharing/pkg/command/health.go index 00a34e5fcb..3e15bcd1cf 100644 --- a/services/sharing/pkg/command/health.go +++ b/services/sharing/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index 00c675fa1d..6154ff20b9 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-publiclink/pkg/command/health.go b/services/storage-publiclink/pkg/command/health.go index 70a392baf8..f60117b4fa 100644 --- a/services/storage-publiclink/pkg/command/health.go +++ b/services/storage-publiclink/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index 257c78d8b5..1c731ee52d 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-shares/pkg/command/health.go b/services/storage-shares/pkg/command/health.go index f607aae7b6..4ed8a72cfa 100644 --- a/services/storage-shares/pkg/command/health.go +++ b/services/storage-shares/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index 8cd42e99c6..d3e507e2bb 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-system/pkg/command/health.go b/services/storage-system/pkg/command/health.go index dcef0c624c..c5e80577da 100644 --- a/services/storage-system/pkg/command/health.go +++ b/services/storage-system/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index aba0df8e68..de6095a66d 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/health.go b/services/storage-users/pkg/command/health.go index 3c92b63bd5..717df82eb4 100644 --- a/services/storage-users/pkg/command/health.go +++ b/services/storage-users/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index f7b3f68501..8c976eb376 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -29,7 +29,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go index 90568c97b0..506dee2dab 100644 --- a/services/storage-users/pkg/command/uploads.go +++ b/services/storage-users/pkg/command/uploads.go @@ -36,7 +36,7 @@ func ListUploads(cfg *config.Config) *cli.Command { Name: "list", Usage: "Print a list of all incomplete uploads", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] @@ -77,7 +77,7 @@ func PurgeExpiredUploads(cfg *config.Config) *cli.Command { Name: "clean", Usage: "Clean up leftovers from expired uploads", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] diff --git a/services/store/pkg/command/health.go b/services/store/pkg/command/health.go index 7ec9a7b1fe..6d2abc564f 100644 --- a/services/store/pkg/command/health.go +++ b/services/store/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/store/pkg/command/server.go b/services/store/pkg/command/server.go index e472e5d815..76534809bb 100644 --- a/services/store/pkg/command/server.go +++ b/services/store/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/thumbnails/pkg/command/health.go b/services/thumbnails/pkg/command/health.go index 341b156f66..a730037c36 100644 --- a/services/thumbnails/pkg/command/health.go +++ b/services/thumbnails/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/thumbnails/pkg/command/server.go b/services/thumbnails/pkg/command/server.go index ebe72e8e87..c79b882ddc 100644 --- a/services/thumbnails/pkg/command/server.go +++ b/services/thumbnails/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/users/pkg/command/health.go b/services/users/pkg/command/health.go index 13841bde09..7884cdc413 100644 --- a/services/users/pkg/command/health.go +++ b/services/users/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index 008200215a..b0419b305a 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -30,7 +30,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/web/pkg/command/health.go b/services/web/pkg/command/health.go index 157e8b434b..db6a692408 100644 --- a/services/web/pkg/command/health.go +++ b/services/web/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/web/pkg/command/server.go b/services/web/pkg/command/server.go index 083074bcc2..3c430369db 100644 --- a/services/web/pkg/command/server.go +++ b/services/web/pkg/command/server.go @@ -25,7 +25,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/webdav/pkg/command/health.go b/services/webdav/pkg/command/health.go index edfec5d6d8..f7c16c6c55 100644 --- a/services/webdav/pkg/command/health.go +++ b/services/webdav/pkg/command/health.go @@ -18,7 +18,7 @@ func Health(cfg *config.Config) *cli.Command { Usage: "check health status", Category: "info", Before: func(c *cli.Context) error { - return configlog.LogReturnError(parser.ParseConfig(cfg)) + return configlog.ReturnError(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) diff --git a/services/webdav/pkg/command/server.go b/services/webdav/pkg/command/server.go index 4c505c5c44..5393a453f9 100644 --- a/services/webdav/pkg/command/server.go +++ b/services/webdav/pkg/command/server.go @@ -24,7 +24,7 @@ func Server(cfg *config.Config) *cli.Command { Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name), Category: "server", Before: func(c *cli.Context) error { - return configlog.LogReturnFatal(parser.ParseConfig(cfg)) + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) From 9aabcecc1fe250d3f53361cae0f43b56c3e88512 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 06:29:25 +0000 Subject: [PATCH 075/103] Bump github.com/MicahParks/keyfunc from 1.2.0 to 1.2.2 Bumps [github.com/MicahParks/keyfunc](https://github.com/MicahParks/keyfunc) from 1.2.0 to 1.2.2. - [Release notes](https://github.com/MicahParks/keyfunc/releases) - [Commits](https://github.com/MicahParks/keyfunc/compare/v1.2.0...v1.2.2) --- updated-dependencies: - dependency-name: github.com/MicahParks/keyfunc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6d2350d953..0e69239deb 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/CiscoM31/godata v1.0.5 github.com/Masterminds/semver v1.5.0 - github.com/MicahParks/keyfunc v1.2.0 + github.com/MicahParks/keyfunc v1.2.2 github.com/ReneKroon/ttlcache/v2 v2.11.0 github.com/blevesearch/bleve/v2 v2.3.3 github.com/blevesearch/bleve_index_api v1.0.2 diff --git a/go.sum b/go.sum index 61ac75368f..122cfd8608 100644 --- a/go.sum +++ b/go.sum @@ -99,8 +99,8 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/MicahParks/keyfunc v1.2.0 h1:qiUfvtvvcoS0JXcHtoqglT29WyvuL0l3tkBlzp0QmsU= -github.com/MicahParks/keyfunc v1.2.0/go.mod h1:a4yfunv77gZ0RgTNw7tOYS+bjtHk5565e+1dPz+YJI8= +github.com/MicahParks/keyfunc v1.2.2 h1:MtA/6bnmhcyDMarVF9QRQmfKg1ssKxH1C+k3Gw8DY1g= +github.com/MicahParks/keyfunc v1.2.2/go.mod h1:GWZYIBflWXRPShQPMFRrUg+8buvyD0IWeg3Fi2rcrME= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= From fd1a9bf6c2ac885249028e599b4ad89e9139f149 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Mon, 22 Aug 2022 09:12:52 +0000 Subject: [PATCH 076/103] Automated changelog update [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f42de2b8ba..45f9475404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The following sections list the changes for unreleased. ## Summary * Bugfix - Fix configuration of mimetypes for the app registry: [#4411](https://github.com/owncloud/ocis/pull/4411) +* Bugfix - Show help for some commands when unconfigured: [#4405](https://github.com/owncloud/ocis/pull/4405) * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) @@ -26,6 +27,13 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4411 +* Bugfix - Show help for some commands when unconfigured: [#4405](https://github.com/owncloud/ocis/pull/4405) + + We've fixed some commands to show the help also when oCIS is not yet configured. Previously the + help was not displayed to the user but instead a configuration validation error. + + https://github.com/owncloud/ocis/pull/4405 + * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) We've fixed the behavior for the IDP private key generation so that a private key is also From 99a22a37602c8c5738b66aebc64feb0792f7505f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 10:00:15 +0000 Subject: [PATCH 077/103] Bump go-micro.dev/v4 from 4.8.0 to 4.8.1 Bumps [go-micro.dev/v4](https://github.com/asim/go-micro) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/asim/go-micro/releases) - [Changelog](https://github.com/asim/go-micro/blob/master/CHANGELOG.md) - [Commits](https://github.com/asim/go-micro/compare/v4.8.0...v4.8.1) --- updated-dependencies: - dependency-name: go-micro.dev/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 6d2350d953..e0eae8a2cc 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/CiscoM31/godata v1.0.5 github.com/Masterminds/semver v1.5.0 - github.com/MicahParks/keyfunc v1.2.0 + github.com/MicahParks/keyfunc v1.2.2 github.com/ReneKroon/ttlcache/v2 v2.11.0 github.com/blevesearch/bleve/v2 v2.3.3 github.com/blevesearch/bleve_index_api v1.0.2 @@ -63,7 +63,7 @@ require ( github.com/tus/tusd v1.9.0 github.com/urfave/cli/v2 v2.11.1 github.com/xhit/go-simple-mail/v2 v2.11.0 - go-micro.dev/v4 v4.8.0 + go-micro.dev/v4 v4.8.1 go.etcd.io/bbolt v1.3.6 go.opencensus.io v0.23.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 diff --git a/go.sum b/go.sum index 61ac75368f..3b2bb56fc9 100644 --- a/go.sum +++ b/go.sum @@ -99,8 +99,8 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/MicahParks/keyfunc v1.2.0 h1:qiUfvtvvcoS0JXcHtoqglT29WyvuL0l3tkBlzp0QmsU= -github.com/MicahParks/keyfunc v1.2.0/go.mod h1:a4yfunv77gZ0RgTNw7tOYS+bjtHk5565e+1dPz+YJI8= +github.com/MicahParks/keyfunc v1.2.2 h1:MtA/6bnmhcyDMarVF9QRQmfKg1ssKxH1C+k3Gw8DY1g= +github.com/MicahParks/keyfunc v1.2.2/go.mod h1:GWZYIBflWXRPShQPMFRrUg+8buvyD0IWeg3Fi2rcrME= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= @@ -1226,8 +1226,8 @@ github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zenazn/goji v1.0.1/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -go-micro.dev/v4 v4.8.0 h1:4rrKpGHUTnrD2k2eVUVayJgWDoFlDcB/Ijkga8dZMNc= -go-micro.dev/v4 v4.8.0/go.mod h1:Ju8HrZ5hQSF+QguZ2QUs9Kbe42MHP1tJa/fpP5g07Cs= +go-micro.dev/v4 v4.8.1 h1:6/3YtUQ+ofkMJh98lC8TkpuMGoFS8kVcj0cnkQhzwDY= +go-micro.dev/v4 v4.8.1/go.mod h1:Ju8HrZ5hQSF+QguZ2QUs9Kbe42MHP1tJa/fpP5g07Cs= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= From 349f171f17b6b8001d06304bf5ddeb6836389880 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Mon, 22 Aug 2022 12:11:37 +0200 Subject: [PATCH 078/103] bump reva --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 96e95bcda0..5184c8fcf5 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 - github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 + github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 diff --git a/go.sum b/go.sum index 86599db2d3..c3ae47cecd 100644 --- a/go.sum +++ b/go.sum @@ -295,6 +295,8 @@ github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa h1:v7dsI1tidpyQ0o github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 h1:+VZ5D5rIfT7DHVntyQfr4MNV+vqBixbI/dOAG6MQSaQ= github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= +github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614 h1:gvsRe7JW8WE9IxTxFAwhOa3kbB7dkeTRP2mq3XxRXEA= +github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= From f297e833af2b289277d6bf7b4ea26d47767fb9d6 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Mon, 22 Aug 2022 11:07:19 +0000 Subject: [PATCH 079/103] Automated changelog update [skip ci] --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45f9475404..23e5eca450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The following sections list the changes for unreleased. * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) +* Enhancement - Bump reva version: [#4412](https://github.com/owncloud/ocis/pull/4412) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) @@ -54,6 +55,12 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4403 +* Enhancement - Bump reva version: [#4412](https://github.com/owncloud/ocis/pull/4412) + + Bumps reva version + + https://github.com/owncloud/ocis/pull/4412 + * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) We've added an /app/open-with-web endpoint to the app provider, so that clients that are no From 976a91c6413540c5df89dbe8368ebbf3e5a2ff8a Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Mon, 22 Aug 2022 11:07:58 +0000 Subject: [PATCH 080/103] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23e5eca450..f62a5fcc7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1473,7 +1473,7 @@ The following sections list the changes for 2.0.0-beta.6. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -1641,11 +1641,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -1814,23 +1831,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 12d42e00746fb6f4050f645bb864403549ce4de5 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 22 Aug 2022 14:15:13 +0200 Subject: [PATCH 081/103] add missing comments --- services/proxy/pkg/middleware/authentication.go | 1 - services/proxy/pkg/middleware/basic_auth.go | 1 + services/proxy/pkg/middleware/oidc_auth.go | 1 + services/proxy/pkg/middleware/public_share_auth.go | 1 + services/proxy/pkg/middleware/signed_url_auth.go | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index a218546760..93a023038f 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -67,7 +67,6 @@ const ( ) // Authenticator is the common interface implemented by all request authenticators. - type Authenticator interface { // Authenticate is used to authenticate incoming HTTP requests. // The Authenticator may augment the request with user info or anything related to the diff --git a/services/proxy/pkg/middleware/basic_auth.go b/services/proxy/pkg/middleware/basic_auth.go index eb8f79847b..913e740486 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -16,6 +16,7 @@ type BasicAuthenticator struct { UserOIDCClaim string } +// Authenticate implements the authenticator interface to authenticate requests via basic auth. func (m BasicAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { if isPublicPath(r.URL.Path) { // The authentication of public path requests is handled by another authenticator. diff --git a/services/proxy/pkg/middleware/oidc_auth.go b/services/proxy/pkg/middleware/oidc_auth.go index 36adeeb296..c89f83d5cc 100644 --- a/services/proxy/pkg/middleware/oidc_auth.go +++ b/services/proxy/pkg/middleware/oidc_auth.go @@ -239,6 +239,7 @@ func (m OIDCAuthenticator) getProvider() OIDCProvider { return m.provider } +// Authenticate implements the authenticator interface to authenticate requests via oidc auth. func (m OIDCAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { // there is no bearer token on the request, if !m.shouldServe(r) || isPublicPath(r.URL.Path) { diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index cab9b6ebf3..8f82bf7203 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -25,6 +25,7 @@ type PublicShareAuthenticator struct { RevaGatewayClient gateway.GatewayAPIClient } +// Authenticate implements the authenticator interface to authenticate requests via public share auth. func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { if !isPublicPath(r.URL.Path) { return nil, false diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index 2455e8eecf..793f6d8adc 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -186,6 +186,7 @@ func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string return res.Records[0].Value, nil } +// Authenticate implements the authenticator interface to authenticate requests via signed URL auth. func (m SignedURLAuthenticator) Authenticate(r *http.Request) (*http.Request, bool) { if !m.shouldServe(r) { return nil, false From dfe703291f09243b2aab2e931da08d33225f5ebe Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 22 Aug 2022 15:08:01 +0200 Subject: [PATCH 082/103] replace strings.Title with cases.Title --- services/proxy/pkg/middleware/authentication.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 93a023038f..6d430c0038 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -7,6 +7,8 @@ import ( "strings" "github.com/owncloud/ocis/v2/services/proxy/pkg/webdav" + "golang.org/x/text/cases" + "golang.org/x/text/language" ) var ( @@ -96,10 +98,11 @@ func Authentication(auths []Authenticator, opts ...Option) func(next http.Handle if !isPublicPath(r.URL.Path) { // Failed basic authentication attempts receive the Www-Authenticate header in the response var touch bool + caser := cases.Title(language.Und) for k, v := range options.CredentialsByUserAgent { if strings.Contains(k, r.UserAgent()) { removeSuperfluousAuthenticate(w) - w.Header().Add("Www-Authenticate", fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), r.Host)) + w.Header().Add("Www-Authenticate", fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(v), r.Host)) touch = true break } @@ -175,8 +178,9 @@ func configureSupportedChallenges(options Options) { } func writeSupportedAuthenticateHeader(w http.ResponseWriter, r *http.Request) { + caser := cases.Title(language.Und) for _, s := range SupportedAuthStrategies { - w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(s), r.Host)) + w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(s), r.Host)) } } @@ -213,12 +217,13 @@ func evalRequestURI(l userAgentLocker, r regexp.Regexp) { if !r.MatchString(l.r.RequestURI) { return } + caser := cases.Title(language.Und) for k, v := range l.locks { if strings.Contains(k, l.r.UserAgent()) { removeSuperfluousAuthenticate(l.w) - l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(v), l.r.Host)) + l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(v), l.r.Host)) return } } - l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", strings.Title(l.fallback), l.r.Host)) + l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(l.fallback), l.r.Host)) } From 9506bfc8db492044b4ccaa8d3c56f9ed6363eb7b Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 22 Aug 2022 14:39:31 +0000 Subject: [PATCH 083/103] Automated changelog update [skip ci] --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f62a5fcc7c..ae1332d58a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The following sections list the changes for unreleased. * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) +* Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) * Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) ## Details @@ -86,6 +87,14 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/issues/4084 https://github.com/owncloud/ocis/pull/4365 +* Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) + + There were some flaws in the authentication middleware which were resolved by this rewrite. + This rewrite also introduced the need to manually mark certain paths as "unprotected" if + requests to these paths must not be authenticated. + + https://github.com/owncloud/ocis/pull/4374 + * Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) Updated reva to version x.x.x. This update includes: From cb2822b8b741a67a1ac33500f7b98bb4f4b7afd2 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Tue, 23 Aug 2022 10:42:27 +0200 Subject: [PATCH 084/103] [tests-only] [full-ci] ApiTest. after each test users delete their personal space (#4433) * after each test users delete their personal space * Simplify deleteAllPersonalSpaces * Simplify deleteAllPersonalSpaces() Co-authored-by: Phil Davis --- ...ected-failures-localAPI-on-OCIS-storage.md | 4 -- .../features/bootstrap/SpacesContext.php | 42 ++++++++++++++----- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 0170f03fe7..a636c8ba43 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -21,7 +21,3 @@ The expected failures in this file are from features in the owncloud/ocis repo. ### [Search by shares jail works incorrect](https://github.com/owncloud/ocis/issues/4014) - [apiSpaces/search.feature:43](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/search.feature#L43) - -### [Changing personal drive quota on another user as admin is not possible](https://github.com/owncloud/ocis/issues/4325) -- [apiSpaces/changeSpaces.feature:221](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changeSpaces.feature#L221) - diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 43c96caeea..590b085a7c 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -126,14 +126,8 @@ class SpacesContext implements Context { $this->createdSpaces[$spaceName] = $spaceCreator; } - /** - * @var array - */ - private array $availableSpaces; + private array $availableSpaces = []; - /** - * @var array - */ private array $lastPublicLinkData = []; /** @@ -378,7 +372,7 @@ class SpacesContext implements Context { /** * using method from core to set share data - * + * * @return void */ public function setLastShareData(): void { @@ -428,11 +422,11 @@ class SpacesContext implements Context { public function cleanDataAfterTests(): void { // TODO enable when admin can disable and delete spaces // $this->deleteAllSpacesOfTheType('project'); - // $this->deleteAllSpacesOfTheType('personal'); + $this->deleteAllPersonalSpaces(); } /** - * The method first disables and then deletes spaces + * Admin first disables and then deletes spaces * * @param string $driveType * @@ -463,6 +457,32 @@ class SpacesContext implements Context { } } + /** + * users delete their personal space at the end of the test + * + * @return void + * + * @throws Exception|GuzzleException + */ + public function deleteAllPersonalSpaces(): void { + $query = "\$filter=driveType eq personal"; + $createdUsers= $this->featureContext->getCreatedUsers(); + + foreach($createdUsers as $user) { + $this->theUserListsAllHisAvailableSpacesUsingTheGraphApi( + $user["actualUsername"], + $query + ); + $drives = $this->getAvailableSpaces(); + foreach ($drives as $value) { + if (!\array_key_exists("deleted", $value["root"])) { + $this->sendDisableSpaceRequest($user["actualUsername"], $value["name"]); + } + $this->sendDeleteSpaceRequest($user["actualUsername"], $value["name"]); + } + } + } + /** * Send Graph List My Spaces Request * @@ -3013,7 +3033,7 @@ class SpacesContext implements Context { $space = $this->getSpaceByName($user, $spaceName); $body = $space['id']; } - + $url = "/apps/files_sharing/api/v1/shares?reshares=true&space_ref=" . $body; $this->ocsContext->userSendsHTTPMethodToOcsApiEndpointWithBody( From 4e8da994e589b5887f269dd693a4e464229fc752 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Tue, 23 Aug 2022 09:26:06 +0545 Subject: [PATCH 085/103] Bump commit id for tests and update expected to faile file --- .drone.env | 2 +- .../expected-failures-API-on-OCIS-storage.md | 202 +++++------------- 2 files changed, 54 insertions(+), 150 deletions(-) diff --git a/.drone.env b/.drone.env index bf41b89dff..8811cf1a15 100644 --- a/.drone.env +++ b/.drone.env @@ -1,5 +1,5 @@ # The test runner source for API tests -CORE_COMMITID=f79fbff0a0d129df7b6ec20bc202665c4fda5fad +CORE_COMMITID=db3913cd9ba67b2d603f8917017734903dfd432a CORE_BRANCH=master # The test runner source for UI tests diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index e39067d0ab..c1e25a26f3 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -195,22 +195,22 @@ Synchronization features like etag propagation, setting mtime and locking files - [apiWebdavLocks2/resharedSharesToShares.feature:32](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L32) - [apiWebdavLocks2/resharedSharesToShares.feature:33](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L33) - [apiWebdavLocks2/resharedSharesToShares.feature:34](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L34) -- [apiWebdavLocks2/resharedSharesToShares.feature:61](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L61) -- [apiWebdavLocks2/resharedSharesToShares.feature:62](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L62) -- [apiWebdavLocks2/resharedSharesToShares.feature:63](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L63) -- [apiWebdavLocks2/resharedSharesToShares.feature:64](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L64) -- [apiWebdavLocks2/resharedSharesToShares.feature:87](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L87) -- [apiWebdavLocks2/resharedSharesToShares.feature:88](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L88) -- [apiWebdavLocks2/resharedSharesToShares.feature:89](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L89) -- [apiWebdavLocks2/resharedSharesToShares.feature:90](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L90) -- [apiWebdavLocks2/resharedSharesToShares.feature:109](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L109) -- [apiWebdavLocks2/resharedSharesToShares.feature:110](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L110) -- [apiWebdavLocks2/resharedSharesToShares.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L111) -- [apiWebdavLocks2/resharedSharesToShares.feature:112](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L112) -- [apiWebdavLocks2/resharedSharesToShares.feature:136](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L136) -- [apiWebdavLocks2/resharedSharesToShares.feature:137](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L137) -- [apiWebdavLocks2/resharedSharesToShares.feature:138](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L138) -- [apiWebdavLocks2/resharedSharesToShares.feature:139](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L139) +- [apiWebdavLocks2/resharedSharesToShares.feature:55](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L55) +- [apiWebdavLocks2/resharedSharesToShares.feature:56](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L56) +- [apiWebdavLocks2/resharedSharesToShares.feature:57](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L57) +- [apiWebdavLocks2/resharedSharesToShares.feature:58](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L58) +- [apiWebdavLocks2/resharedSharesToShares.feature:75](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L75) +- [apiWebdavLocks2/resharedSharesToShares.feature:76](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L76) +- [apiWebdavLocks2/resharedSharesToShares.feature:77](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L77) +- [apiWebdavLocks2/resharedSharesToShares.feature:78](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L78) +- [apiWebdavLocks2/resharedSharesToShares.feature:97](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L97) +- [apiWebdavLocks2/resharedSharesToShares.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L98) +- [apiWebdavLocks2/resharedSharesToShares.feature:99](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L99) +- [apiWebdavLocks2/resharedSharesToShares.feature:100](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L100) +- [apiWebdavLocks2/resharedSharesToShares.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L118) +- [apiWebdavLocks2/resharedSharesToShares.feature:119](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L119) +- [apiWebdavLocks2/resharedSharesToShares.feature:120](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L120) +- [apiWebdavLocks2/resharedSharesToShares.feature:121](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L121) - [apiWebdavLocks2/setTimeout.feature:24](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeout.feature#L24) - [apiWebdavLocks2/setTimeout.feature:25](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeout.feature#L25) - [apiWebdavLocks2/setTimeout.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeout.feature#L26) @@ -270,16 +270,16 @@ Synchronization features like etag propagation, setting mtime and locking files - [apiWebdavLocks2/setTimeoutSharesToShares.feature:39](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L39) - [apiWebdavLocks2/setTimeoutSharesToShares.feature:40](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L40) - [apiWebdavLocks2/setTimeoutSharesToShares.feature:41](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L41) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:57](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L57) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:58](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L58) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:59](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L59) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:60](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L60) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:61](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L61) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:62](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L62) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:63](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L63) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:64](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L64) +- [apiWebdavLocks2/setTimeoutSharesToShares.feature:65](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L65) - [apiWebdavLocks2/setTimeoutSharesToShares.feature:66](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L66) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:67](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L67) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:68](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L68) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:69](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L69) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:70](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L70) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:71](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L71) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:72](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L72) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:73](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L73) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:74](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L74) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:75](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L75) - [apiWebdavLocks3/independentLocks.feature:25](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks3/independentLocks.feature#L25) - [apiWebdavLocks3/independentLocks.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks3/independentLocks.feature#L26) - [apiWebdavLocks3/independentLocks.feature:27](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks3/independentLocks.feature#L27) @@ -447,10 +447,6 @@ File and sync features in a shared scenario - [apiShareManagementToShares/mergeShare.feature:105](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L105) -#### [not possible to move file into a received folder](https://github.com/owncloud/ocis/issues/764) - -- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:500](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L500) - #### [File deletion using dav gives unique string in filename in the trashbin](https://github.com/owncloud/product/issues/178) - [apiShareManagementBasicToShares/deleteShareFromShares.feature:67](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/deleteShareFromShares.feature#L67) @@ -588,13 +584,11 @@ cannot share a folder with create permission - [apiShareOperationsToShares1/changingFilesShare.feature:25](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L25) - [apiShareOperationsToShares1/changingFilesShare.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L26) -- [apiShareOperationsToShares1/changingFilesShare.feature:31](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L31) -- [apiShareOperationsToShares1/changingFilesShare.feature:119](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L119) -- [apiShareOperationsToShares1/changingFilesShare.feature:120](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L120) -- [apiShareOperationsToShares1/changingFilesShare.feature:125](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L125) -- [apiShareOperationsToShares1/changingFilesShare.feature:146](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L146) -- [apiShareOperationsToShares1/changingFilesShare.feature:147](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L147) -- [apiShareOperationsToShares1/changingFilesShare.feature:152](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L152) +- [apiShareOperationsToShares1/changingFilesShare.feature:110](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L110) +- [apiShareOperationsToShares1/changingFilesShare.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L111) +- [apiShareOperationsToShares1/changingFilesShare.feature:131](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L131) +- [apiShareOperationsToShares1/changingFilesShare.feature:132](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L132) +- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:500](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L500) - [apiVersions/fileVersionsSharingToShares.feature:220](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersionsSharingToShares.feature#L220) - [apiVersions/fileVersionsSharingToShares.feature:221](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersionsSharingToShares.feature#L221) @@ -602,18 +596,12 @@ Scenario Outline: Moving a file into a shared folder as the sharee and as the sh - [apiWebdavMove2/moveShareOnOcis.feature:30](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L30) - [apiWebdavMove2/moveShareOnOcis.feature:32](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L32) - Scenario Outline: Moving a file out of a shared folder as the sharee and as the sharer -- [apiWebdavMove2/moveShareOnOcis.feature:60](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L60) -- [apiWebdavMove2/moveShareOnOcis.feature:62](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L62) Scenario Outline: Moving a folder into a shared folder as the sharee and as the sharer -- [apiWebdavMove2/moveShareOnOcis.feature:91](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L91) -- [apiWebdavMove2/moveShareOnOcis.feature:93](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L93) - Scenario Outline: Moving a folder out of a shared folder as the sharee and as the sharer -- [apiWebdavMove2/moveShareOnOcis.feature:124](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L124) -- [apiWebdavMove2/moveShareOnOcis.feature:126](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L126) +- [apiWebdavMove2/moveShareOnOcis.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L98) +- [apiWebdavMove2/moveShareOnOcis.feature:100](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L100) Scenario Outline: Moving a file to a shared folder with no permissions -- [apiWebdavMove2/moveShareOnOcis.feature:152](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L152) -- [apiWebdavMove2/moveShareOnOcis.feature:153](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L153) +- [apiWebdavMove2/moveShareOnOcis.feature:169](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L169) +- [apiWebdavMove2/moveShareOnOcis.feature:170](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L170) #### [restoring an older version of a shared file deletes the share](https://github.com/owncloud/ocis/issues/765) @@ -742,17 +730,6 @@ Scenario Outline: Moving a file into a shared folder as the sharee and as the sh - [apiShareReshareToShares3/reShareWithExpiryDate.feature:234](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareWithExpiryDate.feature#L234) - [apiShareReshareToShares3/reShareWithExpiryDate.feature:235](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareReshareToShares3/reShareWithExpiryDate.feature#L235) -#### [incorrect ocs(v2) status value when sharing to group that does not exist should be 404, gives 998](https://github.com/owncloud/product/issues/250) - -_ocs: api compatibility, return correct status code_ - -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:85](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L85) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:86](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L86) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:87](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L87) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:88](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L88) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:89](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L89) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:90](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L90) - #### [Cannot move folder/file from one received share to another](https://github.com/owncloud/ocis/issues/2442) - [apiShareUpdateToShares/updateShare.feature:242](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L242) @@ -918,67 +895,20 @@ _ocdav: api compatibility, return correct status code_ - [apiFavorites/favorites.feature:116](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L116) - [apiFavorites/favorites.feature:141](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L141) - [apiFavorites/favorites.feature:142](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L142) -- [apiFavorites/favorites.feature:267](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L267) -- [apiFavorites/favorites.feature:268](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L268) +- [apiFavorites/favorites.feature:262](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L262) +- [apiFavorites/favorites.feature:263](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L263) And other missing implementation of favorites -- [apiFavorites/favorites.feature:162](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L162) -- [apiFavorites/favorites.feature:163](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L163) -- [apiFavorites/favorites.feature:187](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L187) +- [apiFavorites/favorites.feature:182](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L182) +- [apiFavorites/favorites.feature:183](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L183) - [apiFavorites/favorites.feature:188](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L188) -- [apiFavorites/favorites.feature:193](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L193) -- [apiFavorites/favorites.feature:220](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L220) +- [apiFavorites/favorites.feature:215](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L215) +- [apiFavorites/favorites.feature:216](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L216) - [apiFavorites/favorites.feature:221](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L221) -- [apiFavorites/favorites.feature:226](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L226) -- [apiFavorites/favoritesSharingToShares.feature:82](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L82) -- [apiFavorites/favoritesSharingToShares.feature:88](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L88) - -#### [resource inside Shares dir is not found using the spaces WebDAV API](https://github.com/owncloud/ocis/issues/2968) - -- [apiFavorites/favorites.feature:168](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L168) -- [apiFavorites/favoritesSharingToShares.feature:28](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L28) -- [apiFavorites/favoritesSharingToShares.feature:48](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L48) - [apiFavorites/favoritesSharingToShares.feature:67](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L67) -- [apiFavorites/favoritesSharingToShares.feature:83](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L83) -- [apiFavorites/favoritesSharingToShares.feature:108](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L108) -- [apiWebdavUploadTUS/uploadToShare.feature:31](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L31) -- [apiWebdavUploadTUS/uploadToShare.feature:50](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L50) -- [apiWebdavUploadTUS/uploadToShare.feature:72](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L72) -- [apiWebdavUploadTUS/uploadToShare.feature:93](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L93) -- [apiWebdavUploadTUS/uploadToShare.feature:135](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L135) -- [apiWebdavUploadTUS/uploadToShare.feature:159](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L159) -- [apiWebdavUploadTUS/uploadToShare.feature:182](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L182) -- [apiWebdavUploadTUS/uploadToShare.feature:205](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L205) -- [apiWebdavUploadTUS/uploadToShare.feature:230](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L230) -- [apiWebdavUploadTUS/uploadToShare.feature:254](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L254) -- [apiWebdavUploadTUS/uploadToShare.feature:301](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L301) -- [apiWebdavUploadTUS/uploadToShare.feature:326](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L326) -- [apiWebdavLocks2/resharedSharesToShares.feature:117](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L117) -- [apiWebdavLocks2/resharedSharesToShares.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L118) -- [apiWebdavLocks2/resharedSharesToShares.feature:144](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L144) -- [apiWebdavLocks2/resharedSharesToShares.feature:145](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L145) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:46](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L46) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:47](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L47) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:48](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L48) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:49](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L49) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:50](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L50) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:80](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L80) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:81](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L81) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:82](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L82) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:83](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L83) -- [apiWebdavLocks2/setTimeoutSharesToShares.feature:84](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L84) -- [apiShareOperationsToShares1/changingFilesShare.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L98) -- [apiShareOperationsToShares1/changingFilesShare.feature:173](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L173) -- [apiWebdavMove2/moveShareOnOcis.feature:38](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L38) -- [apiWebdavMove2/moveShareOnOcis.feature:39](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L39) -- [apiWebdavMove2/moveShareOnOcis.feature:68](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L68) -- [apiWebdavMove2/moveShareOnOcis.feature:99](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L99) -- [apiWebdavMove2/moveShareOnOcis.feature:100](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L100) -- [apiWebdavMove2/moveShareOnOcis.feature:132](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L132) -- [apiWebdavMove2/moveShareOnOcis.feature:158](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L158) -- [apiWebdavMove2/moveShareOnOcis.feature:185](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L185) -- [apiWebdavMove2/moveShareOnOcis.feature:220](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L220) +- [apiFavorites/favoritesSharingToShares.feature:68](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favoritesSharingToShares.feature#L68) + #### [WWW-Authenticate header for unauthenticated requests is not clear](https://github.com/owncloud/ocis/issues/2285) @@ -1095,18 +1025,16 @@ And other missing implementation of favorites - [apiWebdavUploadTUS/optionsRequest.feature:21](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/optionsRequest.feature#L21) - [apiWebdavUploadTUS/optionsRequest.feature:33](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/optionsRequest.feature#L33) - [apiWebdavUploadTUS/optionsRequest.feature:47](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/optionsRequest.feature#L47) -- [apiWebdavUploadTUS/uploadToShare.feature:224](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L224) -- [apiWebdavUploadTUS/uploadToShare.feature:225](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L225) -- [apiWebdavUploadTUS/uploadToShare.feature:248](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L248) -- [apiWebdavUploadTUS/uploadToShare.feature:249](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L249) -- [apiWebdavUploadTUS/uploadToShare.feature:272](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L272) -- [apiWebdavUploadTUS/uploadToShare.feature:273](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L273) -- [apiWebdavUploadTUS/uploadToShare.feature:278](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L278) -- [apiWebdavUploadTUS/uploadToShare.feature:320](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L320) -- [apiWebdavUploadTUS/uploadToShare.feature:321](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L321) -- [apiWebdavUploadTUS/uploadToShare.feature:372](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L372) -- [apiWebdavUploadTUS/uploadToShare.feature:373](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L373) -- [apiWebdavUploadTUS/uploadToShare.feature:378](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L378) +- [apiWebdavUploadTUS/uploadToShare.feature:181](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L181) +- [apiWebdavUploadTUS/uploadToShare.feature:182](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L182) +- [apiWebdavUploadTUS/uploadToShare.feature:200](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L200) +- [apiWebdavUploadTUS/uploadToShare.feature:201](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L201) +- [apiWebdavUploadTUS/uploadToShare.feature:219](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L219) +- [apiWebdavUploadTUS/uploadToShare.feature:220](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L220) +- [apiWebdavUploadTUS/uploadToShare.feature:258](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L258) +- [apiWebdavUploadTUS/uploadToShare.feature:259](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L259) +- [apiWebdavUploadTUS/uploadToShare.feature:300](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L300) +- [apiWebdavUploadTUS/uploadToShare.feature:301](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L301) #### [TUS OPTIONS requests do not reply with TUS headers when invalid password](https://github.com/owncloud/ocis/issues/1012) @@ -1275,14 +1203,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiShareManagementToShares/moveShareInsideAnotherShare.feature:86](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/moveShareInsideAnotherShare.feature#L86) - [apiShareManagementToShares/moveShareInsideAnotherShare.feature:100](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/moveShareInsideAnotherShare.feature#L100) -#### [unable to create resource using TUS inside Shares dir](https://github.com/owncloud/ocis/issues/3048) - -- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:33](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L33) -- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:52](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L52) -- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:73](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L73) -- [apiWebdavUploadTUS/uploadFileMtimeShares.feature:94](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadFileMtimeShares.feature#L94) -- [apiWebdavUploadTUS/uploadToShare.feature:352](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavUploadTUS/uploadToShare.feature#L352) - #### [Renaming resource to banned name is allowed in spaces webdav](https://github.com/owncloud/ocis/issues/3099) - [apiWebdavMove1/moveFolder.feature:27](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove1/moveFolder.feature#L27) @@ -1297,7 +1217,7 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiFavorites/favorites.feature:121](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L121) - [apiFavorites/favorites.feature:147](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L147) -- [apiFavorites/favorites.feature:273](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L273) +- [apiFavorites/favorites.feature:268](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiFavorites/favorites.feature#L268) #### [could not create system tag](https://github.com/owncloud/ocis/issues/3092) @@ -1315,13 +1235,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiWebdavOperations/listFiles.feature:442](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/listFiles.feature#L442) - [apiWebdavOperations/listFiles.feature:448](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/listFiles.feature#L448) -### [[spaces webdav] upload to a share that was locked by owner ends with status code 409](https://github.com/owncloud/ocis/issues/3128) - -- [apiWebdavLocks2/resharedSharesToShares.feature:39](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L39) -- [apiWebdavLocks2/resharedSharesToShares.feature:40](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L40) -- [apiWebdavLocks2/resharedSharesToShares.feature:69](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L69) -- [apiWebdavLocks2/resharedSharesToShares.feature:70](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/resharedSharesToShares.feature#L70) - #### [Renaming resource to excluded directory name is allowed in spaces webdav](https://github.com/owncloud/ocis/issues/3102) - [apiWebdavMove2/moveFileToExcludedDirectory.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveFileToExcludedDirectory.feature#L26) @@ -1340,15 +1253,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [apiWebdavOperations/refuseAccess.feature:36](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/refuseAccess.feature#L36) - [apiWebdavOperations/refuseAccess.feature:41](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavOperations/refuseAccess.feature#L41) -### [GraphAPI groups are case in-sensitive](https://github.com/owncloud/ocis/issues/4291) - -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:49](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L49) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:50](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L50) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:51](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L51) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:52](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L52) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:53](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L53) -- [apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature:54](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareCreateSpecialToShares2/createShareGroupCaseSensitive.feature#L54) - #### [OCS status code zero](https://github.com/owncloud/ocis/issues/3621) - [apiShareManagementToShares/moveReceivedShare.feature:32](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/moveReceivedShare.feature#L32) From faa7d3b6474a271469d6519cc00c63c1f2dc448b Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 23 Aug 2022 14:29:04 +0200 Subject: [PATCH 086/103] add config options for mail encryption and authentication --- ...mail-authentication-encryption-settings.md | 10 +++ .../examples/ocis_traefik/docker-compose.yml | 3 +- .../notifications/pkg/channels/channels.go | 65 ++++++++++++++++--- services/notifications/pkg/config/config.go | 13 ++-- .../pkg/config/defaults/defaultconfig.go | 8 ++- 5 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 changelog/unreleased/enhancement-mail-authentication-encryption-settings.md diff --git a/changelog/unreleased/enhancement-mail-authentication-encryption-settings.md b/changelog/unreleased/enhancement-mail-authentication-encryption-settings.md new file mode 100644 index 0000000000..1148c126aa --- /dev/null +++ b/changelog/unreleased/enhancement-mail-authentication-encryption-settings.md @@ -0,0 +1,10 @@ +Enhancement: Add configuration options for mail authentication and encryption + +We've added configuration options to configure the authentication and encryption +for sending mails in the notifications service. + +Furthermore there is now a distinguished configuration option for the username to use +for authentication against the mail server. This allows you to customize the sender address +to your liking. For example sender addresses like `my oCIS instance ` are now possible, too. + +https://github.com/owncloud/ocis/pull/4443 diff --git a/deployments/examples/ocis_traefik/docker-compose.yml b/deployments/examples/ocis_traefik/docker-compose.yml index 38e1405947..1b37ca17aa 100644 --- a/deployments/examples/ocis_traefik/docker-compose.yml +++ b/deployments/examples/ocis_traefik/docker-compose.yml @@ -68,7 +68,8 @@ services: # email server (in this case inbucket acts as mail catcher) NOTIFICATIONS_SMTP_HOST: inbucket NOTIFICATIONS_SMTP_PORT: 2500 - NOTIFICATIONS_SMTP_SENDER: notifications@${OCIS_DOMAIN:-ocis.owncloud.test} + NOTIFICATIONS_SMTP_SENDER: oCIS notifications + NOTIFICATIONS_SMTP_USERNAME: notifications@${OCIS_DOMAIN:-ocis.owncloud.test} NOTIFICATIONS_SMTP_INSECURE: true # the mail catcher uses self signed certificates volumes: - ocis-config:/etc/ocis diff --git a/services/notifications/pkg/channels/channels.go b/services/notifications/pkg/channels/channels.go index 896dc8afcf..0612939980 100644 --- a/services/notifications/pkg/channels/channels.go +++ b/services/notifications/pkg/channels/channels.go @@ -4,6 +4,7 @@ package channels import ( "context" "crypto/tls" + "strings" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" groups "github.com/cs3org/go-cs3apis/cs3/identity/group/v1beta1" @@ -45,6 +46,59 @@ type Mail struct { logger log.Logger } +func (m Mail) getMailClient() (*mail.SMTPClient, error) { + server := mail.NewSMTPClient() + server.Host = m.conf.Notifications.SMTP.Host + server.Port = m.conf.Notifications.SMTP.Port + server.Username = m.conf.Notifications.SMTP.Username + if server.Username == "" { + // compatibility fallback + server.Username = m.conf.Notifications.SMTP.Sender + } + server.Password = m.conf.Notifications.SMTP.Password + if server.TLSConfig == nil { + server.TLSConfig = &tls.Config{} + } + server.TLSConfig.InsecureSkipVerify = m.conf.Notifications.SMTP.Insecure + + switch strings.ToLower(m.conf.Notifications.SMTP.Authentication) { + case "login": + server.Authentication = mail.AuthLogin + case "plain": + server.Authentication = mail.AuthPlain + case "crammd5": + server.Authentication = mail.AuthCRAMMD5 + case "none": + server.Authentication = mail.AuthNone + default: + return nil, errors.New("unknown mail authentication method") + } + + switch strings.ToLower(m.conf.Notifications.SMTP.Encryption) { + case "tls": + server.Encryption = mail.EncryptionTLS + server.TLSConfig.ServerName = m.conf.Notifications.SMTP.Host + case "starttls": + server.Encryption = mail.EncryptionSTARTTLS + server.TLSConfig.ServerName = m.conf.Notifications.SMTP.Host + case "ssl": + server.Encryption = mail.EncryptionSSL + case "ssltls": + server.Encryption = mail.EncryptionSSLTLS + case "none": + server.Encryption = mail.EncryptionNone + default: + return nil, errors.New("unknown mail encryption method") + } + + smtpClient, err := server.Connect() + if err != nil { + return nil, err + } + + return smtpClient, nil +} + // SendMessage sends a message to all given users. func (m Mail) SendMessage(userIDs []string, msg string) error { if m.conf.Notifications.SMTP.Host == "" { @@ -56,22 +110,13 @@ func (m Mail) SendMessage(userIDs []string, msg string) error { return err } - server := mail.NewSMTPClient() - server.Host = m.conf.Notifications.SMTP.Host - server.Port = m.conf.Notifications.SMTP.Port - server.Username = m.conf.Notifications.SMTP.Sender - server.Password = m.conf.Notifications.SMTP.Password - server.TLSConfig = &tls.Config{InsecureSkipVerify: m.conf.Notifications.SMTP.Insecure} - - smtpClient, err := server.Connect() + smtpClient, err := m.getMailClient() if err != nil { return err } email := mail.NewMSG() - email.SetFrom(m.conf.Notifications.SMTP.Sender).AddTo(to...) - email.SetBody(mail.TextPlain, msg) return email.Send(smtpClient) diff --git a/services/notifications/pkg/config/config.go b/services/notifications/pkg/config/config.go index ba23d12c61..849f1ac1ff 100644 --- a/services/notifications/pkg/config/config.go +++ b/services/notifications/pkg/config/config.go @@ -30,11 +30,14 @@ type Notifications struct { // SMTP combines the smtp configuration options. type SMTP struct { - Host string `yaml:"smtp_host" env:"NOTIFICATIONS_SMTP_HOST" desc:"SMTP host to connect to."` - Port int `yaml:"smtp_port" env:"NOTIFICATIONS_SMTP_PORT" desc:"Port of the SMTP host to connect to."` - Sender string `yaml:"smtp_sender" env:"NOTIFICATIONS_SMTP_SENDER" desc:"Sender of emails that will be sent."` - Password string `yaml:"smtp_password" env:"NOTIFICATIONS_SMTP_PASSWORD" desc:"Password of the SMTP host to connect to."` - Insecure bool `yaml:"insecure" env:"NOTIFICATIONS_SMTP_INSECURE" desc:"Allow insecure connections to the SMTP server."` + Host string `yaml:"smtp_host" env:"NOTIFICATIONS_SMTP_HOST" desc:"SMTP host to connect to."` + Port int `yaml:"smtp_port" env:"NOTIFICATIONS_SMTP_PORT" desc:"Port of the SMTP host to connect to."` + Sender string `yaml:"smtp_sender" env:"NOTIFICATIONS_SMTP_SENDER" desc:"Sender address of emails that will be sent."` + Username string `yaml:"smtp_username" env:"NOTIFICATIONS_SMTP_USERNAME" desc:"Username for the SMTP host to connect to."` + Password string `yaml:"smtp_password" env:"NOTIFICATIONS_SMTP_PASSWORD" desc:"Password for the SMTP host to connect to."` + Insecure bool `yaml:"insecure" env:"NOTIFICATIONS_SMTP_INSECURE" desc:"Allow insecure connections to the SMTP server."` + Authentication string `yaml:"smtp_authentication" env:"NOTIFICATIONS_SMTP_AUTHENTICATION" desc:"Authentication method for the SMTP communication. Possible values are 'login', 'plain', 'crammd5', 'none'"` + Encryption string `yaml:"smtp_encryption" env:"NOTIFICATIONS_SMTP_ENCRYPTION" desc:"Encryption method for the SMTP communication. Possible values are 'starttls', 'ssl', 'ssltls', 'tls' and 'none'."` } // Events combines the configuration options for the event bus. diff --git a/services/notifications/pkg/config/defaults/defaultconfig.go b/services/notifications/pkg/config/defaults/defaultconfig.go index acd443345b..849592926c 100644 --- a/services/notifications/pkg/config/defaults/defaultconfig.go +++ b/services/notifications/pkg/config/defaults/defaultconfig.go @@ -24,9 +24,11 @@ func DefaultConfig() *config.Config { }, Notifications: config.Notifications{ SMTP: config.SMTP{ - Host: "", - Port: 1025, - Sender: "noreply@example.com", + Host: "", + Port: 1025, + Sender: "ownCloud ", + Authentication: "none", + Encryption: "none", }, Events: config.Events{ Endpoint: "127.0.0.1:9233", From d10f52197297258ec144f7d97a37695035ca01e7 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 23 Aug 2022 16:16:23 +0200 Subject: [PATCH 087/103] chore: update reva to v2.8.0 --- changelog/unreleased/bump-reva.md | 5 ----- changelog/unreleased/update-reva-beta.7.md | 15 +++++++++++---- go.mod | 6 +++--- go.sum | 12 ++++-------- 4 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 changelog/unreleased/bump-reva.md diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md deleted file mode 100644 index dc839ad3ab..0000000000 --- a/changelog/unreleased/bump-reva.md +++ /dev/null @@ -1,5 +0,0 @@ -Enhancement: Bump reva version - -Bumps reva version - -https://github.com/owncloud/ocis/pull/4412 diff --git a/changelog/unreleased/update-reva-beta.7.md b/changelog/unreleased/update-reva-beta.7.md index b81c362c0e..2f7039eca3 100644 --- a/changelog/unreleased/update-reva-beta.7.md +++ b/changelog/unreleased/update-reva-beta.7.md @@ -1,7 +1,14 @@ -Enhancement: update reva to vx.x.x +Enhancement: update reva to v2.8.0 -Updated reva to version x.x.x. This update includes: +Updated reva to version 2.8.0. This update includes: -* TODO: +* Bugfix [cs3org/reva#3158](https://github.com/cs3org/reva/pull/3158): Add name to the propfind response +* Bugfix [cs3org/reva#3157](https://github.com/cs3org/reva/pull/3157): Fix locking response codes +* Bugfix [cs3org/reva#3152](https://github.com/cs3org/reva/pull/3152): Disable caching of not found stat responses +* Bugfix [cs3org/reva#4251](https://github.com/cs3org/reva/pull/4251): Disable caching +* Enhancement [cs3org/reva#3154](https://github.com/cs3org/reva/pull/3154): Dataproviders now return file metadata +* Enhancement [cs3org/reva#3143](https://github.com/cs3org/reva/pull/3143): Add /app/open-with-web endpoint +* Enhancement [cs3org/reva#3156](https://github.com/cs3org/reva/pull/3156): Added language option to the app provider +* Enhancement [cs3org/reva#3148](https://github.com/cs3org/reva/pull/3148): Add new jsoncs3 share manager -https://github.com/owncloud/ocis/pull/4376 +https://github.com/owncloud/ocis/pull/4444 diff --git a/go.mod b/go.mod index 3007aa0900..df5865fa01 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/blevesearch/bleve/v2 v2.3.3 github.com/blevesearch/bleve_index_api v1.0.2 github.com/coreos/go-oidc/v3 v3.2.0 - github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 - github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614 + github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d + github.com/cs3org/reva/v2 v2.8.0 github.com/disintegration/imaging v1.6.2 github.com/ggwhite/go-masker v1.0.9 github.com/go-chi/chi/v5 v5.0.7 @@ -77,6 +77,7 @@ require ( golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 + golang.org/x/text v0.3.7 google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 @@ -268,7 +269,6 @@ require ( golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect - golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect golang.org/x/tools v0.1.10 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect diff --git a/go.sum b/go.sum index f03cb5998c..b6c3b9e86b 100644 --- a/go.sum +++ b/go.sum @@ -289,14 +289,10 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4= github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4= github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A= -github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64 h1:cFnankJOCWndnOns4sKRG7yzH61ammK2Am6rEGWCK40= -github.com/cs3org/go-cs3apis v0.0.0-20220719130120-361e9f987d64/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa h1:v7dsI1tidpyQ0oiElSc30NO9rNcgpvJuzLileslTN1s= -github.com/cs3org/reva/v2 v2.7.5-0.20220818081459-b272f45c35aa/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= -github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8 h1:+VZ5D5rIfT7DHVntyQfr4MNV+vqBixbI/dOAG6MQSaQ= -github.com/cs3org/reva/v2 v2.7.5-0.20220818145858-9c40953ac4a8/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= -github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614 h1:gvsRe7JW8WE9IxTxFAwhOa3kbB7dkeTRP2mq3XxRXEA= -github.com/cs3org/reva/v2 v2.7.5-0.20220822092927-15d066642614/go.mod h1:AfRiy0Uu9OR0rqZKMMlMvAkrlEC6yppfJTa+mJ2LNhI= +github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d h1:toyZ7IsXlUdEPZ/IG8fg7hbM8HcLPY0bkX4FKBmgLVI= +github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= +github.com/cs3org/reva/v2 v2.8.0 h1:8QtZ3oQB/96yY6GjvjFF73vbM+YAiSmdje41yHrdFms= +github.com/cs3org/reva/v2 v2.8.0/go.mod h1:+BYVpRV8g1hL8wF3+3BunL9BKPsXVyJYmH8COxq/V7Y= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= From bf97c626754304f93a8a3f4e3462bc494281c062 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 19:45:45 +0000 Subject: [PATCH 088/103] Bump github.com/urfave/cli/v2 from 2.11.1 to 2.11.2 Bumps [github.com/urfave/cli/v2](https://github.com/urfave/cli) from 2.11.1 to 2.11.2. - [Release notes](https://github.com/urfave/cli/releases) - [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md) - [Commits](https://github.com/urfave/cli/compare/v2.11.1...v2.11.2) --- updated-dependencies: - dependency-name: github.com/urfave/cli/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index df5865fa01..42d2a3cc7a 100644 --- a/go.mod +++ b/go.mod @@ -61,7 +61,7 @@ require ( github.com/test-go/testify v1.1.4 github.com/thejerf/suture/v4 v4.0.2 github.com/tus/tusd v1.9.0 - github.com/urfave/cli/v2 v2.11.1 + github.com/urfave/cli/v2 v2.11.2 github.com/xhit/go-simple-mail/v2 v2.11.0 go-micro.dev/v4 v4.8.1 go.etcd.io/bbolt v1.3.6 diff --git a/go.sum b/go.sum index b6c3b9e86b..712e09f4a5 100644 --- a/go.sum +++ b/go.sum @@ -1183,8 +1183,8 @@ github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/urfave/cli/v2 v2.11.1 h1:UKK6SP7fV3eKOefbS87iT9YHefv7iB/53ih6e+GNAsE= -github.com/urfave/cli/v2 v2.11.1/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= +github.com/urfave/cli/v2 v2.11.2 h1:FVfNg4m3vbjbBpLYxW//WjxUoHvJ9TlppXcqY9Q9ZfA= +github.com/urfave/cli/v2 v2.11.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= From f3e623779600ca955556b7d810cc03ea16c884e9 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 23 Aug 2022 19:45:58 +0000 Subject: [PATCH 089/103] Automated changelog update [skip ci] --- CHANGELOG.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae1332d58a..bd0f104c7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,12 +11,11 @@ The following sections list the changes for unreleased. * Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) * Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) -* Enhancement - Bump reva version: [#4412](https://github.com/owncloud/ocis/pull/4412) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) * Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) -* Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) +* Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) ## Details @@ -56,12 +55,6 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4403 -* Enhancement - Bump reva version: [#4412](https://github.com/owncloud/ocis/pull/4412) - - Bumps reva version - - https://github.com/owncloud/ocis/pull/4412 - * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) We've added an /app/open-with-web endpoint to the app provider, so that clients that are no @@ -95,13 +88,20 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4374 -* Enhancement - Update reva to vx.x.x: [#4376](https://github.com/owncloud/ocis/pull/4376) +* Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) - Updated reva to version x.x.x. This update includes: + Updated reva to version 2.8.0. This update includes: - * TODO: + * Bugfix [cs3org/reva#3158](https://github.com/cs3org/reva/pull/3158): Add name to the propfind response + * Bugfix [cs3org/reva#3157](https://github.com/cs3org/reva/pull/3157): Fix locking response codes + * Bugfix [cs3org/reva#3152](https://github.com/cs3org/reva/pull/3152): Disable caching of not found stat responses + * Bugfix [cs3org/reva#4251](https://github.com/cs3org/reva/pull/4251): Disable caching + * Enhancement [cs3org/reva#3154](https://github.com/cs3org/reva/pull/3154): Dataproviders now return file metadata + * Enhancement [cs3org/reva#3143](https://github.com/cs3org/reva/pull/3143): Add /app/open-with-web endpoint + * Enhancement [cs3org/reva#3156](https://github.com/cs3org/reva/pull/3156): Added language option to the app provider + * Enhancement [cs3org/reva#3148](https://github.com/cs3org/reva/pull/3148): Add new jsoncs3 share manager - https://github.com/owncloud/ocis/pull/4376 + https://github.com/owncloud/ocis/pull/4444 # Changelog for [2.0.0-beta.6] (2022-08-11) The following sections list the changes for 2.0.0-beta.6. From 992c19d26a62b74f479c90f40f310c0b958b27cd Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Tue, 23 Aug 2022 13:07:47 +0200 Subject: [PATCH 090/103] chore: update web to v5.7.0-rc.10 --- .drone.env | 2 +- changelog/unreleased/update-web-beta.7.md | 31 +++++++++++++++++++++++ services/web/Makefile | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/update-web-beta.7.md diff --git a/.drone.env b/.drone.env index 8811cf1a15..a8f36753cf 100644 --- a/.drone.env +++ b/.drone.env @@ -3,5 +3,5 @@ CORE_COMMITID=db3913cd9ba67b2d603f8917017734903dfd432a CORE_BRANCH=master # The test runner source for UI tests -WEB_COMMITID=52c0a3e8d0c0a2a8a342ed2656254afe03725260 +WEB_COMMITID=4828c892d292dbccd382104c11486bc5d21340b0 WEB_BRANCH=master diff --git a/changelog/unreleased/update-web-beta.7.md b/changelog/unreleased/update-web-beta.7.md new file mode 100644 index 0000000000..47f3991c1c --- /dev/null +++ b/changelog/unreleased/update-web-beta.7.md @@ -0,0 +1,31 @@ +Enhancement: Update ownCloud Web to v5.7.0-rc.10 + +Tags: web + +We updated ownCloud Web to v5.7.0-rc.10. Please refer to the changelog (linked) for details on the web release. + +* Bugfix [owncloud/web#7443](https://github.com/owncloud/web/pull/7443): Datetime formatting +* Bugfix [owncloud/web#7437](https://github.com/owncloud/web/pull/7437): Default to user context +* Bugfix [owncloud/web#7473](https://github.com/owncloud/web/pull/7473): Dragging a file causes no selection +* Bugfix [owncloud/web#7469](https://github.com/owncloud/web/pull/7469): File size not updated while restoring file version +* Bugfix [owncloud/web#7443](https://github.com/owncloud/web/pull/7443): File size formatting +* Bugfix [owncloud/web#7474](https://github.com/owncloud/web/pull/7474): Load only supported thumbnails (configurable) +* Bugfix [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): SidebarNavItem icon flickering +* Bugfix [owncloud/web#7425](https://github.com/owncloud/web/pull/7425): Open Folder in project space context menu +* Bugfix [owncloud/web#7486](https://github.com/owncloud/web/issues/7486): Prevent unnecessary PROPFIND request during upload +* Bugfix [owncloud/web#7415](https://github.com/owncloud/web/pull/7415): Re-fetch quota +* Bugfix [owncloud/web#7478](https://github.com/owncloud/web/issues/7478): "Shared via"-indicator for links +* Bugfix [owncloud/web#7480](https://github.com/owncloud/web/issues/7480): Missing space image in sidebar +* Bugfix [owncloud/web#7436](https://github.com/owncloud/web/issues/7436): Hide share actions for space viewers/editors +* Bugfix [owncloud/web#7445](https://github.com/owncloud/web/pull/7445): User management app close side bar throws error +* Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Keyboard shortcut indicators in ContextMenu +* Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Lowlight cut resources +* Enhancement [owncloud/web#7133](https://github.com/owncloud/web/pull/7133): Permissionless (internal) link shares +* Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Replace locationpicker with clipboard actions +* Enhancement [owncloud/web#7363](https://github.com/owncloud/web/pull/7363): Streamline UI sizings +* Enhancement [owncloud/web#7355](https://github.com/owncloud/web/pull/7355): Update ODS to v14.0.0-alpha.16 +* Enhancement [owncloud/web#7476](https://github.com/owncloud/web/pull/7476): Users table on small screen +* Enhancement [owncloud/web#7182](https://github.com/owncloud/web/pull/7182): User management app edit quota + +https://github.com/owncloud/ocis/pull/4439 +https://github.com/owncloud/web/releases/tag/v5.7.0-rc.10 diff --git a/services/web/Makefile b/services/web/Makefile index 662c784822..331ef4ab29 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -1,6 +1,6 @@ SHELL := bash NAME := web -WEB_ASSETS_VERSION = v5.7.0-rc.9 +WEB_ASSETS_VERSION = v5.7.0-rc.10 include ../../.make/recursion.mk From 6043e019f478557f184b8b1f387de712fca6849f Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 23 Aug 2022 13:32:32 +0200 Subject: [PATCH 091/103] add the fonts path to the unprotected path prefixes --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 6d430c0038..c61207149b 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -56,6 +56,7 @@ var ( "/.well-known", "/js", "/css", + "/fonts", "/icons", "/themes", "/signin", From 28a9bf357e49401ce82625925dbbc110fa0fb0ed Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 23 Aug 2022 13:41:05 +0200 Subject: [PATCH 092/103] end unprotected path prefixes with a slash --- .../proxy/pkg/middleware/authentication.go | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index c61207149b..4f77f36b09 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -45,22 +45,22 @@ var ( } // _unprotectedPathPrefixes contains paths which don't need to be authenticated. _unprotectedPathPrefixes = [...]string{ - "/files", - "/data", - "/account", + "/files/", + "/data/", + "/account/", "/s/", "/external/spaces", "/apps/openidconnect/redirect", - "/settings", - "/user-management", - "/.well-known", - "/js", - "/css", - "/fonts", - "/icons", - "/themes", - "/signin", - "/konnect", + "/settings/", + "/user-management/", + "/.well-known/", + "/js/", + "/css/", + "/fonts/", + "/icons/", + "/themes/", + "/signin/", + "/konnect/", } ) From dd49462bace95c8e3d81e847fae85e428928ffa5 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 24 Aug 2022 09:09:53 +0200 Subject: [PATCH 093/103] ci: delete accounts frontend app from ci config.json --- tests/config/drone/ocis-config.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/config/drone/ocis-config.json b/tests/config/drone/ocis-config.json index d8ee1513fb..5c181dedd0 100644 --- a/tests/config/drone/ocis-config.json +++ b/tests/config/drone/ocis-config.json @@ -31,10 +31,6 @@ { "id": "settings", "path": "https://ocis-server:9200/settings.js" - }, - { - "id": "accounts", - "path": "https://ocis-server:9200/accounts.js" } ] } From add2364c6dda5b4e6e723b815a93d1271bd5cb24 Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Wed, 24 Aug 2022 08:50:47 +0000 Subject: [PATCH 094/103] Automated changelog update [skip ci] --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd0f104c7a..9ad87afddb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The following sections list the changes for unreleased. * Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) * Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) +* Enhancement - Add configuration options for mail authentication and encryption: [#4443](https://github.com/owncloud/ocis/pull/4443) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) * Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) * Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) @@ -72,6 +73,18 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4399 https://github.com/cs3org/reva/pull/3156 +* Enhancement - Add configuration options for mail authentication and encryption: [#4443](https://github.com/owncloud/ocis/pull/4443) + + We've added configuration options to configure the authentication and encryption for + sending mails in the notifications service. + + Furthermore there is now a distinguished configuration option for the username to use for + authentication against the mail server. This allows you to customize the sender address to + your liking. For example sender addresses like `my oCIS instance ` are + now possible, too. + + https://github.com/owncloud/ocis/pull/4443 + * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) The new command `ocis idm resetpassword` allows to reset the administrator password when ocis From e65eb15f2c3305e068dd5059ffee48cc16cf0460 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 24 Aug 2022 11:04:18 +0200 Subject: [PATCH 095/103] add the settings path to the unprotected paths --- services/proxy/pkg/middleware/authentication.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 4f77f36b09..99dced8d68 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -30,6 +30,7 @@ var ( _unprotectedPaths = map[string]struct{}{ "/": {}, "/login": {}, + "/settings": {}, "/app/list": {}, "/config.json": {}, "/manifest.json": {}, From 1565fe6f1eac3aff35de5ccb22e0b24ee14e2791 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 24 Aug 2022 10:08:52 +0000 Subject: [PATCH 096/103] Automated changelog update [skip ci] --- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ad87afddb..6d713b5276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The following sections list the changes for unreleased. * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) * Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) * Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) +* Enhancement - Update ownCloud Web to v5.7.0-rc.10: [#4439](https://github.com/owncloud/ocis/pull/4439) ## Details @@ -115,6 +116,39 @@ The following sections list the changes for unreleased. * Enhancement [cs3org/reva#3148](https://github.com/cs3org/reva/pull/3148): Add new jsoncs3 share manager https://github.com/owncloud/ocis/pull/4444 + +* Enhancement - Update ownCloud Web to v5.7.0-rc.10: [#4439](https://github.com/owncloud/ocis/pull/4439) + + Tags: web + + We updated ownCloud Web to v5.7.0-rc.10. Please refer to the changelog (linked) for details on + the web release. + + * Bugfix [owncloud/web#7443](https://github.com/owncloud/web/pull/7443): Datetime formatting + * Bugfix [owncloud/web#7437](https://github.com/owncloud/web/pull/7437): Default to user context + * Bugfix [owncloud/web#7473](https://github.com/owncloud/web/pull/7473): Dragging a file causes no selection + * Bugfix [owncloud/web#7469](https://github.com/owncloud/web/pull/7469): File size not updated while restoring file version + * Bugfix [owncloud/web#7443](https://github.com/owncloud/web/pull/7443): File size formatting + * Bugfix [owncloud/web#7474](https://github.com/owncloud/web/pull/7474): Load only supported thumbnails (configurable) + * Bugfix [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): SidebarNavItem icon flickering + * Bugfix [owncloud/web#7425](https://github.com/owncloud/web/pull/7425): Open Folder in project space context menu + * Bugfix [owncloud/web#7486](https://github.com/owncloud/web/issues/7486): Prevent unnecessary PROPFIND request during upload + * Bugfix [owncloud/web#7415](https://github.com/owncloud/web/pull/7415): Re-fetch quota + * Bugfix [owncloud/web#7478](https://github.com/owncloud/web/issues/7478): "Shared via"-indicator for links + * Bugfix [owncloud/web#7480](https://github.com/owncloud/web/issues/7480): Missing space image in sidebar + * Bugfix [owncloud/web#7436](https://github.com/owncloud/web/issues/7436): Hide share actions for space viewers/editors + * Bugfix [owncloud/web#7445](https://github.com/owncloud/web/pull/7445): User management app close side bar throws error + * Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Keyboard shortcut indicators in ContextMenu + * Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Lowlight cut resources + * Enhancement [owncloud/web#7133](https://github.com/owncloud/web/pull/7133): Permissionless (internal) link shares + * Enhancement [owncloud/web#7309](https://github.com/owncloud/web/pull/7309): Replace locationpicker with clipboard actions + * Enhancement [owncloud/web#7363](https://github.com/owncloud/web/pull/7363): Streamline UI sizings + * Enhancement [owncloud/web#7355](https://github.com/owncloud/web/pull/7355): Update ODS to v14.0.0-alpha.16 + * Enhancement [owncloud/web#7476](https://github.com/owncloud/web/pull/7476): Users table on small screen + * Enhancement [owncloud/web#7182](https://github.com/owncloud/web/pull/7182): User management app edit quota + + https://github.com/owncloud/ocis/pull/4439 + https://github.com/owncloud/web/releases/tag/v5.7.0-rc.10 # Changelog for [2.0.0-beta.6] (2022-08-11) The following sections list the changes for 2.0.0-beta.6. From c7a6d5a0aac2c9a7a3b442c36f4237428f770701 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Tue, 23 Aug 2022 13:48:30 +0200 Subject: [PATCH 097/103] add ability to delete project space after test --- .../features/bootstrap/SpacesContext.php | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 590b085a7c..a498656b54 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -420,38 +420,44 @@ class SpacesContext implements Context { * @throws Exception|GuzzleException */ public function cleanDataAfterTests(): void { - // TODO enable when admin can disable and delete spaces - // $this->deleteAllSpacesOfTheType('project'); + $this->deleteAllProjectSpaces(); $this->deleteAllPersonalSpaces(); } /** - * Admin first disables and then deletes spaces - * - * @param string $driveType + * manager of the project space first disables and then deletes spaces * * @return void * * @throws Exception|GuzzleException */ - public function deleteAllSpacesOfTheType(string $driveType): void { - $query = "\$filter=driveType eq $driveType"; + public function deleteAllProjectSpaces(): void { + $query = "\$filter=driveType eq project"; $userAdmin = $this->featureContext->getAdminUsername(); - for ($i = 0; $i < 2; ++$i) { - $this->theUserListsAllAvailableSpacesUsingTheGraphApi( - $userAdmin, - $query - ); - $drives = $this->getAvailableSpaces(); + $this->theUserListsAllAvailableSpacesUsingTheGraphApi( + $userAdmin, + $query + ); + $drives = $this->getAvailableSpaces(); + $createdUsers = $this->featureContext->getCreatedUsers(); - if (!empty($drives)) { - foreach ($drives as $value) { - if (!\array_key_exists("deleted", $value["root"])) { - $this->sendDisableSpaceRequest($userAdmin, $value["name"]); - } else { - $this->sendDeleteSpaceRequest($userAdmin, $value["name"]); - } + foreach ($drives as $value) { + foreach ($value["root"]["permissions"] as $permissions) { + // find an user who is a manager + if ($permissions["roles"][0] === "manager") { + $userId = $permissions["grantedTo"][0]["user"]["id"]; + + foreach ($createdUsers as $user) { + if ($user["id"] === $userId) { + $userName = $user["actualUsername"]; + + if (!\array_key_exists("deleted", $value["root"])) { + $this->sendDisableSpaceRequest($userName, $value["name"]); + } + $this->sendDeleteSpaceRequest($userName, $value["name"]); + } + } } } } @@ -466,9 +472,9 @@ class SpacesContext implements Context { */ public function deleteAllPersonalSpaces(): void { $query = "\$filter=driveType eq personal"; - $createdUsers= $this->featureContext->getCreatedUsers(); + $createdUsers = $this->featureContext->getCreatedUsers(); - foreach($createdUsers as $user) { + foreach ($createdUsers as $user) { $this->theUserListsAllHisAvailableSpacesUsingTheGraphApi( $user["actualUsername"], $query @@ -901,13 +907,11 @@ class SpacesContext implements Context { $drives = $drives["value"]; } - Assert::assertArrayHasKey(0, $drives, "No drives were found on that endpoint"); $spaces = []; foreach ($drives as $drive) { $spaces[$drive["name"]] = $drive; } $this->setAvailableSpaces($spaces); - Assert::assertNotEmpty($spaces, "No spaces have been found"); } /** @@ -3027,7 +3031,7 @@ class SpacesContext implements Context { string $fileName = '' ): void { $body = ''; - if (!empty ($fileName)) { + if (!empty($fileName)) { $body = $this->getFileId($user, $spaceName, $fileName); } else { $space = $this->getSpaceByName($user, $spaceName); From 07af8544e8adbf60c1dfc8c218e4342963b6bb5a Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Fri, 19 Aug 2022 17:16:12 +0545 Subject: [PATCH 098/103] Added test for creating group with case sensitive --- .drone.star | 1 + tests/acceptance/config/behat.yml | 10 ++++++- ...ected-failures-localAPI-on-OCIS-storage.md | 8 ++++++ .../apiGraph/createGroupCaseSensitive.feature | 21 +++++++++++++++ .../features/bootstrap/GraphContext.php | 26 +++++++++++++++++++ 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature diff --git a/.drone.star b/.drone.star index 95fe42377f..2ad14a48fd 100644 --- a/.drone.star +++ b/.drone.star @@ -339,6 +339,7 @@ def testPipelines(ctx): localApiTests(ctx, "ocis", "apiAccountsHashDifficulty"), localApiTests(ctx, "ocis", "apiSpaces"), localApiTests(ctx, "ocis", "apiArchiver"), + localApiTests(ctx, "ocis", "apiGraph"), ] if "skip" not in config["apiTests"] or not config["apiTests"]["skip"]: diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 6d50a05fac..c2afae62f6 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -6,7 +6,7 @@ default: apiAccountsHashDifficulty: paths: - '%paths.base%/../features/apiAccountsHashDifficulty' - context: + context: &common_ldap_suite_context parameters: ldapAdminPassword: admin ldapUsersOU: TestUsers @@ -58,5 +58,13 @@ default: - FilesVersionsContext: - PublicWebDavContext: + apiGraph: + paths: + - '%paths.base%/../features/apiGraph' + context: *common_ldap_suite_context + contexts: + - GraphContext: + - FeatureContext: *common_feature_context_params + extensions: Cjm\Behat\StepThroughExtension: ~ diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index a636c8ba43..95d2ea3412 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -21,3 +21,11 @@ The expected failures in this file are from features in the owncloud/ocis repo. ### [Search by shares jail works incorrect](https://github.com/owncloud/ocis/issues/4014) - [apiSpaces/search.feature:43](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/search.feature#L43) + +### [create request for already existing user exits with status code 500 ](https://github.com/owncloud/ocis/issues/3516) +- [apiGraph/createGroupCaseSensitive.feature:16](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L16) +- [apiGraph/createGroupCaseSensitive.feature:17](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L17) +- [apiGraph/createGroupCaseSensitive.feature:18](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L18) +- [apiGraph/createGroupCaseSensitive.feature:19](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L19) +- [apiGraph/createGroupCaseSensitive.feature:20](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L20) +- [apiGraph/createGroupCaseSensitive.feature:21](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L21) diff --git a/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature b/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature new file mode 100644 index 0000000000..d29236562b --- /dev/null +++ b/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature @@ -0,0 +1,21 @@ +@api +Feature: create groups, group names are case insensitive + + Scenario Outline: group names are case insensitive, creating groups with different upper and lower case names + Given using OCS API version "" + And group "" has been created + When the administrator creates a group "" using the Graph API + And the administrator creates a group "" using the Graph API + Then the HTTP status code of responses on all endpoints should be "400" + And these groups should not exist: + | groupname | + | | + | | + Examples: + | ocs_api_version | group_id1 | group_id2 | group_id3 | + | 1 | case-sensitive-group | Case-Sensitive-Group | CASE-SENSITIVE-GROUP | + | 1 | Case-Sensitive-Group | CASE-SENSITIVE-GROUP | case-sensitive-group | + | 1 | CASE-SENSITIVE-GROUP | case-sensitive-group | Case-Sensitive-Group | + | 2 | case-sensitive-group | Case-Sensitive-Group | CASE-SENSITIVE-GROUP | + | 2 | Case-Sensitive-Group | CASE-SENSITIVE-GROUP | case-sensitive-group | + | 2 | CASE-SENSITIVE-GROUP | case-sensitive-group | Case-Sensitive-Group | diff --git a/tests/acceptance/features/bootstrap/GraphContext.php b/tests/acceptance/features/bootstrap/GraphContext.php index 062975342d..ac45b1e7e8 100644 --- a/tests/acceptance/features/bootstrap/GraphContext.php +++ b/tests/acceptance/features/bootstrap/GraphContext.php @@ -428,6 +428,32 @@ class GraphContext implements Context { } } + /** + * @When /^the administrator creates a group "([^"]*)" using the Graph API$/ + * + * @param string $group + * + * @return void + * @throws Exception + * @throws GuzzleException + */ + public function adminCreatesGroupUsingTheGraphApi(string $group): void { + $response = GraphHelper::createGroup( + $this->featureContext->getBaseUrl(), + $this->featureContext->getStepLineRef(), + $this->featureContext->getAdminUsername(), + $this->featureContext->getAdminPassword(), + $group, + ); + $this->featureContext->setResponse($response); + $this->featureContext->pushToLastHttpStatusCodesArray((string) $response->getStatusCode()); + + if ($response->getStatusCode() === 200) { + $groupId = $this->featureContext->getJsonDecodedResponse($response)["id"]; + $this->featureContext->addGroupToCreatedGroupsList($group, true, true, $groupId); + } + } + /** * create group with provided data * From 0d2b7e350b3e61a99ef75523e99b064003015dca Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 24 Aug 2022 16:32:25 +0200 Subject: [PATCH 099/103] add missing unprotected paths --- changelog/unreleased/missing-unprotected-paths.md | 5 +++++ services/proxy/pkg/middleware/authentication.go | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 changelog/unreleased/missing-unprotected-paths.md diff --git a/changelog/unreleased/missing-unprotected-paths.md b/changelog/unreleased/missing-unprotected-paths.md new file mode 100644 index 0000000000..80bc4f57d8 --- /dev/null +++ b/changelog/unreleased/missing-unprotected-paths.md @@ -0,0 +1,5 @@ +Enhancement: Add missing unprotected paths + +Added missing unprotected paths for the text-editor, preview, pdf-viewer and draw-io to the authentication middleware. + +https://github.com/owncloud/ocis/pull/4454 diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 99dced8d68..b73dd215a0 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -62,6 +62,10 @@ var ( "/themes/", "/signin/", "/konnect/", + "/text-editor/", + "/preview/", + "/pdf-viewer/", + "/draw-io/", } ) From b57bdc0492cf6302e1ae712b19cb0afc0c7824a5 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Wed, 24 Aug 2022 15:11:52 +0000 Subject: [PATCH 100/103] Automated changelog update [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d713b5276..423e1b623d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The following sections list the changes for unreleased. * Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) * Enhancement - Add configuration options for mail authentication and encryption: [#4443](https://github.com/owncloud/ocis/pull/4443) * Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) +* Enhancement - Add missing unprotected paths: [#4454](https://github.com/owncloud/ocis/pull/4454) * Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) * Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) * Enhancement - Update ownCloud Web to v5.7.0-rc.10: [#4439](https://github.com/owncloud/ocis/pull/4439) @@ -94,6 +95,13 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/issues/4084 https://github.com/owncloud/ocis/pull/4365 +* Enhancement - Add missing unprotected paths: [#4454](https://github.com/owncloud/ocis/pull/4454) + + Added missing unprotected paths for the text-editor, preview, pdf-viewer and draw-io to the + authentication middleware. + + https://github.com/owncloud/ocis/pull/4454 + * Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) There were some flaws in the authentication middleware which were resolved by this rewrite. From 9c9a81026c8fbab73d82e573fe4ffc995964e1d0 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Thu, 25 Aug 2022 10:39:55 +0200 Subject: [PATCH 101/103] fix: add index.html to unprotected paths in auth middleware --- changelog/unreleased/missing-unprotected-paths.md | 3 ++- services/proxy/pkg/middleware/authentication.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog/unreleased/missing-unprotected-paths.md b/changelog/unreleased/missing-unprotected-paths.md index 80bc4f57d8..492f09036d 100644 --- a/changelog/unreleased/missing-unprotected-paths.md +++ b/changelog/unreleased/missing-unprotected-paths.md @@ -1,5 +1,6 @@ Enhancement: Add missing unprotected paths -Added missing unprotected paths for the text-editor, preview, pdf-viewer and draw-io to the authentication middleware. +Added missing unprotected paths for the text-editor, preview, pdf-viewer, draw-io and index.html to the authentication middleware. https://github.com/owncloud/ocis/pull/4454 +https://github.com/owncloud/ocis/pull/4458 diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index b73dd215a0..e645c04eb1 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -66,6 +66,7 @@ var ( "/preview/", "/pdf-viewer/", "/draw-io/", + "/index.html#/", } ) From 9d67ab32929e8e238468a613bfddecc1baac7271 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Thu, 25 Aug 2022 10:47:46 +0200 Subject: [PATCH 102/103] fix: set /external path prefix to unprotected --- services/proxy/pkg/middleware/authentication.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index e645c04eb1..1a554dd46b 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -50,7 +50,7 @@ var ( "/data/", "/account/", "/s/", - "/external/spaces", + "/external", "/apps/openidconnect/redirect", "/settings/", "/user-management/", From f57fe2917d0bf7eb171686f43057c872b33f922d Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Thu, 25 Aug 2022 11:13:10 +0000 Subject: [PATCH 103/103] Automated changelog update [skip ci] --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 423e1b623d..3814acb507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,10 +97,11 @@ The following sections list the changes for unreleased. * Enhancement - Add missing unprotected paths: [#4454](https://github.com/owncloud/ocis/pull/4454) - Added missing unprotected paths for the text-editor, preview, pdf-viewer and draw-io to the - authentication middleware. + Added missing unprotected paths for the text-editor, preview, pdf-viewer, draw-io and + index.html to the authentication middleware. https://github.com/owncloud/ocis/pull/4454 + https://github.com/owncloud/ocis/pull/4458 * Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374)