Implementing Hydra in PLP Provider

Howdy!

I just got prototype of PLP Provider to the point where I can start
implementing Hydra API
https://github.com/hackers4peace/plp-provider/tree/hydra

Currently README describes implemented API, TL;DR

POST /
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