Giter Club home page Giter Club logo

ocis-wopiserver's People

Contributors

micbar avatar refs avatar wkloucek avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocis-wopiserver's Issues

Application uses hardcoded path to /home

This assumption breaks our deployment and we cannot test the application.

[15:02][root@cbox-ocisdev-03 (ocis_dev:box/ocis) ocis-wopiserver]# grep -ri '/home' .
./ui/app.js:      axios.get(tokenUrl, { params: { filePath: '/home' + filePath, fileId: fileId } })

The request should be send to: /eos/user/g/gonzalhu/... but is sent to /home/eos/user/g/gonzalhu/...

image

This applies to any application/extension.
The application needs to use the configured webdav namespace.
The UI knows the good namespace as when clicking on "All files" the request is correct.
This boils down to harcoded paths in the app.

@kulmann could you point @wkloucek to the magic variable that encapsulate the files namespace so is used instead of /home?

No error when debug addr is taken

When the http or grpc address is already been used by the system (or by other extensions) an clear error message stating that a network cannot be bind on such network is shown in the logs.

However, for the debug address no error is shown. Only a info message saying "Shutting down sever".

It took me a while to backtrace the error.

{"level":"info","service":"wopiserver","transport":"http","addr":"localhost:9505","time":"2021-06-21T15:41:05+02:00","message":"starting server"}
{"level":"info","service":"wopiserver","transport":"debug","addr":"0.0.0.0:9109","time":"2021-06-21T15:41:05+02:00","message":"starting server"}
{"level":"info","service":"wopiserver","transport":"http","time":"2021-06-21T15:41:05+02:00","message":"Shutting down server"}

Error when binding net addr to 0.0.0.0

When binding the server to 0.0.0.0 is gives the following error:

ocis-wopiserver server --http-addr 0.0.0.0:1111
{"level":"error","service":"wopiserver","error":"address ::1:1111: too many colons in address","transport":"http","time":"2021-06-21T11:10:23+02:00","message":"Failed to start server"}

When running with localhost it works:

ocis-wopiserver server --http-addr localhost:1111

Prevent token minting when there is already one present in the request headers

Extracted from #10. Minting tokens is expensive and if it can be avoided, it should. If another service already spent the time minting a token and handing it over to subsequent services, let's save the overhead of minting a new token and instead use the one we have in the context of the request.

// TODO: if CS3org WOPI server mints the final REVA JWT secret,
// the temporary REVA JWT token and the user display name can also be obtained like that:
//
// revaToken = r.Header.Get("X-Access-Token") // reva token minted by oCIS Proxy
// if revaToken == "" {
//	 return "", "", errors.New("unauthenticated request")
// }
//
// type revaClaims struct {
// 		User *user.User `json:"user,omitempty"`
// 	 	jwt.Claims
// }
//
// var claims revaClaims
//
// //decode JWT token without verifying the signature
// tokenErr := errors.New("request provided malformed access token")
// token, err := jwt.ParseSigned(revaToken)
// if err != nil {
// 		return "", "", tokenErr
// }
// err = token.UnsafeClaimsWithoutVerification(&claims)
// if err != nil {
// 		return "", "", tokenErr
// }
//
//username = claims.User.DisplayName

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.