-
Notifications
You must be signed in to change notification settings - Fork 0
Server RESTful API
Mike Puckett edited this page Dec 4, 2015
·
17 revisions
Note: All requests will fail with HTTP status 401-Unauthorized
if not "logged-in"
-
POST
/s2dr/login
- Authenticates as user and begins a session
- The request body should be empty. The server uses the client X.509 certificate in the request to authenticate the user.
- Will return a 200 upon successful login
-
POST
/s2dr/upload
- Adds a document to the server
- Will return a 201 upon successfully saving the document. The response header's "Location" field will hold the URI to access the document.
- Request Body (must be of type
form-data
):
Request Body: { 'document': '${documentBitStream}', 'documentName': '${documentName}', 'securityFlags': '${securityFlag1},${securityFlag2}', 'signature': '${signatureBitStream}' }
- Multiple security flag params can be included. The
securityFlags
param should be a comma delimited list of the params. - The server will enforce that the a
securityFlag
param is "NONE", "INTEGRITY", or "CONFIDENTIALITY"
-
GET
/s2dr/document/${documentName}
- Download a document specified by
${documentName}
- Will return a 404 if there is not a document with the given
${documentName}
- Will return a 404 if the server cannot verify the RSA-SHA256 signature of the document. This should probably be a different status code.
- Will return a 401 if the user lacks READ permission.
- Will return a 200 along with the document if the other cases did not occur
- Download a document specified by
-
GET
/s2dr/document/${documentName}/signature
- Download the signature of a document specified by
${documentName}
- Will return a 404 if there is not a document with the given
${documentName}
- Will return a 401 if the user lacks READ permission.
- Will return a 200 along with the signature of the document if the other cases did not occur
- Download the signature of a document specified by
-
PUT
/s2dr/document/${documentName}
- Allows a client to delegate permissions
- Will return a 200 if the operation was successful
- Will return a 401 if the current user does not have the permission he is trying to delegate
- Request Body (must be of type
JSON(application/json)
)
Request Body { 'permissions': ['${permission1}', '${permission2}'], 'userName': ${userName}, 'timeLimitMillis;" '${timeLimitMillis}', 'canPropogate': ${canPropogate} }
- The
permissions
array parameter can hold a combination ofREAD
,WRITE
, and/orOWNER
. - The
timeLimitMillis
parameter should be the number of milliseconds corresponding to the time limit. For instance, if the time limit of the delegation is 30 seconds, thetimeLimitMillis
should be 30,000 (30 * 1000). - The server will enforce that the entries in the
permissions
param array are from "READ", "WRITE", or "OWNER" - The server will enforce that the
canPropogate
param is either "true" or "false"
-
DELETE
/s2dr/document/${documentName}
- Deletes the document specified by
${documentName}
- Will return a 200 upon successful deletion
- Deletes the document specified by
-
POST:
/s2dr/logout
- Ends the current session for the user
- Will return a 200 upon successful logout