ishapi 0.1.8.167 → 0.1.8.171
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 +4 -4
- data/app/controllers/ishapi/application_controller.rb +18 -1
- data/app/controllers/ishapi/cities_controller.rb +2 -2
- data/app/controllers/ishapi/maps_controller.rb +3 -10
- data/app/controllers/ishapi/payments_controller.rb +2 -0
- data/app/controllers/ishapi/stock_watches_controller.rb +13 -0
- data/app/controllers/ishapi/{unrestricted_controller.rb → unrestricted_controller.rb-trash} +0 -0
- data/app/controllers/ishapi/users_controller.rb +2 -10
- data/app/helpers/ishapi/application_helper.rb +5 -0
- data/app/models/ishapi/ability.rb +4 -0
- data/app/views/ishapi/maps/show.jbuilder +2 -2
- data/app/views/ishapi/markers/_index.jbuilder +4 -2
- data/app/views/ishapi/newsitems/_index.jbuilder +0 -2
- data/app/views/ishapi/stock_watches/index.jbuilder +11 -0
- data/app/views/ishapi/users/_account.jbuilder +1 -2
- data/app/views/ishapi/users/login.jbuilder +2 -2
- data/config/routes.rb +19 -13
- metadata +70 -13
- data/app/helpers/ishapi/articles_helper.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1061557c4a428d72d380f5eaa54ece94dfb5c6c5493707d23297007af653b929
|
4
|
+
data.tar.gz: 310cf825c56d201501a57e592ef31a0ae8b282811c1d43d6cb91399f80d4deb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 238eaa5df713a592f8f88456771188a357b0ae4d1d5c463ad390e339573b3ce04749ac3c16779588b5be4374ff7798ee5a44155d932d1281f954ca6ab70f0f1f
|
7
|
+
data.tar.gz: d9208f4b3fb2075bcb418badad07d7466818eed030381b13aba91474dc24db48d87fc8819ecf934b9ae9e7c296a289cec02b57b133753c51589548f076a3938e
|
@@ -1,6 +1,10 @@
|
|
1
1
|
|
2
2
|
class Ishapi::ApplicationController < ActionController::Base
|
3
3
|
|
4
|
+
def home
|
5
|
+
render json: { status: :ok }, status: :ok
|
6
|
+
end
|
7
|
+
|
4
8
|
## POST /api/users/long_term_token , a FB login flow
|
5
9
|
def long_term_token
|
6
10
|
accessToken = request.headers[:accessToken]
|
@@ -30,12 +34,25 @@ class Ishapi::ApplicationController < ActionController::Base
|
|
30
34
|
|
31
35
|
private
|
32
36
|
|
37
|
+
## This returns an empty user if not logged in!
|
33
38
|
def check_profile
|
34
39
|
begin
|
35
40
|
decoded = decode(params[:jwt_token])
|
36
41
|
@current_user = User.find decoded['user_id']
|
37
42
|
rescue JWT::ExpiredSignature, JWT::DecodeError => e
|
38
|
-
flash[:notice] = 'You are not logged in, or you have been logged out.'
|
43
|
+
# flash[:notice] = 'You are not logged in, or you have been logged out.'
|
44
|
+
# puts! 'You are not logged in, or you have been logged out.'
|
45
|
+
@current_user = User.new({ profile: Ish::UserProfile.new })
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
## This errors out if not logged in!
|
50
|
+
def check_profile_hard
|
51
|
+
begin
|
52
|
+
decoded = decode(params[:jwt_token])
|
53
|
+
@current_user = User.find decoded['user_id']
|
54
|
+
rescue JWT::ExpiredSignature, JWT::DecodeError => e
|
55
|
+
# flash[:notice] = 'You are not logged in, or you have been logged out.'
|
39
56
|
# puts! 'You are not logged in, or you have been logged out.'
|
40
57
|
end
|
41
58
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require_dependency "ishapi/application_controller"
|
2
2
|
|
3
3
|
module Ishapi
|
4
|
-
class CitiesController <
|
4
|
+
class CitiesController < Ishapi::ApplicationController
|
5
5
|
protect_from_forgery :prepend => true, :with => :exception
|
6
6
|
layout :false
|
7
|
-
|
7
|
+
|
8
8
|
check_authorization
|
9
9
|
skip_before_action :verify_authenticity_token
|
10
10
|
before_action :set_current_ability
|
@@ -5,20 +5,13 @@ class Ishapi::MapsController < Ishapi::ApplicationController
|
|
5
5
|
before_action :check_profile, only: [ :show ]
|
6
6
|
|
7
7
|
def show
|
8
|
-
@location = ::Gameui::Map.
|
8
|
+
@location = ::Gameui::Map.find_by slug: params[:slug]
|
9
9
|
@map = @location.map || @location
|
10
|
+
|
10
11
|
authorize! :show, @map
|
11
12
|
@newsitems = @location.newsitems
|
12
13
|
|
13
|
-
|
14
|
-
## @TODO: absolutely change this!
|
15
|
-
##
|
16
|
-
|
17
|
-
@markers = @map.markers.where( is_active: true )
|
18
|
-
if @current_user
|
19
|
-
a = @current_user.profile.shared_markers.unscoped.where( is_active: true, map_id: @map.id ).to_a
|
20
|
-
@markers = @markers + a
|
21
|
-
end
|
14
|
+
@markers = @map.markers.permitted_to(current_user.profile)
|
22
15
|
|
23
16
|
# case @map.ordering_type
|
24
17
|
# when ::Gameui::Map::ORDERING_TYPE_ALPHABETIC
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require_dependency "ishapi/application_controller"
|
2
|
+
module Ishapi
|
3
|
+
class StockWatchesController < ApplicationController
|
4
|
+
|
5
|
+
before_action :check_jwt
|
6
|
+
|
7
|
+
def index
|
8
|
+
authorize! :index, IronWarbler::StockWatch
|
9
|
+
@stock_watches = IronWarbler::StockWatch.active # @TODO: restrict by-profile, no?
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
File without changes
|
@@ -5,7 +5,7 @@ module Ishapi
|
|
5
5
|
|
6
6
|
skip_authorization_check only: %i| fb_sign_in login |
|
7
7
|
|
8
|
-
before_action :
|
8
|
+
before_action :check_profile_hard, only: %i| account |
|
9
9
|
|
10
10
|
def account
|
11
11
|
@profile = current_user&.profile
|
@@ -25,6 +25,7 @@ module Ishapi
|
|
25
25
|
|
26
26
|
def login
|
27
27
|
@current_user = User.where( email: params[:email] ).first
|
28
|
+
|
28
29
|
if !@current_user
|
29
30
|
render json: { status: :not_ok }, status: 401
|
30
31
|
return
|
@@ -35,15 +36,6 @@ module Ishapi
|
|
35
36
|
# send the jwt to client
|
36
37
|
@jwt_token = encode(user_id: @current_user.id.to_s)
|
37
38
|
@profile = @current_user.profile
|
38
|
-
|
39
|
-
=begin
|
40
|
-
render json: {
|
41
|
-
email: @current_user.email,
|
42
|
-
jwt_token: @jwt_token,
|
43
|
-
n_unlocks: @current_user.profile.n_unlocks,
|
44
|
-
}
|
45
|
-
=end
|
46
|
-
|
47
39
|
end
|
48
40
|
end
|
49
41
|
|
@@ -16,7 +16,11 @@ class Ishapi::Ability
|
|
16
16
|
can [ :show ], Gallery do |gallery|
|
17
17
|
gallery.user_profile == user.profile
|
18
18
|
end
|
19
|
+
|
19
20
|
can [ :do_purchase ], ::Gameui
|
21
|
+
can [ :show ], ::Gameui::Map do |map|
|
22
|
+
map.creator_profile == user.profile
|
23
|
+
end
|
20
24
|
|
21
25
|
can [ :create, :unlock ], ::Ish::Payment
|
22
26
|
|
@@ -15,7 +15,7 @@ json.cache! this_key do
|
|
15
15
|
json.description @map.description
|
16
16
|
json.w @map.w
|
17
17
|
json.h @map.h
|
18
|
-
json.img_path @map.image.image.url(:original)
|
18
|
+
json.img_path @map.image ? @map.image.image.url(:original) : image_missing
|
19
19
|
json.updated_at @map.updated_at
|
20
20
|
json.rated @map.rated
|
21
21
|
|
@@ -32,7 +32,7 @@ json.cache! this_key do
|
|
32
32
|
json.partial! 'ishapi/markers/index', markers: @markers
|
33
33
|
else
|
34
34
|
## I removed json parsing from here! _vp_ 2021-10-14
|
35
|
-
## I added json parsing here
|
35
|
+
## I added json parsing here, and is seems right. _vp_ 2021-10-19
|
36
36
|
json.config JSON.parse @map.config
|
37
37
|
json.labels JSON.parse @map.labels
|
38
38
|
json.partial! 'ishapi/markers/index', markers: @markers
|
@@ -12,9 +12,11 @@ json.markers do
|
|
12
12
|
json.h marker.h
|
13
13
|
json.centerOffsetX marker.centerOffsetX
|
14
14
|
json.centerOffsetY marker.centerOffsetY
|
15
|
-
json.img_path marker.image.image.url(:original)
|
16
|
-
json.title_img_path marker.title_image.image.url(:thumb)
|
15
|
+
json.img_path marker.image ? marker.image.image.url(:original) : image_missing
|
16
|
+
json.title_img_path marker.title_image ? marker.title_image.image.url(:thumb) : image_missing
|
17
17
|
json.item_type marker.item_type
|
18
18
|
json.url marker.url
|
19
|
+
json.premium_tier marker.destination.premium_tier
|
20
|
+
json.id marker.destination.id.to_s
|
19
21
|
end
|
20
22
|
end
|
data/config/routes.rb
CHANGED
@@ -8,12 +8,15 @@ Ishapi::Engine.routes.draw do
|
|
8
8
|
get 'cities/view/:cityname', :to => 'cities#show'
|
9
9
|
get 'cities/features', :to => 'cities#features'
|
10
10
|
|
11
|
+
## @TODO: remove all co-tailors stuff
|
12
|
+
=begin
|
11
13
|
post 'co_tailors/orders', :to => 'orders#create'
|
12
14
|
post 'co_tailors/order_items', :to => 'order_items#create'
|
13
15
|
post 'co_tailors/measurements', :to => 'measurements#update'
|
14
16
|
get 'co_tailors/products/by-kind/:kind', :to => 'products#show'
|
15
17
|
namespace :co_tailors do
|
16
18
|
end
|
19
|
+
=end
|
17
20
|
|
18
21
|
get 'events/view/:eventname', :to => 'events#show'
|
19
22
|
|
@@ -27,8 +30,7 @@ Ishapi::Engine.routes.draw do
|
|
27
30
|
get 'maps', to: 'maps#index'
|
28
31
|
get 'maps/view/:slug', to: 'maps#show'
|
29
32
|
get 'markers/view/:slug', to: 'maps#show_marker'
|
30
|
-
|
31
|
-
post "/my/account", to: "users#account"
|
33
|
+
match "/my/account", to: "users#account", via: [ :get, :post ]
|
32
34
|
namespace :my do
|
33
35
|
get 'galleries', to: 'galleries#index'
|
34
36
|
get 'newsitems', to: 'newsitems#index'
|
@@ -49,24 +51,28 @@ Ishapi::Engine.routes.draw do
|
|
49
51
|
get 'reports', :to => 'reports#index'
|
50
52
|
get 'reports/view/:slug', :to => 'reports#show'
|
51
53
|
|
52
|
-
get
|
53
|
-
post 'sites/view/:domain',
|
54
|
-
get
|
55
|
-
get
|
56
|
-
get
|
57
|
-
get
|
54
|
+
get 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
|
55
|
+
post 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
|
56
|
+
get 'sites/view/:domain/newsitems/:newsitems_page', :to => 'newsitems#index', :constraints => { :domain => /[^\/]+/ }
|
57
|
+
get 'sites/view/:domain/reports', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
|
58
|
+
get 'sites/view/:domain/reports/page/:reports_page', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
|
59
|
+
get 'sites/view/:domain/tags', :to => 'tags#index', :constraints => { :domain => /[^\/]+/ }
|
58
60
|
|
59
61
|
post 'stars/buy', to: 'gameui#buy_stars'
|
60
62
|
|
63
|
+
## 2022-02-12 moved to iron_warbler gem _vp_
|
64
|
+
# resources "stock_watches"
|
65
|
+
|
61
66
|
get 'tags/view/:slug', :to => 'tags#show'
|
62
67
|
get 'test', to: 'application#test'
|
63
68
|
|
64
|
-
post 'users/fb_sign_in',
|
65
|
-
|
66
|
-
post 'users/profile
|
67
|
-
|
69
|
+
post 'users/fb_sign_in', to: 'users#fb_sign_in'
|
70
|
+
get 'users/me', to: 'users#account'
|
71
|
+
post 'users/profile', to: 'users#show'
|
72
|
+
post 'users/profile/update', to: 'users#update'
|
73
|
+
get 'users/profile', to: 'users#show' # @TODO: only for testing! accessToken must be hidden
|
68
74
|
match 'users/long_term_token', to: 'application#long_term_token', via: [ :get, :post ]
|
69
|
-
post 'users/login',
|
75
|
+
post 'users/login', to: 'users#login'
|
70
76
|
|
71
77
|
get 'venues', :to => 'venues#index'
|
72
78
|
get 'venues/view/:venuename', :to => 'venues#show'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ishapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.171
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,28 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 6.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 6.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mongoid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 7.0
|
33
|
+
version: 7.3.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 7.0
|
40
|
+
version: 7.3.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: mongoid-paperclip
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mongoid_paranoia
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: cancancan
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +178,34 @@ dependencies:
|
|
150
178
|
- - "~>"
|
151
179
|
- !ruby/object:Gem::Version
|
152
180
|
version: '0.5'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: jbuilder
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '2.7'
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '2.7'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: aws-sdk
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
type: :runtime
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '0'
|
153
209
|
- !ruby/object:Gem::Dependency
|
154
210
|
name: stripe
|
155
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,19 +221,19 @@ dependencies:
|
|
165
221
|
- !ruby/object:Gem::Version
|
166
222
|
version: '0'
|
167
223
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
224
|
+
name: httparty
|
169
225
|
requirement: !ruby/object:Gem::Requirement
|
170
226
|
requirements:
|
171
|
-
- - "
|
227
|
+
- - ">="
|
172
228
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
229
|
+
version: '0'
|
174
230
|
type: :runtime
|
175
231
|
prerelease: false
|
176
232
|
version_requirements: !ruby/object:Gem::Requirement
|
177
233
|
requirements:
|
178
|
-
- - "
|
234
|
+
- - ">="
|
179
235
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
236
|
+
version: '0'
|
181
237
|
description: " Description of Ishapi."
|
182
238
|
email:
|
183
239
|
- piousbox@gmail.com
|
@@ -215,14 +271,14 @@ files:
|
|
215
271
|
- app/controllers/ishapi/products_controller.rb
|
216
272
|
- app/controllers/ishapi/reports_controller.rb
|
217
273
|
- app/controllers/ishapi/sites_controller.rb
|
274
|
+
- app/controllers/ishapi/stock_watches_controller.rb
|
218
275
|
- app/controllers/ishapi/tags_controller.rb
|
219
|
-
- app/controllers/ishapi/unrestricted_controller.rb
|
276
|
+
- app/controllers/ishapi/unrestricted_controller.rb-trash
|
220
277
|
- app/controllers/ishapi/user_profiles_controller.rb
|
221
278
|
- app/controllers/ishapi/users_controller.rb
|
222
279
|
- app/controllers/ishapi/venues_controller.rb
|
223
280
|
- app/controllers/ishapi/videos_controller.rb
|
224
281
|
- app/helpers/ishapi/application_helper.rb
|
225
|
-
- app/helpers/ishapi/articles_helper.rb
|
226
282
|
- app/jobs/ishapi/application_job.rb
|
227
283
|
- app/mailers/ishapi/application_mailer.rb
|
228
284
|
- app/models/ishapi/ability.rb
|
@@ -262,6 +318,7 @@ files:
|
|
262
318
|
- app/views/ishapi/reports/index.jbuilder
|
263
319
|
- app/views/ishapi/reports/show.jbuilder
|
264
320
|
- app/views/ishapi/sites/show.jbuilder
|
321
|
+
- app/views/ishapi/stock_watches/index.jbuilder
|
265
322
|
- app/views/ishapi/tags/_index.jbuilder
|
266
323
|
- app/views/ishapi/tags/_widget.jbuilder
|
267
324
|
- app/views/ishapi/tags/index.jbuilder
|