Giter Club home page Giter Club logo

crunky's People

Contributors

geoffkinder avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

crunky's Issues

Whitelisted Queries

The queries that the backend system should run should be drawn from a limited subset that is known to be safe in order to avoid potential security vulnerabilities. For this purpose, we should assemble a whitelist of known "safe" queries and limit the user to running queries from this safe subset.

Crunky REST API

We'll want Computable backend systems like Crunky to support a REST API. The goal of the REST API is to provide a standard way for data market users to communicate with backends. Here's a first cut at some proposed REST API options:

Authentication

Description
  • AUTHENTICATE user-credentials
  • Allows a given user to authenticate itself to the backend
  • Results of a spike outlining the Metamask authentication flow can be found here
Endpoints
  • POST /signup creates a new user record
  • POST /login creates a new session record for a given user

Marketplace Schema

Description
  • GET_SCHEMA auth_token
  • Returns the scheme of the dataset, likely in JSON format
  • Can support different backend schemas (SQL/Spark/etc) with different JSON blogs
Endpoints
  • GET /marketplaces/:marketplace_id/schema returns the schema for a data marketplace, given a marketplace ID

Data Queries

Description
  • RUN_QUERY auth_token query-specification
  • Runs the specified query
  • Security is a key focus here. It's likely that we'll have a number of fixed "whitelisted" queries rather than allowing for arbitrary queries to prevent SQL injection attacks or dataset scraping attempts.
Endpoints
  • POST /marketplaces/:marketplace_id/search returns the result of the query defined in the request body

Data Management

Description
  • ADD_DATAPOINT auth_token datapoint
  • Adds the specified datapoint from backend. One datapoint corresponds to one listing in market
  • TODO: fix the terminology once we settle on it
Endpoints
  • POST /marketplaces/:marketplace_id/data adds the associated data to the data marketplace, given a marketplace ID
Description
  • REMOVE_DATAPOINT auth_token datapoint
  • Removes the specified datapoint. One datapoint corresponds to one listing in market
  • TODO: fix the datapoint/listing terminology later
Endpoints
  • DELETE /marketplaces/:marketplace_id/data/:data_id removes the specified data from its data marketplace, given data and marketplace IDs

Marketplace Discovery

Description
  • MARKETS_SUPPORTED
  • Returns a list of the markets this backend system serves and their deployed contract addresses
  • No auth token needed since public information
Endpoints
  • GET /marketplaces returns a list of supported data marketplaces

Let's discuss the details of the REST API in the comments. As we gain clarity, I'll edit this top-level listing of the REST API to stay current.

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.