json_voorhees 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 406a76ed292129726c8f3cab15ad4d40c292935e
|
4
|
+
data.tar.gz: 7864fb740e76ad8927414721c87cbfc4bc0b485e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fc2ea7b044075793c004f3367974e60a4b1c9b2884ece2b5a70937822ad9d5d3cb0582fbeb39c5e4734449dda6e5a8f5655c511496780c0669b5183bb09ad9e
|
7
|
+
data.tar.gz: 7c516b48e16f50a07274c6259be168cdb3305ac21f058871611172d09925cd5e096387525ce32a3c93321039323079222e70ed4c05382cfcd325e21bf96a174b
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# JsonVoorhees 0.
|
1
|
+
# JsonVoorhees 0.5.0
|
2
2
|
|
3
3
|
## Introduction
|
4
4
|
|
@@ -93,13 +93,11 @@ model, controller, serializer, test and factory created with this tool are
|
|
93
93
|
versioned. The main app hosts the application controllers and test suite. Everything
|
94
94
|
else resides in engines for good modularity.
|
95
95
|
|
96
|
-
##
|
96
|
+
## Recent Additions
|
97
97
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
4. Option for websockets and paperclip?
|
102
|
-
5. Make the non defaults easier to user
|
98
|
+
If the api has routes that can be accessed without a logged in user, skip
|
99
|
+
the authenticate_user filter and call set_hash before the method. Now current_user
|
100
|
+
will return the current user or nil and the application will not render a 401.
|
103
101
|
|
104
102
|
## Reminder
|
105
103
|
|
@@ -112,3 +110,16 @@ class and put before_filters before all of the CRUD actions.
|
|
112
110
|
Make sure the current_user has the correct permissions.
|
113
111
|
|
114
112
|
If active admin is used (it is by default) the admin section username is admin and password is password. Otherwise the password is password123.
|
113
|
+
|
114
|
+
## To Do
|
115
|
+
|
116
|
+
1. Figure out a better way to test this thing
|
117
|
+
2. Use option for namespaced engine or no engine
|
118
|
+
3. Maybe give an option to include pagination?
|
119
|
+
4. Option for websockets and paperclip?
|
120
|
+
5. Make the non defaults easier to user
|
121
|
+
6. Use Devise as the default user and admin user? This will make it easier for users to reset their password as this is already setup.
|
122
|
+
7. Git clone arcadex, type_validator and defcon to make it easier for users to customize?
|
123
|
+
8. Move the people engine into it's own gem?
|
124
|
+
9. Create a whenever task to destroy expired tokens.
|
125
|
+
10. Fix the breadcrumbs link in ActiveAdmin.
|
@@ -12,21 +12,22 @@ class Api::V1::ApiController < ::ActionController::API
|
|
12
12
|
nil
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
15
|
+
def cors_set_access_control_headers
|
16
|
+
response.headers['Access-Control-Allow-Origin'] = '*'
|
17
|
+
response.headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, PATCH, DELETE, OPTIONS'
|
18
|
+
response.headers['Access-Control-Allow-Headers'] = '*, Origin, Content-Type, Accept, Authorization, Token, Auth-Token, Email'
|
19
|
+
response.headers['Access-Control-Expose-Headers'] = '*'
|
20
|
+
response.headers['Access-Control-Max-Age'] = "1728000"
|
21
|
+
end
|
22
|
+
|
23
|
+
def cors_preflight_check
|
24
|
+
#if request.method == 'OPTIONS'
|
25
|
+
request.headers['Access-Control-Allow-Origin'] = '*'
|
26
|
+
request.headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, PATCH, DELETE, OPTIONS'
|
27
|
+
request.headers['Access-Control-Allow-Headers'] = '*, X-Requested-With, X-Prototype-Version, Token, Auth-Token, Email'
|
28
|
+
request.headers['Access-Control-Max-Age'] = '1728000'
|
29
|
+
render :text => '', :content_type => 'text/plain'
|
30
|
+
#end
|
31
|
+
end
|
31
32
|
|
32
33
|
end
|
@@ -41,7 +41,8 @@ class Api::V1::ApiController < ::ActionController::API
|
|
41
41
|
def cors_set_access_control_headers
|
42
42
|
response.headers['Access-Control-Allow-Origin'] = '*'
|
43
43
|
response.headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, PATCH, DELETE, OPTIONS'
|
44
|
-
response.headers['Access-Control-Allow-Headers'] = 'Origin, Content-Type, Accept, Authorization, Token, Auth-Token, Email'
|
44
|
+
response.headers['Access-Control-Allow-Headers'] = '*, Origin, Content-Type, Accept, Authorization, Token, Auth-Token, Email'
|
45
|
+
response.headers['Access-Control-Expose-Headers'] = '*'
|
45
46
|
response.headers['Access-Control-Max-Age'] = "1728000"
|
46
47
|
end
|
47
48
|
|
@@ -49,7 +50,7 @@ class Api::V1::ApiController < ::ActionController::API
|
|
49
50
|
#if request.method == 'OPTIONS'
|
50
51
|
request.headers['Access-Control-Allow-Origin'] = '*'
|
51
52
|
request.headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, PATCH, DELETE, OPTIONS'
|
52
|
-
request.headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Token, Auth-Token, Email'
|
53
|
+
request.headers['Access-Control-Allow-Headers'] = '*, X-Requested-With, X-Prototype-Version, Token, Auth-Token, Email'
|
53
54
|
request.headers['Access-Control-Max-Age'] = '1728000'
|
54
55
|
render :text => '', :content_type => 'text/plain'
|
55
56
|
#end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_voorhees
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cleophus Robinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|