mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-27 18:45:04 -05:00
Merge branch 'origin/main' into 'next-release/main'
This commit is contained in:
commit
51f125a4b8
15 files changed
+706
-23
No files matched your search
@@ -67,8 +67,8 @@ require (
|
||||
github.com/onsi/gomega v1.43.1
|
||||
github.com/open-policy-agent/opa v1.21.1
|
||||
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261016073229-17ed3d5dd346
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119121328-0093d72f4c9d
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261119152805-1a7a500a264e
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119154313-aa77b15bccec
|
||||
github.com/opensearch-project/opensearch-go/v4 v4.7.3
|
||||
github.com/orcaman/concurrent-map v1.0.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
|
||||
@@ -759,10 +759,10 @@ github.com/opencloud-eu/go-micro-plugins/v4/store/nats-js-kv v0.0.0-202505121527
|
||||
github.com/opencloud-eu/go-micro-plugins/v4/store/nats-js-kv v0.0.0-20250512152754-23325793059a/go.mod h1:pjcozWijkNPbEtX5SIQaxEW/h8VAVZYTLx+70bmB3LY=
|
||||
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89 h1:W1ms+lP5lUUIzjRGDg93WrQfZJZCaV1ZP3KeyXi8bzY=
|
||||
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89/go.mod h1:vigJkNss1N2QEceCuNw/ullDehncuJNFB6mEnzfq9UI=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261016073229-17ed3d5dd346 h1:3ptbiFhSK4fzY/rC3idcYUveiwepMoOov1sBpc7Rg3k=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261016073229-17ed3d5dd346/go.mod h1:lTM8JeGblNpoMySTW7Lui2+c5TTLI95mwxtdUIHHrhU=
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119121328-0093d72f4c9d h1:pVqdcXJgDmypBdJChOWJvKL6gPeG3nEGU6lcuwbhv8E=
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119121328-0093d72f4c9d/go.mod h1:lwylaua29K7ge30pFxzHMh6LeH9bhCQduFdw+qKFzJA=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261119152805-1a7a500a264e h1:5sf3dNw/eYuuvDL8+3c4pbPSX+Pblw6lsylGtq+cw30=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261119152805-1a7a500a264e/go.mod h1:lTM8JeGblNpoMySTW7Lui2+c5TTLI95mwxtdUIHHrhU=
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119154313-aa77b15bccec h1:3Y/o9uwiQ07c5Od1E/6TQQPDzN2uHeOACzW+d/+KGBQ=
|
||||
github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119154313-aa77b15bccec/go.mod h1:lwylaua29K7ge30pFxzHMh6LeH9bhCQduFdw+qKFzJA=
|
||||
github.com/opencloud-eu/secure v0.0.0-20260312082735-b6f5cb2244e4 h1:l2oB/RctH+t8r7QBj5p8thfEHCM/jF35aAY3WQ3hADI=
|
||||
github.com/opencloud-eu/secure v0.0.0-20260312082735-b6f5cb2244e4/go.mod h1:BmF5hyM6tXczk3MpQkFf1hpKSRqCyhqcbiQtiAF7+40=
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"golang.org/x/crypto/sha3"
|
||||
"google.golang.org/protobuf/types/known/fieldmaskpb"
|
||||
|
||||
"github.com/opencloud-eu/reva/v3/pkg/conversions"
|
||||
revactx "github.com/opencloud-eu/reva/v3/pkg/ctx"
|
||||
"github.com/opencloud-eu/reva/v3/pkg/publicshare"
|
||||
"github.com/opencloud-eu/reva/v3/pkg/storagespace"
|
||||
@@ -618,6 +619,8 @@ func shareTypesOf(info *storageprovider.ResourceInfo, linkShares map[string]stru
|
||||
types = append(types, "user")
|
||||
case strconv.Itoa(int(storageprovider.GranteeType_GRANTEE_TYPE_GROUP)):
|
||||
types = append(types, "group")
|
||||
case strconv.Itoa(int(conversions.ShareTypeEmail)):
|
||||
types = append(types, "email")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -592,6 +592,56 @@ var _ = Describe("Driveitems", func() {
|
||||
Expect(res.Value[0].LibreGraphShareTypes).To(ConsistOf("user", "group", "link"))
|
||||
})
|
||||
|
||||
It("reports an email share as an email share type", func() {
|
||||
q := r.URL.Query()
|
||||
q.Add("$select", "@libre.graph.shareTypes")
|
||||
r.URL.RawQuery = q.Encode()
|
||||
|
||||
gatewayClient.On("ListContainer", mock.Anything, mock.Anything).Return(&provider.ListContainerResponse{
|
||||
Status: status.NewOK(ctx),
|
||||
Infos: []*provider.ResourceInfo{
|
||||
{
|
||||
Type: provider.ResourceType_RESOURCE_TYPE_FILE,
|
||||
Id: &provider.ResourceId{StorageId: "storageid", SpaceId: "spaceid", OpaqueId: "opaqueid"},
|
||||
Etag: "etag",
|
||||
Mtime: utils.TimeToTS(mtime),
|
||||
Opaque: utils.AppendPlainToOpaque(nil, "share-types", "4"),
|
||||
},
|
||||
},
|
||||
}, nil)
|
||||
gatewayClient.On("ListPublicShares", mock.Anything, mock.Anything).Return(&link.ListPublicSharesResponse{
|
||||
Status: status.NewOK(ctx),
|
||||
}, nil)
|
||||
|
||||
res := assertItemsList(1)
|
||||
Expect(res.Value[0].LibreGraphShareTypes).To(ConsistOf("email"))
|
||||
})
|
||||
|
||||
It("reports user and email shares as separate share types", func() {
|
||||
q := r.URL.Query()
|
||||
q.Add("$select", "@libre.graph.shareTypes")
|
||||
r.URL.RawQuery = q.Encode()
|
||||
|
||||
gatewayClient.On("ListContainer", mock.Anything, mock.Anything).Return(&provider.ListContainerResponse{
|
||||
Status: status.NewOK(ctx),
|
||||
Infos: []*provider.ResourceInfo{
|
||||
{
|
||||
Type: provider.ResourceType_RESOURCE_TYPE_FILE,
|
||||
Id: &provider.ResourceId{StorageId: "storageid", SpaceId: "spaceid", OpaqueId: "opaqueid"},
|
||||
Etag: "etag",
|
||||
Mtime: utils.TimeToTS(mtime),
|
||||
Opaque: utils.AppendPlainToOpaque(nil, "share-types", "1,4"),
|
||||
},
|
||||
},
|
||||
}, nil)
|
||||
gatewayClient.On("ListPublicShares", mock.Anything, mock.Anything).Return(&link.ListPublicSharesResponse{
|
||||
Status: status.NewOK(ctx),
|
||||
}, nil)
|
||||
|
||||
res := assertItemsList(1)
|
||||
Expect(res.Value[0].LibreGraphShareTypes).To(Equal([]string{"user", "email"}))
|
||||
})
|
||||
|
||||
It("reports only the link when the item has no grants", func() {
|
||||
q := r.URL.Query()
|
||||
q.Add("$select", "@libre.graph.shareTypes")
|
||||
|
||||
+5
@@ -82,9 +82,13 @@ Class | Method | HTTP request | Description
|
||||
*DriveItemApi* | [**GetDriveItemV1**](docs/DriveItemApi.md#getdriveitemv1) | **Get** /v1.0/drives/{drive-id}/items/{item-id} | Get a DriveItem.
|
||||
*DriveItemApi* | [**UpdateDriveItem**](docs/DriveItemApi.md#updatedriveitem) | **Patch** /v1beta1/drives/{drive-id}/items/{item-id} | Update a DriveItem.
|
||||
*DrivesApi* | [**CreateDrive**](docs/DrivesApi.md#createdrive) | **Post** /v1.0/drives | Create a new drive of a specific type
|
||||
*DrivesApi* | [**CreateDriveBeta**](docs/DrivesApi.md#createdrivebeta) | **Post** /v1beta1/drives | Alias for creating a drive with '/v1.0/drives', but the new drive is returned in the v1beta1 format, with grantedToV2 and unified role IDs in its permissions
|
||||
*DrivesApi* | [**DeleteDrive**](docs/DrivesApi.md#deletedrive) | **Delete** /v1.0/drives/{drive-id} | Delete a specific space
|
||||
*DrivesApi* | [**DeleteDriveBeta**](docs/DrivesApi.md#deletedrivebeta) | **Delete** /v1beta1/drives/{drive-id} | Alias for deleting a drive with '/v1.0/drives/{drive-id}'
|
||||
*DrivesApi* | [**GetDrive**](docs/DrivesApi.md#getdrive) | **Get** /v1.0/drives/{drive-id} | Get drive by id
|
||||
*DrivesApi* | [**GetDriveBeta**](docs/DrivesApi.md#getdrivebeta) | **Get** /v1beta1/drives/{drive-id} | Alias for '/v1.0/drives/{drive-id}', but the drive is returned in the v1beta1 format, with grantedToV2 and unified role IDs in its permissions
|
||||
*DrivesApi* | [**UpdateDrive**](docs/DrivesApi.md#updatedrive) | **Patch** /v1.0/drives/{drive-id} | Update the drive
|
||||
*DrivesApi* | [**UpdateDriveBeta**](docs/DrivesApi.md#updatedrivebeta) | **Patch** /v1beta1/drives/{drive-id} | Alias for updating a drive with '/v1.0/drives/{drive-id}', but the updated drive is returned in the v1beta1 format, with grantedToV2 and unified role IDs in its permissions
|
||||
*DrivesGetDrivesApi* | [**ListAllDrives**](docs/DrivesGetDrivesApi.md#listalldrives) | **Get** /v1.0/drives | Get all available drives
|
||||
*DrivesGetDrivesApi* | [**ListAllDrivesBeta**](docs/DrivesGetDrivesApi.md#listalldrivesbeta) | **Get** /v1beta1/drives | Alias for '/v1.0/drives', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles
|
||||
*DrivesPermissionsApi* | [**CreateLink**](docs/DrivesPermissionsApi.md#createlink) | **Post** /v1beta1/drives/{drive-id}/items/{item-id}/createLink | Create a sharing link for a DriveItem
|
||||
@@ -138,6 +142,7 @@ Class | Method | HTTP request | Description
|
||||
*GroupApi* | [**UpdateGroup**](docs/GroupApi.md#updategroup) | **Patch** /v1.0/groups/{group-id} | Update entity in groups
|
||||
*GroupsApi* | [**CreateGroup**](docs/GroupsApi.md#creategroup) | **Post** /v1.0/groups | Add new entity to groups
|
||||
*GroupsApi* | [**ListGroups**](docs/GroupsApi.md#listgroups) | **Get** /v1.0/groups | Get entities from groups
|
||||
*GuestLinksApi* | [**LogoutGuestLink**](docs/GuestLinksApi.md#logoutguestlink) | **Post** /v1beta1/extensions/org.libregraph/guestLinks/logout | Log out of a guest session
|
||||
*GuestLinksApi* | [**RenewGuestLink**](docs/GuestLinksApi.md#renewguestlink) | **Post** /v1beta1/extensions/org.libregraph/guestLinks/renew | Renew a guest link
|
||||
*GuestLinksApi* | [**VerifyGuestLinkPin**](docs/GuestLinksApi.md#verifyguestlinkpin) | **Post** /v1beta1/extensions/org.libregraph/guestLinks/verify/pin | Verify a guest link PIN
|
||||
*GuestLinksApi* | [**VerifyGuestLinkToken**](docs/GuestLinksApi.md#verifyguestlinktoken) | **Post** /v1beta1/extensions/org.libregraph/guestLinks/verify/token | Verify a guest link token
|
||||
|
||||
+475
@@ -140,6 +140,123 @@ func (a *DrivesApiService) CreateDriveExecute(r ApiCreateDriveRequest) (*Drive,
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiCreateDriveBetaRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
drive *Drive
|
||||
}
|
||||
|
||||
// New space property values
|
||||
func (r ApiCreateDriveBetaRequest) Drive(drive Drive) ApiCreateDriveBetaRequest {
|
||||
r.drive = &drive
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiCreateDriveBetaRequest) Execute() (*Drive, *http.Response, error) {
|
||||
return r.ApiService.CreateDriveBetaExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateDriveBeta Alias for creating a drive with '/v1.0/drives', but the new drive is returned in the v1beta1 format, with grantedToV2 and unified role IDs in its permissions
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiCreateDriveBetaRequest
|
||||
*/
|
||||
func (a *DrivesApiService) CreateDriveBeta(ctx context.Context) ApiCreateDriveBetaRequest {
|
||||
return ApiCreateDriveBetaRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Drive
|
||||
func (a *DrivesApiService) CreateDriveBetaExecute(r ApiCreateDriveBetaRequest) (*Drive, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Drive
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesApiService.CreateDriveBeta")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.drive == nil {
|
||||
return localVarReturnValue, nil, reportError("drive is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.drive
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiDeleteDriveRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
@@ -248,6 +365,114 @@ func (a *DrivesApiService) DeleteDriveExecute(r ApiDeleteDriveRequest) (*http.Re
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiDeleteDriveBetaRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
driveId string
|
||||
ifMatch *string
|
||||
}
|
||||
|
||||
// ETag
|
||||
func (r ApiDeleteDriveBetaRequest) IfMatch(ifMatch string) ApiDeleteDriveBetaRequest {
|
||||
r.ifMatch = &ifMatch
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiDeleteDriveBetaRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteDriveBetaExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteDriveBeta Alias for deleting a drive with '/v1.0/drives/{drive-id}'
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@return ApiDeleteDriveBetaRequest
|
||||
*/
|
||||
func (a *DrivesApiService) DeleteDriveBeta(ctx context.Context, driveId string) ApiDeleteDriveBetaRequest {
|
||||
return ApiDeleteDriveBetaRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *DrivesApiService) DeleteDriveBetaExecute(r ApiDeleteDriveBetaRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesApiService.DeleteDriveBeta")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
if r.ifMatch != nil {
|
||||
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "simple", "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetDriveRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
@@ -367,6 +592,135 @@ func (a *DrivesApiService) GetDriveExecute(r ApiGetDriveRequest) (*Drive, *http.
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetDriveBetaRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
driveId string
|
||||
expand *string
|
||||
select_ *[]string
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiGetDriveBetaRequest) Expand(expand string) ApiGetDriveBetaRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
// Select properties to be returned. By default all properties are returned.
|
||||
func (r ApiGetDriveBetaRequest) Select_(select_ []string) ApiGetDriveBetaRequest {
|
||||
r.select_ = &select_
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiGetDriveBetaRequest) Execute() (*Drive, *http.Response, error) {
|
||||
return r.ApiService.GetDriveBetaExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetDriveBeta Alias for '/v1.0/drives/{drive-id}', but the drive is returned in the v1beta1 format, with grantedToV2 and unified role IDs in its permissions
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@return ApiGetDriveBetaRequest
|
||||
*/
|
||||
func (a *DrivesApiService) GetDriveBeta(ctx context.Context, driveId string) ApiGetDriveBetaRequest {
|
||||
return ApiGetDriveBetaRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Drive
|
||||
func (a *DrivesApiService) GetDriveBetaExecute(r ApiGetDriveBetaRequest) (*Drive, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Drive
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesApiService.GetDriveBeta")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "")
|
||||
}
|
||||
if r.select_ != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
|
||||
}
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiUpdateDriveRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
@@ -487,3 +841,124 @@ func (a *DrivesApiService) UpdateDriveExecute(r ApiUpdateDriveRequest) (*Drive,
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiUpdateDriveBetaRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
driveId string
|
||||
driveUpdate *DriveUpdate
|
||||
}
|
||||
|
||||
// New space values
|
||||
func (r ApiUpdateDriveBetaRequest) DriveUpdate(driveUpdate DriveUpdate) ApiUpdateDriveBetaRequest {
|
||||
r.driveUpdate = &driveUpdate
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateDriveBetaRequest) Execute() (*Drive, *http.Response, error) {
|
||||
return r.ApiService.UpdateDriveBetaExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateDriveBeta Alias for updating a drive with '/v1.0/drives/{drive-id}', but the updated drive is returned in the v1beta1 format, with grantedToV2 and unified role IDs in its permissions
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@return ApiUpdateDriveBetaRequest
|
||||
*/
|
||||
func (a *DrivesApiService) UpdateDriveBeta(ctx context.Context, driveId string) ApiUpdateDriveBetaRequest {
|
||||
return ApiUpdateDriveBetaRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Drive
|
||||
func (a *DrivesApiService) UpdateDriveBetaExecute(r ApiUpdateDriveBetaRequest) (*Drive, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Drive
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesApiService.UpdateDriveBeta")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.driveUpdate == nil {
|
||||
return localVarReturnValue, nil, reportError("driveUpdate is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.driveUpdate
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
+96
@@ -22,6 +22,102 @@ import (
|
||||
// GuestLinksApiService GuestLinksApi service
|
||||
type GuestLinksApiService service
|
||||
|
||||
type ApiLogoutGuestLinkRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GuestLinksApiService
|
||||
}
|
||||
|
||||
func (r ApiLogoutGuestLinkRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.LogoutGuestLinkExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
LogoutGuestLink Log out of a guest session
|
||||
|
||||
End the guest session in this browser by clearing the guest session cookie. The session token itself stays valid until it expires. The request succeeds without a session cookie as well.
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiLogoutGuestLinkRequest
|
||||
*/
|
||||
func (a *GuestLinksApiService) LogoutGuestLink(ctx context.Context) ApiLogoutGuestLinkRequest {
|
||||
return ApiLogoutGuestLinkRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *GuestLinksApiService) LogoutGuestLinkExecute(r ApiLogoutGuestLinkRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GuestLinksApiService.LogoutGuestLink")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/extensions/org.libregraph/guestLinks/logout"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiRenewGuestLinkRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GuestLinksApiService
|
||||
|
||||
+37
@@ -29,6 +29,8 @@ type Thumbnail struct {
|
||||
Url *string `json:"url,omitempty"`
|
||||
// The width of the thumbnail, in pixels.
|
||||
Width *int32 `json:"width,omitempty"`
|
||||
// The mime type the thumbnail is served in, e.g. `image/png`. It can differ from the mime type of the item the thumbnail belongs to, for example when the thumbnail is an image taken from inside the item, such as the cover art of an audio file.
|
||||
LibreGraphMimeType *string `json:"@libre.graph.mimeType,omitempty"`
|
||||
}
|
||||
|
||||
// NewThumbnail instantiates a new Thumbnail object
|
||||
@@ -208,6 +210,38 @@ func (o *Thumbnail) SetWidth(v int32) {
|
||||
o.Width = &v
|
||||
}
|
||||
|
||||
// GetLibreGraphMimeType returns the LibreGraphMimeType field value if set, zero value otherwise.
|
||||
func (o *Thumbnail) GetLibreGraphMimeType() string {
|
||||
if o == nil || IsNil(o.LibreGraphMimeType) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.LibreGraphMimeType
|
||||
}
|
||||
|
||||
// GetLibreGraphMimeTypeOk returns a tuple with the LibreGraphMimeType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Thumbnail) GetLibreGraphMimeTypeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphMimeType) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphMimeType, true
|
||||
}
|
||||
|
||||
// HasLibreGraphMimeType returns a boolean if a field has been set.
|
||||
func (o *Thumbnail) HasLibreGraphMimeType() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphMimeType) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphMimeType gets a reference to the given string and assigns it to the LibreGraphMimeType field.
|
||||
func (o *Thumbnail) SetLibreGraphMimeType(v string) {
|
||||
o.LibreGraphMimeType = &v
|
||||
}
|
||||
|
||||
func (o Thumbnail) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
@@ -233,6 +267,9 @@ func (o Thumbnail) ToMap() (map[string]interface{}, error) {
|
||||
if !IsNil(o.Width) {
|
||||
toSerialize["width"] = o.Width
|
||||
}
|
||||
if !IsNil(o.LibreGraphMimeType) {
|
||||
toSerialize["@libre.graph.mimeType"] = o.LibreGraphMimeType
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+2
-2
@@ -1538,8 +1538,8 @@ func mdToPropResponse(ctx context.Context, pf *XML, md *provider.ResourceInfo, p
|
||||
types.WriteString("<oc:share-type>" + strconv.Itoa(int(conversions.ShareTypeUser)) + "</oc:share-type>")
|
||||
case "2": // provider.GranteeType_GRANTEE_TYPE_GROUP
|
||||
types.WriteString("<oc:share-type>" + strconv.Itoa(int(conversions.ShareTypeGroup)) + "</oc:share-type>")
|
||||
case "4": // conversions.ShareTypeGuest, guest shares are stored as user grants
|
||||
types.WriteString("<oc:share-type>" + strconv.Itoa(int(conversions.ShareTypeGuest)) + "</oc:share-type>")
|
||||
case "4": // conversions.ShareTypeEmail, guest shares are stored as user grants
|
||||
types.WriteString("<oc:share-type>" + strconv.Itoa(int(conversions.ShareTypeEmail)) + "</oc:share-type>")
|
||||
default:
|
||||
sublog.Debug().Interface("shareType", shareType).Msg("unknown share type, ignoring")
|
||||
}
|
||||
|
||||
+9
-4
@@ -48,7 +48,7 @@ func init() {
|
||||
|
||||
type manager struct {
|
||||
c *config
|
||||
gw gateway.GatewayAPIClient
|
||||
gw *pool.Selector[gateway.GatewayAPIClient]
|
||||
}
|
||||
|
||||
type config struct {
|
||||
@@ -65,7 +65,7 @@ func New(m map[string]any, _ *zerolog.Logger) (auth.Manager, error) {
|
||||
if err := mgr.Configure(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
gw, err := pool.GetGatewayServiceClient(mgr.c.GatewayAddr)
|
||||
gw, err := pool.GatewaySelector(mgr.c.GatewayAddr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -85,8 +85,13 @@ func (m *manager) Configure(ml map[string]interface{}) error {
|
||||
|
||||
func (m *manager) Authenticate(ctx context.Context, ocmshare, sharedSecret string) (*userpb.User, map[string]*authpb.Scope, error) {
|
||||
log := appctx.GetLogger(ctx).With().Str("ocmshare", ocmshare).Logger()
|
||||
gwc, err := m.gw.Next()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// We need to use GetOCMShareByToken, as GetOCMShare would require a user in the context
|
||||
shareRes, err := m.gw.GetOCMShareByToken(ctx, &ocm.GetOCMShareByTokenRequest{
|
||||
shareRes, err := gwc.GetOCMShareByToken(ctx, &ocm.GetOCMShareByTokenRequest{
|
||||
Token: sharedSecret,
|
||||
})
|
||||
|
||||
@@ -129,7 +134,7 @@ func (m *manager) Authenticate(ctx context.Context, ocmshare, sharedSecret strin
|
||||
},
|
||||
}
|
||||
|
||||
userRes, err := m.gw.GetAcceptedUser(ctx, &ocminvite.GetAcceptedUserRequest{
|
||||
userRes, err := gwc.GetAcceptedUser(ctx, &ocminvite.GetAcceptedUserRequest{
|
||||
RemoteUserId: u,
|
||||
Opaque: o,
|
||||
})
|
||||
|
||||
+2
-2
@@ -61,8 +61,8 @@ const (
|
||||
// ShareTypeSpaceMembershipGroup represents an action regarding group type space members
|
||||
ShareTypeSpaceMembershipGroup ShareType = 8
|
||||
|
||||
// ShareTypeGuest represents a guest share
|
||||
ShareTypeGuest ShareType = 4
|
||||
// ShareTypeEmail represents a share to an guest email address (magic-link guest without a user account)
|
||||
ShareTypeEmail ShareType = 4
|
||||
|
||||
// ShareWithUserTypeUser represents a normal user
|
||||
ShareWithUserTypeUser ShareWithUserType = 0
|
||||
|
||||
+13
-5
@@ -60,7 +60,7 @@ func init() {
|
||||
|
||||
type driver struct {
|
||||
c *config
|
||||
gateway gateway.GatewayAPIClient
|
||||
gateway *pool.Selector[gateway.GatewayAPIClient]
|
||||
}
|
||||
|
||||
type config struct {
|
||||
@@ -108,7 +108,7 @@ func New(m map[string]interface{}, _ events.Stream, _ *zerolog.Logger) (storage.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
gateway, err := pool.GetGatewayServiceClient(c.GatewaySVC)
|
||||
gateway, err := pool.GatewaySelector(c.GatewaySVC)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -156,7 +156,11 @@ func (d *driver) getWebDAVFromShare(ctx context.Context, forUser *userpb.UserId,
|
||||
if forUser != nil {
|
||||
req.Opaque = utils.AppendJSONToOpaque(nil, "userid", forUser)
|
||||
}
|
||||
res, err := d.gateway.GetReceivedOCMShare(ctx, req)
|
||||
gwc, err := d.gateway.Next()
|
||||
if err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
res, err := gwc.GetReceivedOCMShare(ctx, req)
|
||||
if err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
@@ -564,14 +568,18 @@ func (d *driver) ListStorageSpaces(ctx context.Context, filters []*provider.List
|
||||
}
|
||||
}
|
||||
|
||||
lrsRes, err := d.gateway.ListReceivedOCMShares(ctx, &ocmpb.ListReceivedOCMSharesRequest{})
|
||||
gwc, err := d.gateway.Next()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
lrsRes, err := gwc.ListReceivedOCMShares(ctx, &ocmpb.ListReceivedOCMSharesRequest{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// FIXME This might have to be ListOCMShares
|
||||
// these are grants
|
||||
|
||||
lsRes, err := d.gateway.ListOCMShares(ctx, &ocmpb.ListOCMSharesRequest{})
|
||||
lsRes, err := gwc.ListOCMShares(ctx, &ocmpb.ListOCMSharesRequest{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
+5
-1
@@ -64,7 +64,11 @@ func (d *driver) CommitUpload(ctx context.Context, ref *provider.Reference, sess
|
||||
// it authenticates as the service account and looks up the share on behalf of the
|
||||
// upload's executant.
|
||||
func (d *driver) serviceWebdavClient(ctx context.Context, ref *provider.Reference) (*gowebdav.Client, *ocmpb.ReceivedShare, string, error) {
|
||||
serviceUserCtx, err := utils.GetServiceUserContextWithContext(context.Background(), d.gateway, d.c.ServiceAccountID, d.c.ServiceAccountSecret)
|
||||
gwc, err := d.gateway.Next()
|
||||
if err != nil {
|
||||
return nil, nil, "", err
|
||||
}
|
||||
serviceUserCtx, err := utils.GetServiceUserContextWithContext(context.Background(), gwc, d.c.ServiceAccountID, d.c.ServiceAccountSecret)
|
||||
if err != nil {
|
||||
return nil, nil, "", err
|
||||
}
|
||||
|
||||
+1
-1
@@ -1018,7 +1018,7 @@ func (n *Node) AsResourceInfo(ctx context.Context, rp *provider.ResourcePermissi
|
||||
if !first {
|
||||
s.WriteString(",")
|
||||
}
|
||||
s.WriteString(strconv.Itoa(int(conversions.ShareTypeGuest)))
|
||||
s.WriteString(strconv.Itoa(int(conversions.ShareTypeEmail)))
|
||||
}
|
||||
ri.Opaque = utils.AppendPlainToOpaque(ri.Opaque, "share-types", s.String())
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -1357,10 +1357,10 @@ github.com/open-policy-agent/opa/v1/version
|
||||
# github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89
|
||||
## explicit; go 1.24.6
|
||||
github.com/opencloud-eu/icap-client
|
||||
# github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261016073229-17ed3d5dd346
|
||||
# github.com/opencloud-eu/libre-graph-api-go v1.0.9-0.20261119152805-1a7a500a264e
|
||||
## explicit; go 1.23
|
||||
github.com/opencloud-eu/libre-graph-api-go
|
||||
# github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119121328-0093d72f4c9d
|
||||
# github.com/opencloud-eu/reva/v3 v3.0.2-0.20261119154313-aa77b15bccec
|
||||
## explicit; go 1.26.0
|
||||
github.com/opencloud-eu/reva/v3/cmd/revad/internal/grace
|
||||
github.com/opencloud-eu/reva/v3/cmd/revad/runtime
|
||||
|
||||
Reference in new issue
Block a user