Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] Merge master into experimental #4588

Merged
merged 8 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The following sections list the changes for unreleased.
## Summary

* Bugfix - Render webdav permissions as string in search report: [#4575](https://github.com/owncloud/ocis/issues/4575)
* Bugfix - Graph service now forwards trace context: [#4582](https://github.com/owncloud/ocis/pull/4582)
* Enhancement - Allow to configure applications in Web: [#4578](https://github.com/owncloud/ocis/pull/4578)

## Details
Expand All @@ -18,6 +19,10 @@ The following sections list the changes for unreleased.
https://github.com/owncloud/ocis/issues/4575
https://github.com/owncloud/ocis/pull/4579

* Bugfix - Graph service now forwards trace context: [#4582](https://github.com/owncloud/ocis/pull/4582)

https://github.com/owncloud/ocis/pull/4582

* Enhancement - Allow to configure applications in Web: [#4578](https://github.com/owncloud/ocis/pull/4578)

We've added the possibility to configure applications in the Web configuration.
Expand Down
3 changes: 3 additions & 0 deletions changelog/unreleased/graph-forward-trace-ctx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix: graph service now forwards trace context

https://github.com/owncloud/ocis/pull/4582
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ require (
github.com/test-go/testify v1.1.4
github.com/thejerf/suture/v4 v4.0.2
github.com/tus/tusd v1.9.2
github.com/urfave/cli/v2 v2.14.0
github.com/urfave/cli/v2 v2.16.3
github.com/xhit/go-simple-mail/v2 v2.11.0
go-micro.dev/v4 v4.8.1
go.etcd.io/bbolt v1.3.6
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,6 @@ github.com/crewjam/saml v0.4.6 h1:XCUFPkQSJLvzyl4cW9OvpWUbRf0gE7VUpU8ZnilbeM4=
github.com/crewjam/saml v0.4.6/go.mod h1:ZBOXnNPFzB3CgOkRm7Nd6IVdkG+l/wF+0ZXLqD96t1A=
github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d h1:toyZ7IsXlUdEPZ/IG8fg7hbM8HcLPY0bkX4FKBmgLVI=
github.com/cs3org/go-cs3apis v0.0.0-20220818202316-e92afdddac6d/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/reva/v2 v2.8.1-0.20220831084750-0be72e4642ec h1:46Bo1fxV/SpxVxof2dqkuXHjqbu3zJ0UYeRnkOvoSo0=
github.com/cs3org/reva/v2 v2.8.1-0.20220831084750-0be72e4642ec/go.mod h1:3KTFWS3y4SjaQ5RpRQcVxKmY98Sb/E//Qgw+AFx5GfM=
github.com/cs3org/reva/v2 v2.8.1-0.20220908103049-a4e24666b1db h1:nm4Q1rp4cBUW07xNZHYhFTQCdt6OR7PurONka75vi74=
github.com/cs3org/reva/v2 v2.8.1-0.20220908103049-a4e24666b1db/go.mod h1:r0WPc8zRN0Uir7irndh/RE1Q3J5MHpLUpOyM/WyN9ZI=
github.com/cs3org/reva/v2 v2.10.1-0.20220914125507-790323a570c7 h1:niPWQ1dv6QExDz9Ci+GpsbT6bxedmytdZuvtMb0Bbv8=
github.com/cs3org/reva/v2 v2.10.1-0.20220914125507-790323a570c7/go.mod h1:r0WPc8zRN0Uir7irndh/RE1Q3J5MHpLUpOyM/WyN9ZI=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
Expand Down Expand Up @@ -1204,8 +1200,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.14.0 h1:sFRL29Dm9JhXSMYb96raDeo/Q/JRyPXPs8u+4CkMlI8=
github.com/urfave/cli/v2 v2.14.0/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
github.com/urfave/cli/v2 v2.16.3 h1:gHoFIwpPjoyIMbJp/VFd+/vuD0dAgFK4B6DpEMFJfQk=
github.com/urfave/cli/v2 v2.16.3/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
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=
Expand Down
45 changes: 45 additions & 0 deletions ocis-pkg/broker/noop.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package broker

import (
"errors"

"go-micro.dev/v4/broker"
)

type NoOp struct{}

func (n NoOp) Init(_ ...broker.Option) error {
return nil
}

func (n NoOp) Options() broker.Options {
return broker.Options{}
}

func (n NoOp) Address() string {
return ""
}

func (n NoOp) Connect() error {
return nil
}

func (n NoOp) Disconnect() error {
return nil
}

func (n NoOp) Publish(topic string, m *broker.Message, opts ...broker.PublishOption) error {
return nil
}

func (n NoOp) Subscribe(topic string, h broker.Handler, opts ...broker.SubscribeOption) (broker.Subscriber, error) {
return nil, errors.New("not implemented")
}

func (n NoOp) String() string {
return "NoOp"
}

func NewBroker(_ ...broker.Option) broker.Broker {
return &NoOp{}
}
3 changes: 0 additions & 3 deletions ocis-pkg/service/external/external.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/owncloud/ocis/v2/ocis-pkg/log"
oregistry "github.com/owncloud/ocis/v2/ocis-pkg/registry"
"go-micro.dev/v4/broker"
"go-micro.dev/v4/registry"
)

Expand All @@ -20,7 +19,6 @@ func RegisterGRPCEndpoint(ctx context.Context, serviceID, uuid, addr string, ver
}
ocisRegistry := oregistry.GetRegistry()

node.Metadata["broker"] = broker.String()
node.Metadata["registry"] = ocisRegistry.String()
node.Metadata["server"] = "grpc"
node.Metadata["transport"] = "grpc"
Expand Down Expand Up @@ -76,7 +74,6 @@ func RegisterHTTPEndpoint(ctx context.Context, serviceID, uuid, addr string, ver
}
ocisRegistry := oregistry.GetRegistry()

node.Metadata["broker"] = broker.String()
node.Metadata["registry"] = ocisRegistry.String()
node.Metadata["server"] = "http"
node.Metadata["transport"] = "http"
Expand Down
3 changes: 3 additions & 0 deletions ocis-pkg/service/http/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"strings"
"time"

"github.com/owncloud/ocis/v2/ocis-pkg/broker"
"github.com/owncloud/ocis/v2/ocis-pkg/registry"

mhttps "github.com/go-micro/plugins/v4/server/http"
Expand All @@ -18,9 +19,11 @@ type Service struct {

// NewService initializes a new http service.
func NewService(opts ...Option) Service {
noopBroker := broker.NoOp{}
sopts := newOptions(opts...)
wopts := []micro.Option{
micro.Server(mhttps.NewServer(server.TLSConfig(sopts.TLSConfig))),
micro.Broker(noopBroker),
micro.Address(sopts.Address),
micro.Name(strings.Join([]string{sopts.Namespace, sopts.Name}, ".")),
micro.Version(sopts.Version),
Expand Down
1 change: 1 addition & 0 deletions services/graph/pkg/server/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func Server(opts ...Option) (http.Service, error) {
svc.Logger(options.Logger),
svc.Config(options.Config),
svc.Middleware(
middleware.TraceContext,
chimiddleware.RequestID,
middleware.Version(
"graph",
Expand Down
2 changes: 2 additions & 0 deletions services/ocdav/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/cs3org/reva/v2/pkg/micro/ocdav"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/broker"
"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"
Expand Down Expand Up @@ -61,6 +62,7 @@ func Server(cfg *config.Config) *cli.Command {
ocdav.Edition(cfg.Status.Edition),
ocdav.MachineAuthAPIKey(cfg.MachineAuthAPIKey),
ocdav.Events(cfg.Events.Endpoint, cfg.Events.Cluster),
ocdav.Broker(broker.NoOp{}),
// ocdav.FavoriteManager() // FIXME needs a proper persistence implementation https://github.com/owncloud/ocis/issues/1228
// ocdav.LockSystem(), // will default to the CS3 lock system
// ocdav.TLSConfig() // tls config for the http server
Expand Down
28 changes: 26 additions & 2 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -3126,6 +3126,30 @@ public function userGetsTheFollowingPropertiesOfFileInsideSpaceUsingTheWebdavApi
$this->webDavPropertiesContext->userGetsPropertiesOfFolder($user, $resourceName, $propertiesTable);
}

/**
* @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 $value
*
* @return void
*
* @throws Exception|GuzzleException
*/
public function userGetsTheFollowingPropertiesOfFileInsideSpaceWithValueUsingTheWebdavApi(
string $user,
string $resourceName,
string $spaceName,
string $property,
string $value
):void {
$this->setSpaceIDByName($user, $spaceName);
$this->webDavPropertiesContext->asUserFolderShouldContainAPropertyWithValue($user, $resourceName, $property, $value);
}

/**
* @Then /^as user "([^"]*)" (?:file|folder|entry) "([^"]*)" inside space "([^"]*)" (should|should not) be favorited$/
*
Expand Down Expand Up @@ -3203,7 +3227,7 @@ public function searchResultShouldContainSpace(string $user, string $spaceName):
// get a response after a Report request (called in the core)
$responseArray = json_decode(json_encode($this->featureContext->getResponseXml()->xpath("//d:response/d:href")), true, 512, JSON_THROW_ON_ERROR);
Assert::assertNotEmpty($responseArray, "search result is empty");

// for mountpoint, id looks a little different than for project space
if (str_contains($spaceName, 'mountpoint')) {
$splitSpaceName = explode("/", $spaceName);
Expand All @@ -3214,7 +3238,7 @@ public function searchResultShouldContainSpace(string $user, string $spaceName):
$space = $this->getSpaceByName($user, $spaceName);
$topWebDavPath = "/remote.php/dav/spaces/" . $space['id'];
}

$spaceFound = false;
foreach ($responseArray as $value) {
if ($topWebDavPath === $value[0]) {
Expand Down