-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.json
86 lines (71 loc) · 3.75 KB
/
example.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Localhost examples
==================
//Uploading an image
curl -X POST -H "Content-Type: application/json" -d '{"_id":"http://example.com/resource1","sources": [], "derivatives" : [], "meta":{"user" : "http://google.com/oshani", "usage_restrictions": ["non-commercial"]}}' http://localhost:5000/logs_temp
//Sharing an image using the client tool
curl -X POST -H "Content-Type: application/json" -d '{"_id":"http://example.com/resource2","sources": ["http://example.com/resource1"], "derivatives" : [], "meta":{"user" : "http://google.com/oshani", "usage_restrictions": ["non-commercial"]}}' http://localhost:5000/logs_temp
//Sharing an image with two usage restrictions
curl -X POST -H "Content-Type: application/json" -d '{"_id":"http://example.com/resource3","sources": ["http://example.com/resource1", "http://example.com/resource2"], "derivatives" : [], "meta":{"user" : "http://google.com/thilanka", "usage_restrictions": ["non-commercial"]}}' http://localhost:5000/logs_temp
//Specifying an action on the resource, i.e. access, modify, download (share is a special case and should be handled with the one above)
curl -X PUT -H "Content-Type: application/json" -d '{"user": "http://google.com/Oshani"}' http://localhost:5000/logs_temp/access/http%3A%2F%2Fexample.com%2Fresource3
//How to request the audit log
curl -X GET http://localhost:5000/logs_temp/audit/http%3A%2F%2Fexample.com%2Fresource3
Herokuapp examples
==================
//Uploading an image
curl -X POST -H "Content-Type: application/json" -d '{"_id":"http://example.com/resource1","sources": [], "derivatives" : [], "meta":{"user" : "http://google.com/oshani", "usage_restrictions": ["non-commercial"]}}' http://provenance-tracker.herokuapp.com/logs_temp
//Sharing an image using the client tool
curl -X POST -H "Content-Type: application/json" -d '{"_id":"http://example.com/resource2","sources": ["http://example.com/resource1"], "derivatives" : [], "meta":{"user" : "http://google.com/oshani", "usage_restrictions": ["non-commercial"]}}' http://provenance-tracker.herokuapp.com/logs_temp
//Sharing an image with two usage restrictions
curl -X POST -H "Content-Type: application/json" -d '{"_id":"http://example.com/resource3","sources": ["http://example.com/resource1", "http://example.com/resource2"], "derivatives" : [], "meta":{"user" : "http://google.com/thilanka", "usage_restrictions": ["non-commercial"]}}' http://provenance-tracker.herokuapp.com/logs_temp
//Specifying an action on the resource, i.e. access, modify, download (share is a special case and should be handled with the one above)
curl -X PUT -H "Content-Type: application/json" -d '{"user": "http://google.com/Oshani"}' http://provenance-tracker.herokuapp.com/logs_temp/access/http%3A%2F%2Fexample.com%2Fresource1
//How to request the audit log
curl -X GET http://provenance-tracker.herokuapp.com/logs_temp/audit/http%3A%2F%2Fexample.com%2Fresource1
Example Entry
==============
{
"_id":"http://example.com/resource3",
"source":[
"http://example.com/resource1"
],
"derivatives":[
],
"meta":{
"user":"http://google.com/oshani",
"usage_restrictions":[
"ur1"
]
},
"activity":[
{
"name":"access",
"time":"2014-07-28T20:33:54.090Z",
"details":{
"user":"Oshani",
"intention" : "non-commercial"
}
},
{
"name":"modify",
"time":"2014-07-28T20:35:37.739Z",
"details":{
"user":"Daniela"
}
},
{
"name":"modify",
"time":"2014-07-28T20:35:53.445Z",
"details":{
"user":"Daniela"
}
},
{
"name":"access",
"time":"2014-07-28T22:55:38.097Z",
"details":{
"user":"Oshani"
}
}
]
}