Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
abaldacchino committed Aug 25, 2023
1 parent c176fe4 commit 7295890
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions internal/http/services/overleaf/overleaf.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
authpb "github.com/cs3org/go-cs3apis/cs3/auth/provider/v1beta1"
gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
rpc "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
storagepb "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/internal/http/services/reqres"
"github.com/cs3org/reva/pkg/appctx"
Expand All @@ -46,13 +45,11 @@ import (
"github.com/cs3org/reva/pkg/utils/cfg"
"github.com/cs3org/reva/pkg/utils/resourceid"
"github.com/go-chi/chi/v5"
"github.com/rs/zerolog"
)

type svc struct {
conf *config
gtwClient gateway.GatewayAPIClient
log *zerolog.Logger
router *chi.Mux
}

Expand All @@ -61,7 +58,7 @@ type config struct {
GatewaySvc string `mapstructure:"gatewaysvc" validate:"required"`
AppName string `mapstructure:"app_name" docs:";The App user-friendly name." validate:"required"`
ArchiverURL string `mapstructure:"archiver_url" docs:";Internet-facing URL of the archiver service, used to serve the files to Overleaf." validate:"required"`
AppURL string `mapstructure:"app_url" docs:";The App URL." validate:"required"`
appURL string `mapstructure:"app_url" docs:";The App URL." validate:"required"`
Insecure bool `mapstructure:"insecure" docs:"false;Whether to skip certificate checks when sending requests."`
JWTSecret string `mapstructure:"jwt_secret"`
}
Expand Down Expand Up @@ -229,8 +226,8 @@ func (s *svc) handleExport(w http.ResponseWriter, r *http.Request) {
log.Debug().Str("Archiver url", archHTTPReq.URL.String()).Msg("URL for downloading zipped resource from archiver")

// Setting up Overleaf request
appUrl := s.conf.AppURL + "/docs"
httpReq, err := rhttp.NewRequest(ctx, http.MethodGet, appUrl, nil)
appURL := s.conf.appURL + "/docs"
httpReq, err := rhttp.NewRequest(ctx, http.MethodGet, appURL, nil)
if err != nil {
reqres.WriteError(w, r, reqres.APIErrorServerError, "overleaf: error setting up http request", nil)
return
Expand All @@ -248,11 +245,11 @@ func (s *svc) handleExport(w http.ResponseWriter, r *http.Request) {
httpReq.URL.RawQuery = q.Encode()
url := httpReq.URL.String()

req := &provider.SetArbitraryMetadataRequest{
Ref: &provider.Reference{
req := &storagepb.SetArbitraryMetadataRequest{
Ref: &storagepb.Reference{
ResourceId: resource.Id,
},
ArbitraryMetadata: &provider.ArbitraryMetadata{
ArbitraryMetadata: &storagepb.ArbitraryMetadata{
Metadata: map[string]string{
"reva.overleaf.exporttime": strconv.Itoa(int(time.Now().Unix())),
"reva.overleaf.name": base64.StdEncoding.EncodeToString([]byte(name)),
Expand Down

0 comments on commit 7295890

Please sign in to comment.