moonrope 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/Gemfile.lock +6 -6
- data/lib/moonrope/base.rb +26 -0
- data/lib/moonrope/rack_middleware.rb +29 -14
- data/lib/moonrope/request.rb +8 -0
- data/lib/moonrope/structure.rb +2 -2
- data/lib/moonrope/structure_attribute.rb +1 -1
- data/lib/moonrope/version.rb +1 -1
- data/moonrope.gemspec +2 -2
- data/templates/basic/_action_form.erb +1 -1
- data/test/tests/rack_middleware_test.rb +14 -0
- data/test/tests/structures_test.rb +8 -0
- metadata +11 -30
- data/html/assets/lock.svg +0 -3
- data/html/assets/reset.css +0 -101
- data/html/assets/style.css +0 -348
- data/html/assets/tool.svg +0 -4
- data/html/assets/try.js +0 -151
- data/html/authenticators/default.html +0 -191
- data/html/controllers/meta.html +0 -73
- data/html/controllers/meta/version.html +0 -144
- data/html/controllers/users.html +0 -93
- data/html/controllers/users/create.html +0 -341
- data/html/controllers/users/list.html +0 -348
- data/html/controllers/users/show.html +0 -261
- data/html/controllers/users/update.html +0 -387
- data/html/index.html +0 -166
- data/html/moonrope.txt +0 -0
- data/html/structures/pet.html +0 -176
- data/html/structures/user.html +0 -338
@@ -1,191 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Authentication - API Documentation</title>
|
5
|
-
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
|
6
|
-
<link href='https://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
|
7
|
-
<link rel="stylesheet" href="../assets/reset.css">
|
8
|
-
<link rel="stylesheet" href="../assets/style.css">
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<section class='sidebarBackground'></section>
|
12
|
-
<section class="sidebar">
|
13
|
-
<nav>
|
14
|
-
<ul>
|
15
|
-
<li>
|
16
|
-
<a href='../index.html' class="">
|
17
|
-
Home
|
18
|
-
</a>
|
19
|
-
</li>
|
20
|
-
|
21
|
-
<li>
|
22
|
-
<a href='../authenticators/default.html' class="active">
|
23
|
-
Authentication
|
24
|
-
</a>
|
25
|
-
</li>
|
26
|
-
|
27
|
-
|
28
|
-
<li>
|
29
|
-
<a href='../controllers/meta.html' class="">
|
30
|
-
Meta API
|
31
|
-
</a>
|
32
|
-
</li>
|
33
|
-
|
34
|
-
<li>
|
35
|
-
<a href='../controllers/users.html' class="">
|
36
|
-
Users API
|
37
|
-
</a>
|
38
|
-
</li>
|
39
|
-
|
40
|
-
</ul>
|
41
|
-
</nav>
|
42
|
-
</section>
|
43
|
-
<section class='content'>
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
<h1>Authentication</h1>
|
49
|
-
|
50
|
-
|
51
|
-
<p class='text'>
|
52
|
-
To authenticate to the API, you need to pass an appropriate API token with your
|
53
|
-
request. To find out how to obtain an API token, please refer to the Authentication
|
54
|
-
API documentaton which outlines the available methods available for this.
|
55
|
-
|
56
|
-
</p>
|
57
|
-
|
58
|
-
<h2>Authentication Headers</h2>
|
59
|
-
<p class='text'>
|
60
|
-
The following headers are used to identify yourself to the API client. These should be
|
61
|
-
sent as standard HTTP headers with any API request.
|
62
|
-
</p>
|
63
|
-
<table class='table paramTable'>
|
64
|
-
<thead>
|
65
|
-
<tr>
|
66
|
-
<th width="60%">Header</th>
|
67
|
-
<th width="40%">Example</th>
|
68
|
-
</tr>
|
69
|
-
</thead>
|
70
|
-
|
71
|
-
<tr>
|
72
|
-
<td>
|
73
|
-
<p>
|
74
|
-
<span class='paramTable__name'>X-Auth-Application</span>
|
75
|
-
</p>
|
76
|
-
|
77
|
-
<p class='paramTable__description'>The API application which is generated by us and provided to you.</p>
|
78
|
-
|
79
|
-
</td>
|
80
|
-
<td>abc123abc123abc123 </td>
|
81
|
-
</tr>
|
82
|
-
|
83
|
-
<tr>
|
84
|
-
<td>
|
85
|
-
<p>
|
86
|
-
<span class='paramTable__name'>X-Auth-Token</span>
|
87
|
-
</p>
|
88
|
-
|
89
|
-
<p class='paramTable__description'>The API token for the user you wish to authenticate as.</p>
|
90
|
-
|
91
|
-
</td>
|
92
|
-
<td>abc123abc123abc123 </td>
|
93
|
-
</tr>
|
94
|
-
|
95
|
-
</table>
|
96
|
-
|
97
|
-
<h2>Errors</h2>
|
98
|
-
<p class='text'>
|
99
|
-
The errors listed below may be raised if any issues occur when verifying your
|
100
|
-
identity with the API.
|
101
|
-
</p>
|
102
|
-
|
103
|
-
<table class='table errorsTable'>
|
104
|
-
<thead>
|
105
|
-
<tr>
|
106
|
-
<th width="60%">Error</th>
|
107
|
-
<th width="40%">Attributes</th>
|
108
|
-
</tr>
|
109
|
-
</thead>
|
110
|
-
|
111
|
-
<tr>
|
112
|
-
<td>
|
113
|
-
<p>
|
114
|
-
<span class='paramTable__name'>InvalidApplicationToken</span>
|
115
|
-
|
116
|
-
<p class='paramTable__description'>The application token provided in X-Auth-Application is not valid.</p>
|
117
|
-
|
118
|
-
</p>
|
119
|
-
</td>
|
120
|
-
<td>
|
121
|
-
|
122
|
-
<ul class='errorAttributeList'>
|
123
|
-
|
124
|
-
<li>
|
125
|
-
<p class='errorAttributeList__name'>token</p>
|
126
|
-
<p class='errorAttributeList__desc'>The token used to find the application</p>
|
127
|
-
</li>
|
128
|
-
|
129
|
-
</ul>
|
130
|
-
|
131
|
-
</td>
|
132
|
-
</tr>
|
133
|
-
|
134
|
-
<tr>
|
135
|
-
<td>
|
136
|
-
<p>
|
137
|
-
<span class='paramTable__name'>InvalidAuthToken</span>
|
138
|
-
|
139
|
-
<p class='paramTable__description'>The auth token provided in X-Auth-Token is not valid.</p>
|
140
|
-
|
141
|
-
</p>
|
142
|
-
</td>
|
143
|
-
<td>
|
144
|
-
|
145
|
-
<ul class='errorAttributeList'>
|
146
|
-
|
147
|
-
<li>
|
148
|
-
<p class='errorAttributeList__name'>token</p>
|
149
|
-
<p class='errorAttributeList__desc'>The token that was used</p>
|
150
|
-
</li>
|
151
|
-
|
152
|
-
</ul>
|
153
|
-
|
154
|
-
</td>
|
155
|
-
</tr>
|
156
|
-
|
157
|
-
<tr>
|
158
|
-
<td>
|
159
|
-
<p>
|
160
|
-
<span class='paramTable__name'>ExpiredAuthToken</span>
|
161
|
-
|
162
|
-
<p class='paramTable__description'>The auth token provided in X-Auth-Token has expired.</p>
|
163
|
-
|
164
|
-
</p>
|
165
|
-
</td>
|
166
|
-
<td>
|
167
|
-
|
168
|
-
<ul class='errorAttributeList'>
|
169
|
-
|
170
|
-
<li>
|
171
|
-
<p class='errorAttributeList__name'>expired_at</p>
|
172
|
-
<p class='errorAttributeList__desc'>The time the token expired</p>
|
173
|
-
</li>
|
174
|
-
|
175
|
-
</ul>
|
176
|
-
|
177
|
-
</td>
|
178
|
-
</tr>
|
179
|
-
|
180
|
-
</table>
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
</section>
|
185
|
-
<footer class='footer'>
|
186
|
-
<p>Generated by Moonrope at 12:43 on Monday 22 February 2016 for d3c499</p>
|
187
|
-
</footer>
|
188
|
-
<script src='https://code.jquery.com/jquery-1.12.0.min.js'></script>
|
189
|
-
<script src='../assets/try.js'></script>
|
190
|
-
</body>
|
191
|
-
</html>
|
data/html/controllers/meta.html
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Meta API - API Documentation</title>
|
5
|
-
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
|
6
|
-
<link href='https://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
|
7
|
-
<link rel="stylesheet" href="../assets/reset.css">
|
8
|
-
<link rel="stylesheet" href="../assets/style.css">
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<section class='sidebarBackground'></section>
|
12
|
-
<section class="sidebar">
|
13
|
-
<nav>
|
14
|
-
<ul>
|
15
|
-
<li>
|
16
|
-
<a href='../index.html' class="">
|
17
|
-
Home
|
18
|
-
</a>
|
19
|
-
</li>
|
20
|
-
|
21
|
-
<li>
|
22
|
-
<a href='../authenticators/default.html' class="">
|
23
|
-
Authentication
|
24
|
-
</a>
|
25
|
-
</li>
|
26
|
-
|
27
|
-
|
28
|
-
<li>
|
29
|
-
<a href='../controllers/meta.html' class="active">
|
30
|
-
Meta API
|
31
|
-
</a>
|
32
|
-
</li>
|
33
|
-
|
34
|
-
<li>
|
35
|
-
<a href='../controllers/users.html' class="">
|
36
|
-
Users API
|
37
|
-
</a>
|
38
|
-
</li>
|
39
|
-
|
40
|
-
</ul>
|
41
|
-
</nav>
|
42
|
-
</section>
|
43
|
-
<section class='content'>
|
44
|
-
|
45
|
-
|
46
|
-
<h1>Meta API</h1>
|
47
|
-
|
48
|
-
<p class='text'> The meta API provides you with access to information about the API itself.
|
49
|
-
</p>
|
50
|
-
|
51
|
-
<h2>Action</h2>
|
52
|
-
<p class='text'>
|
53
|
-
The following actions are available. Choose from the list below
|
54
|
-
to view full details of how to access them.
|
55
|
-
</p>
|
56
|
-
<ul class='standardList'>
|
57
|
-
|
58
|
-
<li>
|
59
|
-
<a class='link' href='../controllers/meta/version.html'>version</a>
|
60
|
-
<p class='apiURL'><span>/api/v1/</span><b>meta/version</b></p>
|
61
|
-
<p class='meta'>Return the current software version</p>
|
62
|
-
</li>
|
63
|
-
|
64
|
-
</ul>
|
65
|
-
|
66
|
-
</section>
|
67
|
-
<footer class='footer'>
|
68
|
-
<p>Generated by Moonrope at 12:43 on Monday 22 February 2016 for d3c499</p>
|
69
|
-
</footer>
|
70
|
-
<script src='https://code.jquery.com/jquery-1.12.0.min.js'></script>
|
71
|
-
<script src='../assets/try.js'></script>
|
72
|
-
</body>
|
73
|
-
</html>
|
@@ -1,144 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>version - Meta API - API Documentation</title>
|
5
|
-
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
|
6
|
-
<link href='https://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
|
7
|
-
<link rel="stylesheet" href="../../assets/reset.css">
|
8
|
-
<link rel="stylesheet" href="../../assets/style.css">
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<section class='sidebarBackground'></section>
|
12
|
-
<section class="sidebar">
|
13
|
-
<nav>
|
14
|
-
<ul>
|
15
|
-
<li>
|
16
|
-
<a href='../../index.html' class="">
|
17
|
-
Home
|
18
|
-
</a>
|
19
|
-
</li>
|
20
|
-
|
21
|
-
<li>
|
22
|
-
<a href='../../authenticators/default.html' class="">
|
23
|
-
Authentication
|
24
|
-
</a>
|
25
|
-
</li>
|
26
|
-
|
27
|
-
|
28
|
-
<li>
|
29
|
-
<a href='../../controllers/meta.html' class="active">
|
30
|
-
Meta API
|
31
|
-
</a>
|
32
|
-
</li>
|
33
|
-
|
34
|
-
<li>
|
35
|
-
<a href='../../controllers/users.html' class="">
|
36
|
-
Users API
|
37
|
-
</a>
|
38
|
-
</li>
|
39
|
-
|
40
|
-
</ul>
|
41
|
-
</nav>
|
42
|
-
</section>
|
43
|
-
<section class='content'>
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
<h1>version</h1>
|
48
|
-
|
49
|
-
<p class='text'>Return the current software version</p>
|
50
|
-
|
51
|
-
|
52
|
-
<p class='tryFormActivate'><a class='tryFormActivate__button' href='#'>Try this request in your browser</a></p>
|
53
|
-
<form class='tryForm'>
|
54
|
-
<input type='hidden' name='controller' value='meta'>
|
55
|
-
<input type='hidden' name='action' value='version'>
|
56
|
-
<div class='tryForm__header'>
|
57
|
-
<input type='text' id='host' name='host' value=''>
|
58
|
-
/api/
|
59
|
-
<input type='text' id='version' name='version' value='v1' class='v'>
|
60
|
-
/meta/version
|
61
|
-
</div>
|
62
|
-
|
63
|
-
|
64
|
-
<p class='tryForm__heading'>Headers</p>
|
65
|
-
<table class='tryForm__table'>
|
66
|
-
|
67
|
-
<tr>
|
68
|
-
<td width="50%"><code>X-Auth-Application</code></td>
|
69
|
-
<td width="50%"><input type='text' class='tryForm__tableField headerField' name='X-Auth-Application'></td>
|
70
|
-
</tr>
|
71
|
-
|
72
|
-
<tr>
|
73
|
-
<td width="50%"><code>X-Auth-Token</code></td>
|
74
|
-
<td width="50%"><input type='text' class='tryForm__tableField headerField' name='X-Auth-Token'></td>
|
75
|
-
</tr>
|
76
|
-
|
77
|
-
</table>
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
<p class='tryForm__button'>
|
85
|
-
<button class='tryForm__buttonLink' type='submit'>Make this request</button>
|
86
|
-
<button class='tryForm__buttonLink tryFormCancel' type='button'>Cancel</button>
|
87
|
-
</p>
|
88
|
-
|
89
|
-
<pre class='tryForm__output'>The request output will be shown here...</pre>
|
90
|
-
</form>
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<h2>URL</h2>
|
96
|
-
<p class='apiURLFull'><span>/api/v1/</span>meta/version</p>
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
<h2>Access</h2>
|
102
|
-
<p class='text'>
|
103
|
-
Must be authenticated with a valid user API token.
|
104
|
-
|
105
|
-
If not authorised, a <code>NotAuthenticated</code> error will be returned.
|
106
|
-
|
107
|
-
</p>
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
<h2>Parameters</h2>
|
113
|
-
|
114
|
-
<p><em>This action doesn't support any parameters.</em></p>
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
<h2>Errors</h2>
|
120
|
-
|
121
|
-
|
122
|
-
<p><em>There are no action-specific errors which can be raised.</em></p>
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
<h2>Response Data</h2>
|
127
|
-
|
128
|
-
<p class='text'>
|
129
|
-
This action will return a String.
|
130
|
-
</p>
|
131
|
-
|
132
|
-
<pre class='code'>v1.2.3</pre>
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
</section>
|
138
|
-
<footer class='footer'>
|
139
|
-
<p>Generated by Moonrope at 12:43 on Monday 22 February 2016 for d3c499</p>
|
140
|
-
</footer>
|
141
|
-
<script src='https://code.jquery.com/jquery-1.12.0.min.js'></script>
|
142
|
-
<script src='../../assets/try.js'></script>
|
143
|
-
</body>
|
144
|
-
</html>
|
data/html/controllers/users.html
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Users API - API Documentation</title>
|
5
|
-
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
|
6
|
-
<link href='https://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
|
7
|
-
<link rel="stylesheet" href="../assets/reset.css">
|
8
|
-
<link rel="stylesheet" href="../assets/style.css">
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<section class='sidebarBackground'></section>
|
12
|
-
<section class="sidebar">
|
13
|
-
<nav>
|
14
|
-
<ul>
|
15
|
-
<li>
|
16
|
-
<a href='../index.html' class="">
|
17
|
-
Home
|
18
|
-
</a>
|
19
|
-
</li>
|
20
|
-
|
21
|
-
<li>
|
22
|
-
<a href='../authenticators/default.html' class="">
|
23
|
-
Authentication
|
24
|
-
</a>
|
25
|
-
</li>
|
26
|
-
|
27
|
-
|
28
|
-
<li>
|
29
|
-
<a href='../controllers/meta.html' class="">
|
30
|
-
Meta API
|
31
|
-
</a>
|
32
|
-
</li>
|
33
|
-
|
34
|
-
<li>
|
35
|
-
<a href='../controllers/users.html' class="active">
|
36
|
-
Users API
|
37
|
-
</a>
|
38
|
-
</li>
|
39
|
-
|
40
|
-
</ul>
|
41
|
-
</nav>
|
42
|
-
</section>
|
43
|
-
<section class='content'>
|
44
|
-
|
45
|
-
|
46
|
-
<h1>Users API</h1>
|
47
|
-
|
48
|
-
<p class='text'> The Users API provides full access to manage the users
|
49
|
-
which exist on your account.
|
50
|
-
</p>
|
51
|
-
|
52
|
-
<h2>Action</h2>
|
53
|
-
<p class='text'>
|
54
|
-
The following actions are available. Choose from the list below
|
55
|
-
to view full details of how to access them.
|
56
|
-
</p>
|
57
|
-
<ul class='standardList'>
|
58
|
-
|
59
|
-
<li>
|
60
|
-
<a class='link' href='../controllers/users/list.html'>List all users</a>
|
61
|
-
<p class='apiURL'><span>/api/v1/</span><b>users/list</b></p>
|
62
|
-
<p class='meta'>This action will return a list of all users which the authenticated user has access to.</p>
|
63
|
-
</li>
|
64
|
-
|
65
|
-
<li>
|
66
|
-
<a class='link' href='../controllers/users/show.html'>Get unit information</a>
|
67
|
-
<p class='apiURL'><span>/api/v1/</span><b>users/show</b></p>
|
68
|
-
|
69
|
-
</li>
|
70
|
-
|
71
|
-
<li>
|
72
|
-
<a class='link' href='../controllers/users/create.html'>Create a new user</a>
|
73
|
-
<p class='apiURL'><span>/api/v1/</span><b>users/create</b></p>
|
74
|
-
<p class='meta'> This action will create a new user with the properties which have been provided.
|
75
|
-
</p>
|
76
|
-
</li>
|
77
|
-
|
78
|
-
<li>
|
79
|
-
<a class='link' href='../controllers/users/update.html'>Update an existing user</a>
|
80
|
-
<p class='apiURL'><span>/api/v1/</span><b>users/update</b></p>
|
81
|
-
<p class='meta'>This action will update an existing user with the properties provided.</p>
|
82
|
-
</li>
|
83
|
-
|
84
|
-
</ul>
|
85
|
-
|
86
|
-
</section>
|
87
|
-
<footer class='footer'>
|
88
|
-
<p>Generated by Moonrope at 12:43 on Monday 22 February 2016 for d3c499</p>
|
89
|
-
</footer>
|
90
|
-
<script src='https://code.jquery.com/jquery-1.12.0.min.js'></script>
|
91
|
-
<script src='../assets/try.js'></script>
|
92
|
-
</body>
|
93
|
-
</html>
|