Git Product home page Git Product logo

openkeyval's Introduction

OpenKeyval
==========

* The live version of the service has been sunset.  
* This codebase is no longer being maintained by the creators.  

Overview
--------
OpenKeyval is a persistent key/value store, presented as a simple web service. OpenKeyval provides everyone with free, unauthenticated access to its server. Anyone can write up to 64 KiB of data to any key. After writing a value, a read-only version of the key is returned, which allows you to safely provide read-only access to data without worrying that the other person might change its value.

OpenKeyval requires no authentication and provides absolutely no guarantees of privacy. The key to the entire system is obscurity; suitably obscure keys are unlikely to be guessed by other users, and therefore safe. Read-only keys allow you to delegate access to other users without worrying about them making changes.

Setting it up
-------------
OpenKeyval is a relatively simple application, but it has a few requirements. Here's the gist of it:
- You must serve the openkeyval directory from the root of your server
- Your server needs to support the RewriteRules in .htaccess
- The script must be able to write to the data/ subdirectory, which it will try to create in the openkeyval directory
- Invent your own salt to use when hashing values and put it into a file called salt.txt, in the same directory as the source code. This prevents malicious users from using rainbow tables to reverse a read-only key into a writable one.

Wishlist
--------
- Server
  - Refactor server to use Rails-style routing
- JavaScript
  - Optional caching using localStorage
  - OpenKeyval.isValidKey method

openkeyval's People

Contributors

ema avatar shinypb avatar

Stargazers

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

Watchers

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

openkeyval's Issues

512 characters limitation when setting a value?

Hi,

there seems to be a limitation of 512 characters for setting a value (via JSONP).

I am making a request to http://api.openkeyval.org/store/?somekey=somevalue&jsonp_callback=...

When strlen(somevalue)==512, it works fine, but when strlen(somevalue)>=513, the new value isn't stored. I still get status 200 back, the keys-array however is empty.

Have a look over at php.net, looks like some specific patch of PHP defaults to only allow 512 characters in $_GET-variables: http://www.php.net/manual/en/reserved.variables.get.php#101469

Sincerely, Christoffer

read-only key not getting latest value

When setting the value for a key, the same read-only key is always returned. The value of that key is always the original value. Any subsequent changes to the value with the read/write-key do not change the value of the read-only key.

When setting value, indicate whether key already existed in response

This would allow you to have something like a lock file that multiple clients could share.

Without knowing if the key already existed when writing, someone else could have written to the lock file in the time between you last checking if it existed, and writing to it.

Would this be useful?

Something like:

{
   "status":"multiset",
   "keys":[
      {
         "key":"testing1",
         "read_only_key":"rok-459f1694e2455461b1186749aaf3f949eba8a134",
         "new":"true"
      },
      {
         "key":"testing2",
         "read_only_key":"rok-ee9efec3c53f048a34dba2b923ddbdaa8693aead",
         "new":"false"
      }
   ],
   "documentation_url":"http:\/\/openkeyval.org\/"
}

Escaping ' " \

Some characters are being escaped which are consistent with php magic quotes being on.

$ cat test.txt 
' " \
abc123!@#$%^&*()_+=-`~;:/?><,.{}[]|

$ curl -F "data=<test.txt;type=text/plain" http://api.openkeyval.org/hello
{"status":"set","key":"hello","read_only_key":"rok-088ec226a37329f3980db9ab5082c

$ curl http://api.openkeyval.org/hello
\' \" \\
abc123!@#$%^&*()_+=-`~;:/?><,.{}[]|

urlencoded nulls are not settable

curl -d "data=%00" api.openkeyval.org/testing
{"error":"missing_field","message":"Data must be sent as form data in the field 'data'","documentation_url":"http://openkeyval.org/"}

Better Performance

If you removed PHP from the picture and used Nginx to pass requests directly to membase (membase is like memcached but it saves to disk) then you would see a large increase in performance. PHP just isn't needed unless you work out some auth/API key scheme and have to check requests.

Even then, you can by-pass PHP for the GET requests and just use it for the SET requests.

missing favicon

Please add a favicon to openkeyval. It's messing up my nameless bookmarks.

Feature Request: api limitations to prevent exploiting/overload

hi guys,

today I've hacked something both awesome and wrong. long story short, this commit:
tomash/flyingv@77e3a11
lets one store files in OKV, with auto splitting of large files (and auto merging on retrieval) to save them into separate keys.

this can be used to put large amounts of data on OKV. at the moment the only limit is that "master" value that stores a JSON array of keys of all the file chunks (although the file can be rebuilt without that, as every chunk value stores the key of "next" chunk) -- this array of keys cannot be larger than 64kB, but even assuming 100 bytes for "file chunk" key it gives 640 chunks which means 40 meg of file size limit.

I don't want to pull this code off github and don't want OKV to go down because of exploitation -- maybe you can impose some limits? (POST requests per hour or something?)

Openkeyval.org no longer working ?

Seems that openkeyval.org has stopped allowing me to commit data since the beginning of the year.

The following example works

curl -d "data=California" http://api.openkeyval.org/location

The following doesn't

curl -d "data=California" http://api.openkeyval.org/location-345345345

Trying to store data to a key that does not exist yet, gives the following error.

{"error":"save_failed","documentation_url":"http:\/\/openkeyval.org\/" 

JS library should be served zipped, not packed

Dean Edward's packer has a lower compression ratio than minification+gzip, and there's a performance overhead when unpacking a packed script.

It is very easy to serve gzipped script on S3/Cloudfront: minify the script using Google's Closure Compiler, gzip the script, remove the .gz extension, upload to S3 and add "Content-Encoding: gzip" as a cutom header.

Feature Request: Write-Once Keys

A write-once key is a key that can only be written to once, after that it becomes read only.

I'm trying to put together a kind of message board application, and I would like to stop people from editing their posts after posting.

Values consisting of only '0' get deleted

$ curl -d "data=3" api.openkeyval.org/testing

$ curl api.openkeyval.org/testing

3

$ curl -d "data=0" api.openkeyval.org/testing

$ curl api.openkeyval.org/testing

{"error":"not_found","documentation_url":"http://openkeyval.org/"}

Fatal error when installing openkeyval on a server

Hi, I've installed openkeyval on a server, but I can't store data.

This error returns when I try to save data with curl:

Fatal error: Call to a member function get() on a non-object in /home/myuser/mykeyvalserver/server.inc on line 106

Thanks for creating openkeyval.

site is down

yes, I know it's not the code issue, but still -- openkeyval.org is down

Keys are not persistent.

Keys that I know are valid and are using the full 128 byte keyspace(thus the probability of a collision is very low) are gone the next day.

Server doesn't respond to HEAD requests

conn = HTTPConnection('api.openkeyval.org:80') conn.request('HEAD', '/hello') res = conn.getresponse()

400 Bad Request
[('date', 'Fri, 05 Nov 2010 18:39:20 GMT'), ('connection', 'close'), ('x-powered-by', 'PHP/5.2.6-1+lenny9'), ('content-type', ''), ('server', 'Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch')]

Not sure if this is entirely necessary, but perhaps to check if a key exists without downloading it?

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.