Little client & server apps in Ruby for downloading authorized files

I’m about to try a little test project in Ruby, but want to make sure
I’m on the right foot.

Any advice appreciated before I start this. MOST important : I want
to make sure I’m not just re-inventing the wheel, if there’s a library
out there that does this exact thing already.

SERVER:
Has some protected files, not in a webroot, that I want to let the client
download only if they pass me a verified key in the server’s “OK” database.

CLIENT:
Knows which files it wants (by file id# not full path). Knows its key to
get them. Passes some kind of message to the remote server saying, “Here
is my key. Here is the file I want.” Server replies by passing the file,
and a little metadata about the file.

Sound familiar?
Should I do it from scratch or is this just some well-known library I
don’t know about? (I searched around, of course, but couldn’t find one.)

Thanks!

Ruby Baby wrote:

SERVER:
Has some protected files, not in a webroot, that I want to let the client
download only if they pass me a verified key in the server’s “OK” database.

CLIENT:
Knows which files it wants (by file id# not full path). Knows its key to
get them. Passes some kind of message to the remote server saying, “Here
is my key. Here is the file I want.” Server replies by passing the file,
and a little metadata about the file.

Sound familiar?
Should I do it from scratch or is this just some well-known library I
don’t know about? (I searched around, of course, but couldn’t find one.)

Why not simply use a http server? If you already have one running, write
a CGI script, otherwise use Webrick. Then the client can use Net::HTTP
to fetch a URL like http://yourhost/server.cgi?id=324234&key=sdfhjasdf.