Git Product home page Git Product logo

azure-documentdb-rubysdk's Introduction

Azure DocumentDB Ruby SDK

Build Status Code Climate

Lacking an official ruby SDK I'm going to start building one from my use case perspective. Please help contribute and grow this project.

Usage

gem install azure-documentdb-sdk

Require the SDK

require 'documentdb'

Sections

  • Database - CRUD operations associated to a database.
  • User - CRUD operations associated to a user.
  • Permission - CRUD operations associated to a permission.
  • Collection - CRUD operations associated to a collection.
  • Document - CRUD operations associated to a document.
  • Offer - CRUD operations associated to an offer.
  • Query - object encompassing the execution of a query on an entity.

Master Key vs Resource Token

Master Key vs Resource Token is an important cooncept this is explained in detail under Access Control.

Implementation wise the mechanism these two entities work under has resulted in some details that are important to know and understand.

  • Master Token authentication is automatically assumed for all entitites. It is handled via the application Azure::DocumentDB::Context object. This is intended to be managed in the constructor of all objects so you don't have to worry about it.
  • Resource Token usage is intended to be explicit and when you use it then the operation should fail if authorization fails. This allows fall back to master token usage to be allowed by your logic rather then the SDK.
  • For entities like context that only have some operations that can take a resource token then it was intended that you explicitly call a method with the token.
  • For entities that allow all operations to be used with a resource token then the entire entity either uses the resource token or the master key for all operations.

Errors

API errors will be allowed to bubble up for clarity reasons. For example supplying the wrong master key will result in a 401 error or a 409 error will result from using a resource token that is not authorized for the requested operation or resource. These error will be thrown by the RestClient api.

Development

Install Bundler.

gem install bundler

Clone the project.

bundle install

To execute tests and run static analysis via rubocop:

rake

Coverage can be found in the ./coverage directory

azure-documentdb-rubysdk's People

Contributors

adammartin avatar

Watchers

 avatar

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.