Code Monkey home page Code Monkey logo

Comments (4)

koltyakov avatar koltyakov commented on May 27, 2024 1

Hey @johnnliu,

Last months sp-rest-proxy received a lot of new features.
I had no chance to document them all. In a few words, almost any request can be forwarded via proxy, including JSOM, batch API (for SPO and 2016) and static content. SharePoint pages can be even opened in proxy's hostname.
Also proxy got a new mode for socket server and client which allows target to SharePoint server
in NAT network without VPN or external IP.

Also, I got a chance to test node-sp-auth's NTLM authentication with SP 2010, I was surprised, but it works like a charm.

I've checked some request to /_vti_bin/listdata.svc: getting list of lists, getting list's items, creating an item with:

var listName = 'Test';
$.ajax({
    url: "http://localhost:8080/sites/help/_vti_bin/listdata.svc/" + listName,
    type: "POST",
    processData: false,
    contentType: "application/json;odata=verbose",
    data: JSON.stringify({ "Title": "test" }),
    headers: {
        "Accept": "application/json;odata=verbose"
    },
    success: function(data) {
        console.log(data.d);
    },
    error: function(err) {
        console.log(err);
    }
});

It works with the combination of sp-rest-proxy and SharePoint 2010 now.

Theoretically, even multipart batch request should work (POST http://contoso/sites/sharepointlist/_vti_bin/listdata.svc/$batch HTTP/1.1).

I'm not going to add full support for 2010 and integration tests, at least for now, but I have a feeling that most scenarios (SOAP, legacy REST, JSOM, static content) with SP 2010 should work as well.

It would be great if you could take a look and test your scenarios with SharePoint 2010 and the latest version of sp-rest-proxy.

Thanks!

Closing this issue, but feel free to reopen if anything won't work.

from sp-rest-proxy.

johnnliu avatar johnnliu commented on May 27, 2024 1

I only just saw this. will try hopefully soon.

from sp-rest-proxy.

koltyakov avatar koltyakov commented on May 27, 2024

Hi John,

Interesting. What about authentication?
I have never tried node-sp-auth with 2010.
I don't even have SP 2010 environment nowadays, to test it right away.

Actually, /_api shouldn't be changed to /_vti_bin. It's possible to have multiple routers, just like in the case of SOAP implementation, when app.use('*/_vti_bin', _self.routers.apiSoapRouter); routes to a specific request builder depending on URI pattern.

need to think a bit more about how to support this properly, do you want to add a flag to config to specify which SharePoint the user is running?

Yep. We got to think more.
Base implementation can stay as it is, as there was no /_api endpoint alias in SP 2010, but /_vti_bin part should be thought in some way to deal with ASMX's and SVC's simultaneously.
Also, I'm not sure about authentication.

--
Andrew

from sp-rest-proxy.

johnnliu avatar johnnliu commented on May 27, 2024

Stabbed at this a bit more today - I was able to use apiSoapRouter to proxy POST requests to custom .svc as well. For this on-premises customer I had many REST Soap services deployed which I'm proxy'ing. Had to tell the apiSoapRouter (which auth with NTLM) to not parse body as XML and keep it as JSON instead.

There is still the issue of scrubbing the page for a FormDigest for listdata.svc. As there is no _api/contextinfo. I think this is a task that should be done by in node-sp-auth though.

Ultimately this might just be too crazy.

I've hacked the index.js to pieces I feel bad.

from sp-rest-proxy.

Related Issues (20)

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.