W3C home > Mailing lists > Public > public-hydra@w3.org > December 2014

Implementing Hydra in PLP Provider

From: ☮ elf Pavlik ☮ <perpetual-tripper@wwelves.org>
Date: Mon, 01 Dec 2014 03:43:36 +0100
Message-ID: <547BD5D8.8010401@wwelves.org>
To: public-hydra@w3.org

I just got prototype of PLP Provider to the point where I can start
implementing Hydra API

Currently README describes implemented API, TL;DR

GET /:uuid
PUT /:uuid
DELETE /:uuid

Tomorrow I plan to work on first draft of hydra:ApiDocumentation. Few
questions come to my mind

1. Can I set entrypoint to / and define for it suportedOperation
{ "method": "POST", "@type": "CreateResourceOperation" }
2. From API perspective I would like to treat all resources as
plp:Profile, but let them have actual types like schema:Person,
schema:Event etc. Do I need to include plp:Profile in @type of each
resource or hydra:ApiDocumentation could handle this somehow?
3. How to describe required Authorization header? - POST, PUT, DELETE
require JSON Web Token(JWT)[1] in it
4. How to describe property which requires Mozilla Persona assertion[2],
assuming existence of an URI for such class (let's say
persona:Assertion). Would something like below do:

  "@context": "http://www.w3.org/ns/hydra/context.jsonld",
  "@id": "http://hackers4peace.net/plp/api#login",
  "@type": "Link",
  "title": "Login",
  "description": "A link to login endpoint",
  "supportedOperation": [
      "@type": "LoginOperation",
      "title": "Login to the web service",
      "method": "POST",
      "expects": "persona:Assertion",
      "returns": "auth:JsonWebToken",
      "statusCodes": [
        ... optional information about status codes that might be
returned ...

Thanks for your feedback!

[1] http://jwt.io
[2] https://developer.mozilla.org/en-US/docs/Web/API/navigator.id.get
Received on Monday, 1 December 2014 02:45:44 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:29:44 UTC