clj-osf.auth.registrar.ws

Send a

To use the Auth: Registrar WS code, you have to:

;; Use/require the namespace
(require '[clj-osf.auth.registrar.ws access :as auth-rw])

;; Define the OSF Sandbox credentials (or your own):
(require '[clj-osf.core :as osf])

(osf/defosf osf-test-endpoint {:protocol :http
                               :domain "sandbox.opensemanticframework.org"
                               :api-key "EDC33DA4D977CFDF7B90545565E07324"
                               :app-id "administer"})

(osf/defuser osf-test-user {:uri "http://sandbox.opensemanticframework.org/wsf/users/admin"})

Open Semantic Framework Endpoint Documentation

crud-permissions

(crud-permissions create read update delete)

Define a CRUD permissions record to be used as input to other Auth Registrar: Access functions

Parameters
  • [create] Specify if you want create permissions for this CRUD record
  • [read] Specify if you want read permissions for this CRUD record
  • [update] Specify if you want update permissions for this CRUD record
  • [delete] Specify if you want delete permissions for this CRUD record
Usage
(auth/registrar-ws
  (auth/crud-usage
    (auth/crud-permissions true true true true)))

crud-usage

(crud-usage permissions)

Define the CRUD usage of the endpoint. The CRUD usage are the 4 CRUD operations that the endpoint can perform on the data hosted on the OSF instance. For example, the CRUD: Create endpoint has the CRUD usage: <True,False,False,False>. This means that it perform creation operations with the data. This means that the user that will send a request to the CRUD: Create web service endpoint will need to have Create permissions on the target dataset in order to be able to use that web service endpoint on that target dataset.

The usage of this function is Required

Parameters
  • [permissions] CRUD permissions object generated by (crud-permissions)
Usage
(auth/registrar-ws
  (auth/crud-usage
    (auth/crud-permissions true true true true)))

endpoint-uri

(endpoint-uri uri)

URI of the web service to register to the OSF instance. The URI is the unique idenfier of the endpoint, in the OSF instance. That URI is not the URL access endpoint. However, both can be the same.

The usage of this function is Required

Note: in OSF, when another web service require the URI/Identifier of a web service, it is really the URI of that web service, and not its access URL.

Parameters
  • [uri] URI of the web service to register to the OSF instance
Usage
(auth/registrar-ws
  (auth/endpoint-uri "http://sandbox.opensemanticframework.org/wsf/ws/my/new/endpoint/"))

endpoint-url

(endpoint-url url)

URL of the web service endpoint where to send the HTTP queries.

The usage of this function is Required

Parameters
  • [url] URL of the web service endpoint that people will access on the web
Usage
(auth/registrar-ws
  (auth/endpoint-url "http://sandbox.opensemanticframework.org/ws/my/new/endpoint/"))

registrar-ws

(registrar-ws & body)

Auth: Registrar WS query.

Required

Usage
(require '[clj-osf.auth.registrar.ws :as auth-rw])

(auth-rw/registrar-ws
  (auth-rw/title "My New Web Service Endpoint")
  (auth-rw/endpoint-uri "http://sandbox.opensemanticframework.org/wsf/ws/my/new/endpoint/")
  (auth-rw/endpoint-url "http://sandbox.opensemanticframework.org/ws/my/new/endpoint/")
  (auth-rw/crud-usage
    (auth-rw/crud-permissions true true true true)))

title

(title title)

Title of the web service to register to this OSF instance

The usage of this function is Required

Parameters
  • [title] Title of the web service to register
Usage
(auth/registrar-ws
  (auth/title "My New Web Service Endpoint"))