mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
Migrate proto files for store and adjust paths
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
|
||||
accountssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/accounts/v1"
|
||||
|
||||
storesvc "github.com/owncloud/ocis/protogen/gen/ocis/services/store/v1"
|
||||
|
||||
"github.com/coreos/go-oidc/v3/oidc"
|
||||
"github.com/cs3org/reva/pkg/token/manager/jwt"
|
||||
chimiddleware "github.com/go-chi/chi/v5/middleware"
|
||||
@@ -30,7 +32,6 @@ import (
|
||||
proxyHTTP "github.com/owncloud/ocis/proxy/pkg/server/http"
|
||||
"github.com/owncloud/ocis/proxy/pkg/tracing"
|
||||
"github.com/owncloud/ocis/proxy/pkg/user/backend"
|
||||
storepb "github.com/owncloud/ocis/store/pkg/proto/v0"
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
@@ -152,7 +153,7 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config)
|
||||
logger.Fatal().Msgf("Invalid accounts backend type '%s'", cfg.AccountBackend)
|
||||
}
|
||||
|
||||
storeClient := storepb.NewStoreService("com.owncloud.api.store", grpc.DefaultClient)
|
||||
storeClient := storesvc.NewStoreService("com.owncloud.api.store", grpc.DefaultClient)
|
||||
if err != nil {
|
||||
logger.Error().Err(err).
|
||||
Str("gateway", cfg.Reva.Address).
|
||||
|
||||
@@ -8,11 +8,11 @@ import (
|
||||
|
||||
accountssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/accounts/v1"
|
||||
settingssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1"
|
||||
storesvc "github.com/owncloud/ocis/protogen/gen/ocis/services/store/v1"
|
||||
|
||||
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/proxy/pkg/config"
|
||||
storepb "github.com/owncloud/ocis/store/pkg/proto/v0"
|
||||
)
|
||||
|
||||
// Option defines a single option function.
|
||||
@@ -41,7 +41,7 @@ type Options struct {
|
||||
// RevaGatewayClient to send requests to the reva gateway
|
||||
RevaGatewayClient gateway.GatewayAPIClient
|
||||
// Store for persisting data
|
||||
Store storepb.StoreService
|
||||
Store storesvc.StoreService
|
||||
// PreSignedURLConfig to configure the middleware
|
||||
PreSignedURLConfig config.PreSignedURL
|
||||
// UserOIDCClaim to read from the oidc claims
|
||||
@@ -142,7 +142,7 @@ func RevaGatewayClient(gc gateway.GatewayAPIClient) Option {
|
||||
}
|
||||
|
||||
// Store provides a function to set the store option.
|
||||
func Store(sc storepb.StoreService) Option {
|
||||
func Store(sc storesvc.StoreService) Option {
|
||||
return func(o *Options) {
|
||||
o.Store = sc
|
||||
}
|
||||
|
||||
@@ -13,9 +13,10 @@ import (
|
||||
|
||||
revactx "github.com/cs3org/reva/pkg/ctx"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
storemsg "github.com/owncloud/ocis/protogen/gen/ocis/messages/store/v1"
|
||||
storesvc "github.com/owncloud/ocis/protogen/gen/ocis/services/store/v1"
|
||||
"github.com/owncloud/ocis/proxy/pkg/config"
|
||||
"github.com/owncloud/ocis/proxy/pkg/user/backend"
|
||||
store "github.com/owncloud/ocis/store/pkg/proto/v0"
|
||||
"golang.org/x/crypto/pbkdf2"
|
||||
)
|
||||
|
||||
@@ -39,7 +40,7 @@ type signedURLAuth struct {
|
||||
logger log.Logger
|
||||
preSignedURLConfig config.PreSignedURL
|
||||
userProvider backend.UserBackend
|
||||
store store.StoreService
|
||||
store storesvc.StoreService
|
||||
}
|
||||
|
||||
func (m signedURLAuth) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
@@ -197,8 +198,8 @@ func (m signedURLAuth) createSignature(url string, signingKey []byte) string {
|
||||
}
|
||||
|
||||
func (m signedURLAuth) getSigningKey(ctx context.Context, ocisID string) ([]byte, error) {
|
||||
res, err := m.store.Read(ctx, &store.ReadRequest{
|
||||
Options: &store.ReadOptions{
|
||||
res, err := m.store.Read(ctx, &storesvc.ReadRequest{
|
||||
Options: &storemsg.ReadOptions{
|
||||
Database: "proxy",
|
||||
Table: "signing-keys",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user