GithubHelp home page GithubHelp logo

onlivfe / neos_rs Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 1 MB

NeosVR API rust crate (unofficial)

License: Mozilla Public License 2.0

Rust 100.00%
neos neosvr rust rust-crate rust-lang social-vr vr rust-library neosvr-api api-client

neos_rs's Introduction

Neos API in rust

License Crates.io Docs

Rust models of NeosVR's API.

Featuring full serde support, time for datetimes, and strum for better enums.

Any official documentation of Neos' API is lacking, and the API is still changing too. So this crate can't guarantee correctness. Some of the types are based solely on educated guesses even.

This crate provides an example API client with the optional api_client feature.

Future plans

  • Better documentation in general
  • Splitting some linked Option<T> fields into their own sub-structs

Testing

The integration tests contact the live API. That's why they are ignored by default.

Some of them also require authentication.

Sadly not all the things can even be reliably tested without creating a mock API. Which in turn defeats the purpose of the tests in the first place.

Creating a user session manually

You can generate a user-sesion.json file with logging in via curl for example:

curl --request POST \
  --url https://cloudx.azurewebsites.net/api/userSessions \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data '{
  "password": "pa$$word",
  "secretMachineId": "string",
  "rememberMe": true,
  "ownerId": "string",
  "email": "[email protected]",
  "username": "string"
}' > user-session.json

Only use a single identification method (username/email/ownerId). Also be sure to replace the rest of the values with your own. Using a secretMachineId is also recommended to not log out your other sessions. You can generate a random one for example with: openssl rand -hex 32

Running ignored tests

Make sure that you've got:

  • an internet connection
  • a valid user-sesion.json

Then just run the tests;

# A specific test with output logging
cargo test --all-features get_user -- --exact --ignored --nocapture
# All tests
cargo test --all-features -- --ignored

License

Note that the license is MPL-2.0 instead of the more common MIT OR Apache-2.0. A license change however can be negotiated if the Neos team wants to use this crate or adopt this crate into a more official one with a different license.

neos_rs's People

Contributors

ljoonal avatar

Watchers

 avatar  avatar  avatar

Forkers

mangolefroot

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.