Code Monkey home page Code Monkey logo

pritunl_api_client's People

Contributors

eterry1388 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

pritunl_api_client's Issues

RestClient::Unauthorized (401 Unauthorized) for about half of the resources

After exploring this gem for a while, I encountered some issues. I'm not down with the internals of Pritunl Enterprise, so I'm not sure if the gem or the server is to blame.

Anyway, if I list organizations, I get a response. If I list users for an organization id, I get a response.
But if I try to create a user, I get a:

RestClient::Unauthorized (401 Unauthorized)

Here is the output from RestClient

RestClient.post "https://pritunl-dev-test.***.**/user/5c0ae40011a33c0bae961789", "{"name": "Joe"}", "Accept"=>"application/json", "Accept-Encoding"=>"gzip, deflate", "Auth-Nonce"=>"7a7f5dda2dac4bc0f5b9ce1282572aef", "Auth-Signature"=>"iNb4RArLI0QzVtZRxkOKZPfFwaC1+zFkbeJnTSiXkUs=", "Auth-Timestamp"=>"1548264077", "Auth-Token"=>"cG7DU75l6ODlVBDfl5y3W0Lo0VkTEAcL", "Content-Length"=>"15", "Content-Type"=>"application/json", "User-Agent"=>"rest-client/2.0.2 (darwin18.2.0 x86_64) ruby/2.5.1p57"

I have taken a look at https://github.com/pritunl/pritunl/blob/master/pritunl/handlers/user.py and it doesn't seem to make any distinction between the different resources. All of them are decorated with @auth.session_auth.

My only suspect is these conditions if settings.app.demo_mode:, but there is nothing indicating any "demo mode" being activated. I've checked the MongoDB app document in the settings collection and nothing. And even if it was the case, the code here implies that I should get a 400, not 401: https://github.com/pritunl/pritunl/blob/533fb5ea2b2a60dfb75103bfd19ed121302409c7/pritunl/utils/json_helpers.py#L54

Any clues?

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.