This repository has been archived by the owner on Dec 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathexample.raml
143 lines (136 loc) · 4.24 KB
/
example.raml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#%RAML 0.8
---
title: Example REST API
documentation:
- title: Home
content: |
Welcome to the example API.
baseUri: http://{host}:{port}/{version}
version: v1
mediaType: application/json
protocols: [HTTP, HTTPS]
securitySchemes:
- x_token_auth:
description: Authorization header token policy
type: x-ApiKey
- x_ticket_auth:
description: Standard Pyramid Auth Ticket policy
type: x-Ticket
settings:
secret: auth_tkt_secret
hashalg: sha512
cookie_name: ramses_auth_tkt
http_only: true
- item_owner_acl:
description: ACL that allows everyone to read, authenticated to create and item owners to edit item
type: x-ACL
settings:
collection: |
allow g:admin all
allow everyone view,options
allow authenticated create
item: |
allow g:admin all
allow {{item_owner}} view, update
- user_self_acl:
description: ACL that allows everyone to read, authenticated to create and owner to edit
type: x-ACL
settings:
collection: |
allow g:admin all
allow everyone view,options
item: |
allow g:admin all
allow everyone view,options
allow {{user_self}} update
- user_profile_acl:
description: ACL gives all permissions to admins and profile's user
type: x-ACL
settings:
collection: |
allow g:admin all
allow {{user_profile}} all
item: |
allow g:admin all
allow {{user_profile}} all
securedBy: [x_ticket_auth]
/users:
securedBy: [user_self_acl]
displayName: All users
get:
description: Get all users
post:
description: Create a new user
body:
application/json:
schema: !include schemas/user.json
patch:
description: Update multiple users
head:
description: Determine whether a given resource is available
options:
description: Retrieve the available HTTP verbs for a given resource
/{username}:
displayName: One user
get:
description: Get a particular user
patch:
put:
description: Update a particular user
delete:
description: Delete a particular user
/settings:
displayName: User settings
get:
description: Get all settings of a particular user
post:
description: Change a user's settings
/groups:
displayName: User groups
get:
description: Get all groups of a particular user
post:
description: Change a user's groups
/profile:
securedBy: [user_profile_acl]
displayName: User profile
get:
description: Get a user's profile
post:
description: Create a user's profile
body:
application/json:
schema: !include schemas/profile.json
patch:
description: Update a user's profile
/stories:
securedBy: [item_owner_acl]
displayName: All stories
get:
description: Get all stories
post:
description: Create a new story
body:
application/json:
schema: !include schemas/story.json
patch:
description: Update multiple stories
delete:
description: Delete multiple stories
head:
description: Determine whether a given resource is available
options:
description: Retrieve the available HTTP verbs for a given resource
/{id}:
displayName: One story
get:
description: Get a particular story
delete:
description: Delete a particular story
patch:
put:
description: Update a particular story
head:
description: Determine whether a given resource is available
options:
description: Retrieve the available HTTP verbs for a given resource