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/.drone.env b/.drone.env index fb638d1514..a8f36753cf 100644 --- a/.drone.env +++ b/.drone.env @@ -1,7 +1,7 @@ # The test runner source for API tests -CORE_COMMITID=dc5c1f5ce58b63ba9cf799ad81fe5cc50421f6da +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/.drone.star b/.drone.star index c0638c2fd7..2ad14a48fd 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" @@ -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) + \ @@ -239,19 +243,7 @@ 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"), + purgeBuildArtifactCache(ctx), testPipelines(ctx), ), ) @@ -282,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, }, @@ -341,12 +333,13 @@ 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"), localApiTests(ctx, "ocis", "apiSpaces"), localApiTests(ctx, "ocis", "apiArchiver"), + localApiTests(ctx, "ocis", "apiGraph"), ] if "skip" not in config["apiTests"] or not config["apiTests"]["skip"]: @@ -821,7 +814,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", @@ -886,11 +879,13 @@ 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, }] + return [] + def uploadTracingResult(ctx): return [{ "name": "upload-tracing-result", @@ -1016,7 +1011,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", @@ -1961,7 +1956,7 @@ def selenium(): return [ { "name": "selenium", - "image": SELENIUM_STANDALONE_CHROME_DEBUG, + "image": SELENIUM_STANDALONE_CHROME, "volumes": [{ "name": "uploads", "path": "/uploads", @@ -2161,7 +2156,7 @@ def checkStarlark(): }, }] -def genericCache(name, action, mounts, cache_key): +def genericCache(name, action, mounts, cache_path): rebuild = "false" restore = "false" if action == "rebuild": @@ -2187,16 +2182,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", @@ -2216,8 +2213,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, }, }, ], @@ -2234,12 +2231,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): @@ -2248,8 +2247,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 @@ -2814,7 +2813,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"], ], }, { @@ -2825,7 +2831,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"], ], }, { @@ -2834,20 +2840,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", ], }, ] @@ -2859,10 +2885,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"], ], }] @@ -2874,15 +2906,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'", ], }] @@ -2895,15 +2928,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/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000000..11a419de01 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,160 @@ +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 + +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: 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] +# 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/.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/CHANGELOG.md b/CHANGELOG.md index a9508d71e9..3814acb507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,222 +6,163 @@ The following sections list the changes for unreleased. ## 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) +* 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) +* 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 - 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) ## Details -* Bugfix - Fix handling of invalid LDAP users and groups: [#4274](https://github.com/owncloud/ocis/issues/4274) +* Bugfix - Fix configuration of mimetypes for the app registry: [#4411](https://github.com/owncloud/ocis/pull/4411) - We fixed an issue where ocis would exit with a panic when LDAP users or groups where missing - required attributes (e.g. the id) + 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/issues/4274 + https://github.com/owncloud/ocis/pull/4411 -* Bugfix - Fix search in received shares: [#4308](https://github.com/owncloud/ocis/issues/4308) +* Bugfix - Show help for some commands when unconfigured: [#4405](https://github.com/owncloud/ocis/pull/4405) - We fixed a problem where items in received shares were not found. + 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/issues/4308 + https://github.com/owncloud/ocis/pull/4405 -* Bugfix - Substring search for sharees: [#547](https://github.com/owncloud/ocis/issues/547) +* Bugfix - Autocreate IDP private key also if file exists but is empty: [#4394](https://github.com/owncloud/ocis/pull/4394) - 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". + 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. - 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/pull/4394 - https://github.com/owncloud/ocis/issues/547 +* Bugfix - Rename extensions to services (leftover occurences): [#4407](https://github.com/owncloud/ocis/pull/4407) -* Bugfix - Fix unrestricted quota on the graphAPI: [#4363](https://github.com/owncloud/ocis/pull/4363) + We've already renamed extensions to services in previous PRs and this PR peforms this rename + for leftover occurences. - 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/4407 - https://github.com/owncloud/ocis/pull/4363 +* Change - Rename "uploads purge" command to "uploads clean": [#4403](https://github.com/owncloud/ocis/pull/4403) -* Bugfix - Space Creators can hand over spaces: [#4244](https://github.com/owncloud/ocis/pull/4244) + We've renamed the storage-users service's "uploads purge" command to "upload clean". - 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/4403 - https://github.com/owncloud/ocis/pull/4244 +* Enhancement - Add /app/open-with-web endpoint: [#4376](https://github.com/owncloud/ocis/pull/4376) -* Enhancement - Add drives field to users endpoint: [#4072](https://github.com/owncloud/ocis/pull/4072) + 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. - We have added `$expand=drives` to the `/users/{id}/` endpoint using the user filter - implemented in reva. + https://github.com/owncloud/ocis/pull/4376 + https://github.com/cs3org/reva/pull/3143 - https://github.com/owncloud/ocis/pull/4072 - https://github.com/cs3org/reva/pull/3046 - https://github.com/owncloud/ocis/pull/4323 +* Enhancement - Added language option to the app provider: [#4399](https://github.com/owncloud/ocis/pull/4399) -* Enhancement - Improve validation of OIDC access tokens: [#3841](https://github.com/owncloud/ocis/issues/3841) + 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. - 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. + https://github.com/owncloud/ocis/issues/4367 + https://github.com/owncloud/ocis/pull/4399 + https://github.com/cs3org/reva/pull/3156 - 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. +* Enhancement - Add configuration options for mail authentication and encryption: [#4443](https://github.com/owncloud/ocis/pull/4443) - https://github.com/owncloud/ocis/issues/3841 - https://github.com/owncloud/ocis/pull/4227 + We've added configuration options to configure the authentication and encryption for + sending mails in the notifications service. -* Enhancement - Improve error log for "could not get user by claim" error: [#4227](https://github.com/owncloud/ocis/pull/4227) + 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. - 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/4443 - https://github.com/owncloud/ocis/pull/4227 +* Enhancement - Added command to reset administrator password: [#4084](https://github.com/owncloud/ocis/issues/4084) -* Enhancement - Allow providing list of services NOT to start: [#4254](https://github.com/owncloud/ocis/pull/4254) + 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. - 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/issues/4084 + https://github.com/owncloud/ocis/pull/4365 - https://github.com/owncloud/ocis/pull/4254 +* Enhancement - Add missing unprotected paths: [#4454](https://github.com/owncloud/ocis/pull/4454) -* Enhancement - Introduce insecure flag for smtp email notifications: [#4279](https://github.com/owncloud/ocis/pull/4279) + Added missing unprotected paths for the text-editor, preview, pdf-viewer, draw-io and + index.html to the authentication middleware. - 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/4454 + https://github.com/owncloud/ocis/pull/4458 - https://github.com/owncloud/ocis/pull/4279 +* Enhancement - Rewrite of the request authentication middleware: [#4374](https://github.com/owncloud/ocis/pull/4374) -* Enhancement - Fix behavior for foobar (in present tense): [#4346](https://github.com/owncloud/ocis/pull/4346) + 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. - 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. + https://github.com/owncloud/ocis/pull/4374 - Previously this rewrite needed to be performed with an external proxy as NGINX or Traefik if an - external IDP was used. +* Enhancement - Update reva to v2.8.0: [#4444](https://github.com/owncloud/ocis/pull/4444) - https://github.com/owncloud/ocis/issues/2819 - https://github.com/owncloud/ocis/issues/3280 - https://github.com/owncloud/ocis/pull/4346 + Updated reva to version 2.8.0. This update includes: -* Enhancement - Use storageID when requesting special items: [#4356](https://github.com/owncloud/ocis/pull/4356) + * 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 - 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/4444 - 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) +* 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.9. Please refer to the changelog (linked) for details on + 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#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 + * 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/4314 - https://github.com/owncloud/web/releases/tag/v5.7.0-rc.8 + 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) -* Enhancement - Expand personal drive on the graph user: [#4357](https://github.com/owncloud/ocis/pull/4357) +The following sections list the changes for 2.0.0-beta.6. - 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 +179,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 +190,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 +212,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 +229,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 +258,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 +273,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 +393,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 +495,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 +517,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 +571,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 +672,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 +809,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 +860,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 +906,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 +929,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 +1045,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 +1164,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 +1465,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. @@ -1388,7 +1538,7 @@ The following sections list the changes for 2.0.0-beta.5. 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 @@ -1556,11 +1706,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 @@ -1729,23 +1896,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. 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/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/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-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/changelog/unreleased/bugfix-idp-init-certificate-empty-file.md b/changelog/unreleased/bugfix-idp-init-certificate-empty-file.md new file mode 100644 index 0000000000..0b0967669e --- /dev/null +++ b/changelog/unreleased/bugfix-idp-init-certificate-empty-file.md @@ -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/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/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 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/changelog/unreleased/enhancement-app-provider-language-selection.md b/changelog/unreleased/enhancement-app-provider-language-selection.md new file mode 100644 index 0000000000..35fb7b8bef --- /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 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 +https://github.com/cs3org/reva/pull/3156 +https://github.com/owncloud/ocis/issues/4367 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/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/changelog/unreleased/missing-unprotected-paths.md b/changelog/unreleased/missing-unprotected-paths.md new file mode 100644 index 0000000000..492f09036d --- /dev/null +++ b/changelog/unreleased/missing-unprotected-paths.md @@ -0,0 +1,6 @@ +Enhancement: Add missing unprotected paths + +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/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/changelog/unreleased/update-reva-beta.7.md b/changelog/unreleased/update-reva-beta.7.md new file mode 100644 index 0000000000..2f7039eca3 --- /dev/null +++ b/changelog/unreleased/update-reva-beta.7.md @@ -0,0 +1,14 @@ +Enhancement: update reva to v2.8.0 + +Updated reva to version 2.8.0. This update includes: + +* 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/4444 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/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/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/docs/services/app-registry/apps.md b/docs/services/app-registry/apps.md index 39f01d65cc..a6185c6714 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-with-web", "new_url": "/app/new" } ] @@ -178,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-with-web?file_id=ZmlsZTppZAo=' + +curl -X POST 'https://ocis.test/app/open-with-web?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` @@ -202,12 +245,21 @@ HTTP status code: 200 - `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' @@ -319,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` 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 c8be3f9bc9..d6176ff92a 100644 --- a/go.mod +++ b/go.mod @@ -5,18 +5,18 @@ 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 github.com/coreos/go-oidc/v3 v3.2.0 github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d - github.com/cs3org/reva/v2 v2.7.4 + 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 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 @@ -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 @@ -61,9 +61,10 @@ 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.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 go.opentelemetry.io/otel v1.9.0 @@ -75,6 +76,8 @@ 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 + 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 @@ -94,6 +97,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 @@ -120,6 +124,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 @@ -255,7 +260,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 @@ -265,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 063b8084ea..dc1c0fe108 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= @@ -100,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= @@ -124,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= @@ -224,6 +225,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/butonic/reva/v2 v2.0.0-20220819090247-6183f486f61e h1:qt/exkX47WxDvYa9voBD6uFJTLkvXHTf14tD8c4YYwc= github.com/butonic/reva/v2 v2.0.0-20220819090247-6183f486f61e/go.mod h1:+BYVpRV8g1hL8wF3+3BunL9BKPsXVyJYmH8COxq/V7Y= @@ -379,8 +382,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= @@ -402,7 +405,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= @@ -811,8 +813,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= @@ -1016,7 +1018,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= @@ -1182,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= @@ -1225,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= @@ -1310,7 +1311,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= @@ -1451,6 +1451,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= @@ -1560,6 +1561,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= @@ -1570,6 +1572,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/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/configlog/log.go b/ocis-pkg/config/configlog/log.go new file mode 100644 index 0000000000..33079e846d --- /dev/null +++ b/ocis-pkg/config/configlog/log.go @@ -0,0 +1,30 @@ +package configlog + +import ( + "fmt" + "os" +) + +// Error logs the error +func Error(err error) { + if err != nil { + fmt.Printf("%v\n", err) + } +} + +// ReturnError logs the error and returns it unchanged +func ReturnError(err error) error { + if err != nil { + fmt.Printf("%v\n", err) + } + return err +} + +// 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) + } + return nil +} 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/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/ocis/pkg/command/app-provider.go b/ocis/pkg/command/app-provider.go index 89120bd57f..50f20ce766 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.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 b16df293a8..d35fcabb42 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.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 58b4d4e0a6..7299a71a84 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.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 3a850faa67..48a026647c 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.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 be1e360503..413e15e9ef 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.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 336823efab..17c23b632f 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.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 741e96cdce..ae28f41059 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.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 b771d3c9e9..3562ffade5 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.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 4c54deec1e..87e6fe71f6 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.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 ce0acc33e6..4ff45e2313 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.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 5039434894..630f1060ee 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.Error(parser.ParseConfig(cfg, true)) cfg.Groups.Commons = cfg.Commons return nil }, 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/idm.go b/ocis/pkg/command/idm.go index 21862ade96..3adc837388 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.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 6b798bf438..b8f0449c78 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.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 1d04c5a75b..4aa2889fd3 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" oclog "github.com/owncloud/ocis/v2/ocis-pkg/log" "github.com/owncloud/ocis/v2/ocis/pkg/register" @@ -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.ReturnError(err) + } + + // Parse sharing config + cfg.Sharing.Commons = cfg.Commons + return configlog.ReturnError(sharingparser.ParseConfig(cfg.Sharing)) + }, Action: func(c *cli.Context) error { log := oclog.LoggerFromConfig("migrate", cfg.Log) 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.ReturnError(err) + } + + // Parse sharing config + cfg.Sharing.Commons = cfg.Commons + return configlog.ReturnError(sharingparser.ParseConfig(cfg.Sharing)) + }, Action: func(c *cli.Context) error { log := oclog.LoggerFromConfig("migrate", cfg.Log) ctx := log.WithContext(context.Background()) diff --git a/ocis/pkg/command/nats.go b/ocis/pkg/command/nats.go index e8c60061ed..989286c0ae 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.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 0599dc86e8..0fc591f146 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.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 cc04d64884..a46cd3ecf5 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.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 abeb8310bd..89091138c4 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.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 127957bc69..0bdbf71e25 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.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 c649fbce41..59cb691e9e 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.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 c935aba9f1..a83ffd585f 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.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 ec95cf3a17..d5950b2096 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.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 9145f532c5..31ccc40ca2 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.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 04780870c5..1819089247 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.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 e499e008f6..6def892696 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.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 e90af46907..cd933eeeaa 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.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 f1598332bb..980cc953d6 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.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 617af037cd..947779d71e 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.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 da60a12a18..235edfafb3 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.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 992a049285..905c757187 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.Error(parser.ParseConfig(cfg, true)) cfg.Users.Commons = cfg.Commons return nil }, 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/command/web.go b/ocis/pkg/command/web.go index dd826d6b99..e7b1f001df 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.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 20be56b5b0..6acd8ec596 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.Error(parser.ParseConfig(cfg, true)) cfg.WebDAV.Commons = cfg.Commons return nil }, 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/health.go b/services/app-provider/pkg/command/health.go index 9344b8a9ac..23db3c5011 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.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 72fe31104e..a7fc216d07 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" @@ -25,15 +26,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -97,7 +93,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/health.go b/services/app-registry/pkg/command/health.go index d1227a0544..f8331072cc 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.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 f09619d595..aa230570fb 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" @@ -24,15 +25,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -92,7 +88,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/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() + } } 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/command/server.go b/services/audit/pkg/command/server.go index fd904a0095..2537adfdd5 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" @@ -20,15 +20,10 @@ 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 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.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/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/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 { diff --git a/services/auth-basic/pkg/command/health.go b/services/auth-basic/pkg/command/health.go index 48f07427d8..269847ebb8 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.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 4e6a3b5742..4dc4ffba2a 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" @@ -26,15 +27,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -110,7 +106,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/health.go b/services/auth-bearer/pkg/command/health.go index 040e695b26..b562eaa4a3 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.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 cfa598e5c0..4c181bfab9 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" @@ -25,15 +26,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -97,7 +93,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/health.go b/services/auth-machine/pkg/command/health.go index cc26ea7f29..2e04d3a5b5 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.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 7424c30200..bf2ad19cca 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" @@ -25,15 +26,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -97,7 +93,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/health.go b/services/frontend/pkg/command/health.go index 1585868261..041dea70a3 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.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 20719e36cc..6508799699 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" @@ -25,15 +26,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -48,7 +44,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)) @@ -97,7 +96,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/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index 29bcdc1c0b..a247f7b5bd 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 nil, err + } + webURL.Path = path.Join(webURL.Path, "external") + webOpenInAppURL := webURL.String() + archivers := []map[string]interface{}{ { "enabled": true, @@ -23,11 +32,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-with-web", + "new_url": "/app/new", }, } @@ -88,6 +98,18 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { "transfer_shared_secret": cfg.TransferSecret, "timeout": 86400, "insecure": cfg.AppHandler.Insecure, + "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", // TODO: remove when https://github.com/owncloud/web/pull/7437 arrived in oCIS + }, + }, }, "archiver": map[string]interface{}{ "prefix": cfg.Archiver.Prefix, @@ -227,5 +249,5 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} { }, }, }, - } + }, nil } diff --git a/services/gateway/pkg/command/health.go b/services/gateway/pkg/command/health.go index 1dd8229b69..e2b5231ce9 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.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 adb9d6cf5c..f2ddf03afa 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" @@ -24,15 +25,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -92,7 +88,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/health.go b/services/graph-explorer/pkg/command/health.go index b83a33c820..96a4302963 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.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 60586a267c..aa2e5be077 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" @@ -21,15 +21,10 @@ 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 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.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/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/health.go b/services/graph/pkg/command/health.go index e1cbbbd641..b3cf03e9be 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.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 bdcccc2f38..36a8a5cf94 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" @@ -21,15 +21,10 @@ 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 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.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/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/health.go b/services/groups/pkg/command/health.go index 9925b7ce68..8a48fe36c8 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.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 d1e872c422..6605c3dfd3 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" @@ -26,15 +27,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -110,7 +106,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/health.go b/services/idm/pkg/command/health.go index 1b7d5a4841..328ac39690 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.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 new file mode 100644 index 0000000000..415b047922 --- /dev/null +++ b/services/idm/pkg/command/resetpw.go @@ -0,0 +1,114 @@ +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/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" + "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: "Reset admin password", + Category: "password reset", + Before: func(c *cli.Context) error { + return configlog.ReturnFatal(parser.ParseConfig(cfg)) + }, + 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), diff --git a/services/idm/pkg/command/server.go b/services/idm/pkg/command/server.go index bd1cca2b10..f8e8561dc1 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" @@ -26,15 +27,10 @@ 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 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.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/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/health.go b/services/idp/pkg/command/health.go index 687d806fe5..461bd5cbef 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.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 6e6be436ab..a17d0c42d4 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" @@ -32,14 +33,10 @@ 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 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.ReturnFatal(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) @@ -161,12 +158,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 } 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..d281759079 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" @@ -18,15 +18,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) 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/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/command/server.go b/services/notifications/pkg/command/server.go index 91f43b1b93..8685b4e429 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" @@ -19,15 +19,10 @@ 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 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.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/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/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", diff --git a/services/ocdav/pkg/command/health.go b/services/ocdav/pkg/command/health.go index 8724a43adb..c207e17f2d 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.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 d98d9e2f91..f7bc2a91ad 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" @@ -20,15 +20,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -109,7 +104,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/health.go b/services/ocs/pkg/command/health.go index 197c2e1ca8..e4939db9e1 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.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 669fea4f6e..7c3b6c989b 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" @@ -22,15 +22,10 @@ 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 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.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/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/health.go b/services/proxy/pkg/command/health.go index cb9ee814bf..824d626e51 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.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 81342945f1..3627467fca 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" @@ -38,15 +38,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -166,6 +161,43 @@ 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, + }) + } + 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 + return oidc.NewProvider( + context.WithValue(ctx, oauth2.HTTPClient, oidcHTTPClient), + cfg.OIDC.Issuer, + ) + }, + cfg.OIDC.JWKS, + cfg.OIDC.AccessTokenVerifyMethod, + )) + 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 pkgmiddleware.TraceContext, @@ -179,38 +211,12 @@ 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), - - // 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), + 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.AccountResolver( middleware.Logger(logger), @@ -233,9 +239,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/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/proxy/pkg/middleware/authentication.go b/services/proxy/pkg/middleware/authentication.go index 15fa4ec429..1a554dd46b 100644 --- a/services/proxy/pkg/middleware/authentication.go +++ b/services/proxy/pkg/middleware/authentication.go @@ -5,6 +5,10 @@ import ( "net/http" "regexp" "strings" + + "github.com/owncloud/ocis/v2/services/proxy/pkg/webdav" + "golang.org/x/text/cases" + "golang.org/x/text/language" ) var ( @@ -12,48 +16,163 @@ 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", + } + // _unprotectedPaths contains paths which don't need to be authenticated. + _unprotectedPaths = map[string]struct{}{ + "/": {}, + "/login": {}, + "/settings": {}, + "/app/list": {}, + "/config.json": {}, + "/manifest.json": {}, + "/oidc-callback.html": {}, + "/oidc-callback": {}, + "/settings.js": {}, + "/data": {}, + "/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{ + "/files/", + "/data/", + "/account/", + "/s/", + "/external", + "/apps/openidconnect/redirect", + "/settings/", + "/user-management/", + "/.well-known/", + "/js/", + "/css/", + "/fonts/", + "/icons/", + "/themes/", + "/signin/", + "/konnect/", + "/text-editor/", + "/preview/", + "/pdf-viewer/", + "/draw-io/", + "/index.html#/", + } ) -// 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. +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) } // 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) || isUnprotectedPath(r) { + // 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) { + // 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\"", caser.String(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) + } } - if options.OIDCIss == "" && options.EnableBasicAuth { - basic(next).ServeHTTP(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. + // 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", + }) + + 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 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) { + return true + } + } + return false +} + // configureSupportedChallenges adds known authentication challenges to the current session. func configureSupportedChallenges(options Options) { if options.OIDCIss != "" { @@ -66,13 +185,23 @@ 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)) + caser := cases.Title(language.Und) + for _, s := range SupportedAuthStrategies { + w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(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,49 +215,22 @@ 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 + } + 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\"", 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)) } -} - -// 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), - ) + l.w.Header().Add(WwwAuthenticate, fmt.Sprintf("%v realm=\"%s\", charset=\"UTF-8\"", caser.String(l.fallback), l.r.Host)) } 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.go b/services/proxy/pkg/middleware/basic_auth.go index b7d480d87b..913e740486 100644 --- a/services/proxy/pkg/middleware/basic_auth.go +++ b/services/proxy/pkg/middleware/basic_auth.go @@ -1,145 +1,62 @@ 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))) - }, - ) - } +// BasicAuthenticator is the authenticator responsible for HTTP Basic authentication. +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 +// 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. + // 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 := r.BasicAuth() + if !ok { + return nil, false } - return isPublic -} + user, _, err := m.UserProvider.Authenticate(r.Context(), login, password) + if err != nil { + m.Logger.Error(). + Err(err). + Str("authenticator", "basic"). + Str("path", r.URL.Path). + Msg("failed to authenticate request") + 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 + + } + 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/basic_auth_test.go b/services/proxy/pkg/middleware/basic_auth_test.go index 46c7f48285..fcc2e6f3ce 100644 --- a/services/proxy/pkg/middleware/basic_auth_test.go +++ b/services/proxy/pkg/middleware/basic_auth_test.go @@ -1,40 +1,68 @@ package middleware import ( + "context" + "net/http" "net/http/httptest" - "testing" + + 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" ) -/**/ - -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}, - } - ba := basicAuth{} - - for _, tt := range tests { - req := httptest.NewRequest("", tt.url, nil) - - if tt.username != "" { - req.SetBasicAuth(tt.username, "") +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 + }, + }, } + }) - result := ba.isPublicLink(req) - if result != tt.expected { - t.Errorf("with %s expected %t got %t", tt.url, tt.expected, result) - } - } -} + 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.go b/services/proxy/pkg/middleware/oidc_auth.go index ae3b313f08..c89f83d5cc 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,90 +16,63 @@ 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 " +) + // OIDCProvider used to mock the oidc provider during tests 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) - - h := oidcAuth{ - logger: options.Logger, - providerFunc: options.OIDCProviderFunc, - httpClient: options.HTTPClient, - oidcIss: options.OIDCIss, +// 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) + return OIDCAuthenticator{ + Logger: logger, tokenCache: &tokenCache, - tokenCacheTTL: options.UserinfoCacheTTL, - accessTokenVerifyMethod: options.AccessTokenVerifyMethod, - jwksOptions: options.JWKS, - jwksLock: &sync.Mutex{}, + TokenCacheTTL: time.Duration(tokenCacheTTL), + HTTPClient: oidcHTTPClient, + OIDCIss: oidcIss, + ProviderFunc: providerFunc, + JWKSOptions: jwksOptions, + AccessTokenVerifyMethod: accessTokenVerifyMethod, providerLock: &sync.Mutex{}, - } - - 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{}, } } -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 +// OIDCAuthenticator is an authenticator responsible for OIDC authentication. +type OIDCAuthenticator struct { + Logger log.Logger + HTTPClient *http.Client + OIDCIss string tokenCache *osync.Cache - tokenCacheTTL time.Duration - accessTokenVerifyMethod string + TokenCacheTTL time.Duration + ProviderFunc func() (OIDCProvider, error) + AccessTokenVerifyMethod string + JWKSOptions config.JWKS + + providerLock *sync.Mutex + provider OIDCProvider + + jwksLock *sync.Mutex + JWKS *keyfunc.JWKS } -func (m oidcAuth) 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{ @@ -108,52 +80,46 @@ 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") - 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 + m.Logger.Debug().Interface("claims", claims).Interface("userInfo", userInfo).Time("expiration", expiration.UTC()).Msg("unmarshalled and cached userinfo") + 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 + m.Logger.Debug().Interface("claims", claims).Msg("cache hit for userinfo") + return claims, nil } -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 +127,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,89 +146,80 @@ 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 { - header := req.Header.Get("Authorization") - - if m.oidcIss == "" { +func (m OIDCAuthenticator) shouldServe(req *http.Request) bool { + 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"} { - 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 { 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 +228,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 +238,39 @@ func (m *oidcAuth) 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) { + // 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 + } + + 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) + 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/oidc_auth_test.go b/services/proxy/pkg/middleware/oidc_auth_test.go deleted file mode 100644 index 6b7e97bceb..0000000000 --- a/services/proxy/pkg/middleware/oidc_auth_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package middleware - -import ( - "context" - "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" - "golang.org/x/oauth2" -) - -func TestOIDCAuthMiddleware(t *testing.T) { - next := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}) - - 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") - w := httptest.NewRecorder() - m.ServeHTTP(w, r) - - if w.Code != http.StatusInternalServerError { - t.Errorf("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 - }, - } - -} diff --git a/services/proxy/pkg/middleware/public_share_auth.go b/services/proxy/pkg/middleware/public_share_auth.go index 9b3ddcd5ff..8f82bf7203 100644 --- a/services/proxy/pkg/middleware/public_share_auth.go +++ b/services/proxy/pkg/middleware/public_share_auth.go @@ -5,68 +5,83 @@ import ( "strings" gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" + "github.com/owncloud/ocis/v2/ocis-pkg/log" ) const ( - headerRevaAccessToken = "x-access-token" + _headerRevaAccessToken = "x-access-token" headerShareToken = "public-token" basicAuthPasswordPrefix = "password|" authenticationType = "publicshares" + + _paramSignature = "signature" + _paramExpiration = "expiration" ) -// 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) - }) - } +// 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 +} + +// 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 + } + + query := r.URL.Query() + shareToken := r.Header.Get(headerShareToken) + if shareToken == "" { + shareToken = query.Get(headerShareToken) + } + + if shareToken == "" { + // 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 + 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 + } + 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.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, 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 +} diff --git a/services/proxy/pkg/middleware/signed_url_auth.go b/services/proxy/pkg/middleware/signed_url_auth.go index d71036d5a7..793f6d8adc 100644 --- a/services/proxy/pkg/middleware/signed_url_auth.go +++ b/services/proxy/pkg/middleware/signed_url_auth.go @@ -20,61 +20,40 @@ 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 &signedURLAuth{ - next: next, - logger: options.Logger, - preSignedURLConfig: options.PreSignedURLConfig, - store: options.Store, - userProvider: options.UserProvider, - } +var ( + _requiredParams = [...]string{ + _paramOCSignature, + _paramOCCredential, + _paramOCDate, + _paramOCExpires, + _paramOCVerb, } +) + +// SignedURLAuthenticator is the authenticator responsible for authenticating signed URL requests. +type SignedURLAuthenticator struct { + Logger log.Logger + PreSignedURLConfig config.PreSignedURL + UserProvider backend.UserBackend + Store storesvc.StoreService } -type signedURLAuth struct { - next http.Handler - logger log.Logger - preSignedURLConfig config.PreSignedURL - userProvider backend.UserBackend - store storesvc.StoreService -} - -func (m signedURLAuth) 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) -} - -func (m signedURLAuth) shouldServe(req *http.Request) bool { - if !m.preSignedURLConfig.Enabled { +func (m SignedURLAuthenticator) shouldServe(req *http.Request) bool { + if !m.PreSignedURLConfig.Enabled { return false } - return req.URL.Query().Get("OC-Signature") != "" + return req.URL.Query().Get(_paramOCSignature) != "" } -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,20 +79,14 @@ 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 // 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) } @@ -122,19 +95,19 @@ 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")) { + if !strings.EqualFold(meth, query.Get(_paramOCVerb)) { return false, errors.New("required OC-Verb parameter did not match request method") } 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 { + for _, am := range m.PreSignedURLConfig.AllowedHTTPMethods { if strings.EqualFold(meth, am) { methodIsAllowed = true break @@ -147,14 +120,15 @@ 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")) + 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 } @@ -164,20 +138,20 @@ 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 { - 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() { @@ -187,7 +161,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,8 +171,8 @@ func (m signedURLAuth) createSignature(url string, signingKey []byte) string { return hex.EncodeToString(hash) } -func (m signedURLAuth) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) { - res, err := m.store.Read(ctx, &storesvc.ReadRequest{ +func (m SignedURLAuthenticator) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) { + res, err := m.Store.Read(ctx, &storesvc.ReadRequest{ Options: &storemsg.ReadOptions{ Database: "proxy", Table: "signing-keys", @@ -206,8 +180,44 @@ func (m signedURLAuth) getSigningKey(ctx context.Context, ocisID string) ([]byte Key: ocisID, }) if err != nil || len(res.Records) < 1 { - return []byte{}, err + return nil, err } 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 + } + + user, _, err := m.UserProvider.GetUserByClaims(r.Context(), "username", r.URL.Query().Get(_paramOCCredential), true) + if err != nil { + m.Logger.Error(). + Err(err). + Str("authenticator", "signed_url"). + Str("path", r.URL.Path). + 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 { + 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 +} diff --git a/services/proxy/pkg/middleware/signed_url_auth_test.go b/services/proxy/pkg/middleware/signed_url_auth_test.go index 856fcdb0e2..35f84e6655 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 @@ -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) @@ -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 @@ -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 { @@ -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")) diff --git a/services/search/pkg/command/server.go b/services/search/pkg/command/server.go index 967fd96bf2..e1bfac3a3e 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" @@ -21,15 +21,10 @@ 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 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.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/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/.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/settings/pkg/command/health.go b/services/settings/pkg/command/health.go index 68dee3672a..59519140fd 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.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 9306b00bf9..6e9571495c 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" @@ -22,15 +22,10 @@ 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 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.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/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/health.go b/services/sharing/pkg/command/health.go index 1c2bb37ed4..3e15bcd1cf 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.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 a08cd09266..6154ff20b9 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" @@ -26,15 +27,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -110,7 +106,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 fe8e74cf4e..2d6c5dde70 100644 --- a/services/sharing/pkg/config/config.go +++ b/services/sharing/pkg/config/config.go @@ -132,7 +132,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/health.go b/services/storage-publiclink/pkg/command/health.go index b2f3889f50..f60117b4fa 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.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 ece1c444d0..1c731ee52d 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" @@ -25,15 +26,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -97,7 +93,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/health.go b/services/storage-shares/pkg/command/health.go index 90e68c8ba1..4ed8a72cfa 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.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 243baa43d7..d3e507e2bb 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" @@ -25,15 +26,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -97,7 +93,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/health.go b/services/storage-system/pkg/command/health.go index 8b5d5e116a..c5e80577da 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.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 1e5aecd39f..de6095a66d 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" @@ -25,15 +26,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -108,7 +104,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/health.go b/services/storage-users/pkg/command/health.go index 9dcb45556a..717df82eb4 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.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 1b93469990..8c976eb376 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" @@ -25,15 +26,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -97,7 +93,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/uploads.go b/services/storage-users/pkg/command/uploads.go index 0aa7174c34..506dee2dab 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,15 +20,9 @@ import ( func Uploads(cfg *config.Config) *cli.Command { return &cli.Command{ + Name: "uploads", - Usage: "manage uploads", - Before: func(c *cli.Context) error { - if err := parser.ParseConfig(cfg); err != nil { - fmt.Printf("%v", err) - return err - } - return nil - }, + Usage: "manage unfinished uploads", Subcommands: []*cli.Command{ ListUploads(cfg), PurgeExpiredUploads(cfg), @@ -38,16 +33,10 @@ 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: fmt.Sprintf("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 { - fmt.Printf("%v", err) - os.Exit(1) - } - return err + return configlog.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] @@ -85,16 +74,10 @@ 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: fmt.Sprintf("Let %s extension clean up leftovers from expired downloads", cfg.Service.Name), - Category: "services", + 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { f, ok := registry.NewFuncs[cfg.Driver] @@ -111,7 +94,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) } @@ -119,11 +102,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() }() @@ -132,7 +114,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 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/.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/services/store/pkg/command/health.go b/services/store/pkg/command/health.go index e08ec2c782..6d2abc564f 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.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 ceb0d0c84e..76534809bb 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" @@ -22,15 +22,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) 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/health.go b/services/thumbnails/pkg/command/health.go index d8e1210b01..a730037c36 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.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 a6cfd16e68..c79b882ddc 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" @@ -22,15 +22,10 @@ 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 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.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/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/health.go b/services/users/pkg/command/health.go index 729dcf4d09..7884cdc413 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.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 81d849d879..b0419b305a 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" @@ -26,15 +27,10 @@ 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 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.ReturnFatal(parser.ParseConfig(cfg)) }, Action: func(c *cli.Context) error { logger := logging.Configure(cfg.Service.Name, cfg.Log) @@ -110,7 +106,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/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 diff --git a/services/web/pkg/command/health.go b/services/web/pkg/command/health.go index 633067f856..db6a692408 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.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 2a90ff4e8a..3c430369db 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" @@ -22,15 +22,10 @@ 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 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.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/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/health.go b/services/webdav/pkg/command/health.go index e0bc1d5d28..f7c16c6c55 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.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 43f1744e0d..5393a453f9 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" @@ -21,15 +21,10 @@ 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 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.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/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()) diff --git a/sonar-project.properties b/sonar-project.properties index 3b8fe3f80d..7eac08a867 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 # ===================================================== @@ -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/ 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-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index eef202227c..c1e25a26f3 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) @@ -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) @@ -581,21 +577,18 @@ 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) - [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) @@ -603,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) @@ -743,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) @@ -919,107 +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) -- [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) -- [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) -- [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) -- [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) @@ -1136,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) @@ -1187,12 +1074,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 +1102,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) @@ -1316,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) @@ -1338,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) @@ -1356,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) @@ -1375,25 +1247,12 @@ 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) - [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) @@ -1438,5 +1297,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/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 0170f03fe7..95d2ea3412 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -22,6 +22,10 @@ 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) - +### [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/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/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/etagPropagation.feature b/tests/acceptance/features/apiSpaces/etagPropagation.feature index c861a89481..bd93c6598a 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,111 @@ 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/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/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/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/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 * diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 9548d0f637..a498656b54 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 */ @@ -120,14 +126,8 @@ class SpacesContext implements Context { $this->createdSpaces[$spaceName] = $spaceCreator; } - /** - * @var array - */ - private array $availableSpaces; + private array $availableSpaces = []; - /** - * @var array - */ private array $lastPublicLinkData = []; /** @@ -370,6 +370,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 * @@ -386,6 +400,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(), "/"); @@ -405,39 +420,71 @@ class SpacesContext implements Context { * @throws Exception|GuzzleException */ public function cleanDataAfterTests(): void { - // TODO enable when admin can disable and delete spaces - // $this->deleteAllSpacesOfTheType('project'); - // $this->deleteAllSpacesOfTheType('personal'); + $this->deleteAllProjectSpaces(); + $this->deleteAllPersonalSpaces(); } /** - * The method 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, + $this->theUserListsAllAvailableSpacesUsingTheGraphApi( + $userAdmin, + $query + ); + $drives = $this->getAvailableSpaces(); + $createdUsers = $this->featureContext->getCreatedUsers(); + + 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"]); + } + } + } + } + } + } + + /** + * 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(); - - 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) { + if (!\array_key_exists("deleted", $value["root"])) { + $this->sendDisableSpaceRequest($user["actualUsername"], $value["name"]); } + $this->sendDeleteSpaceRequest($user["actualUsername"], $value["name"]); } } } @@ -860,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"); } /** @@ -1318,7 +1363,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()) @@ -1989,6 +2034,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 +2046,6 @@ class SpacesContext implements Context { ]; $fullUrl = $this->baseUrl . $this->ocsApiUrl; - $this->featureContext->setResponse( $this->sendPostRequestToUrl( $fullUrl, @@ -2045,6 +2093,7 @@ class SpacesContext implements Context { $body ) ); + $this->setLastShareData(); } /** @@ -2052,7 +2101,7 @@ class SpacesContext implements Context { * * @param string $user * @param string $spaceName - * @param TableNode|null $table + * @param TableNode $table * * @return void * @throws GuzzleException @@ -2060,7 +2109,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(); @@ -2091,6 +2140,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" + ); } /** @@ -2111,7 +2186,6 @@ class SpacesContext implements Context { string $role ): void { $this->sendShareSpaceRequest($user, $spaceName, $userRecipient, $role); - $expectedHTTPStatus = "200"; $this->featureContext->theHTTPStatusCodeShouldBe( $expectedHTTPStatus, @@ -2165,7 +2239,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, @@ -2908,12 +2982,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(); } /** @@ -2943,10 +3012,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 * @@ -2955,10 +3027,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, @@ -2979,4 +3059,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 + ); + } } 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'." 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" } ] } 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",