ishapi 0.1.8.165 → 0.1.8.169

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc29c2289b2edffef2a6df490a32dabde652821f74d41fed1dba8d2bd38d2fa9
4
- data.tar.gz: 3ef7d4353ed450adc3fd8321969b590d63c8c08a178a7ceb470005a369152843
3
+ metadata.gz: '08c592821bf116f81b983afba7ed5986838709ff2328c22a32219efdc01c8c83'
4
+ data.tar.gz: 65b5532741934fa9abeddb5e7f226e7d38bcb2c66255812177574334275598cb
5
5
  SHA512:
6
- metadata.gz: '0688d657683b883b6d0ab146b4c40b8ae17c1eb952db2dc58df032d392d394fb82f639feadba5cef33ecd5ec8628132d15360d8c65ac36cdac65c736a95a043b'
7
- data.tar.gz: 3bf7b31ecf5de3f5058c7c07500055cc661d1015e138f8e2b218648e8d385d5431d7684e9b9cbae53dacc166f7afc2e7706668096273aee05955b757af9bbaef
6
+ metadata.gz: b0fe164c5c7c3662bd4f7df897e8b5b10b69441b727392543bc41b3d2d9ab2f6da444a538787d8726160bfe3e4014229cf3d1691b8b9136928dde4a0b2d94135
7
+ data.tar.gz: c965e844069b23c23eb4837175f6bdc9dbcac69d11e0a5b3f0c6cf3be98cc6158d45aed5342a085cdb2ec70ea7c7f36fc744daa79484025642c992b8b6616e33
@@ -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
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
@@ -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.unscoped.find_by slug: params[:slug]
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
@@ -5,7 +5,7 @@ module Ishapi
5
5
 
6
6
  skip_authorization_check only: %i| fb_sign_in login |
7
7
 
8
- before_action :check_profile, only: %i| account |
8
+ before_action :check_profile_hard, only: %i| account |
9
9
 
10
10
  def account
11
11
  @profile = current_user&.profile
@@ -16,10 +16,16 @@ 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
 
27
+ can [ :index ], IronWarbler::StockWatch # @TODO: scope this to profile!
28
+
23
29
  can [ :buy_stars ], ::Ish::UserProfile
24
30
 
25
31
  end
@@ -0,0 +1,11 @@
1
+
2
+ #
3
+ # ishapi / stock_watches / index
4
+ #
5
+
6
+ json.array! @stock_watches do |w|
7
+ json.i w
8
+ json.price w[:price]
9
+ json.ticker w[:ticker]
10
+ end
11
+
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
- get "/my/account", to: "users#account"
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 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
53
- post 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
54
- get 'sites/view/:domain/newsitems/:newsitems_page', :to => 'newsitems#index', :constraints => { :domain => /[^\/]+/ }
55
- get 'sites/view/:domain/reports', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
56
- get 'sites/view/:domain/reports/page/:reports_page', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
57
- get 'sites/view/:domain/tags', :to => 'tags#index', :constraints => { :domain => /[^\/]+/ }
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', :to => 'users#fb_sign_in'
65
- post 'users/profile', :to => 'users#show'
66
- post 'users/profile/update', :to => 'users#update'
67
- get 'users/profile', :to => 'users#show' # @TODO: only for testing! accessToken must be hidden
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', to: '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.165
4
+ version: 0.1.8.169
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-12 00:00:00.000000000 Z
11
+ date: 2022-02-16 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: '5.1'
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: '5.1'
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.5
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.5
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: jbuilder
224
+ name: httparty
169
225
  requirement: !ruby/object:Gem::Requirement
170
226
  requirements:
171
- - - "~>"
227
+ - - ">="
172
228
  - !ruby/object:Gem::Version
173
- version: '2.7'
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: '2.7'
236
+ version: '0'
181
237
  description: " Description of Ishapi."
182
238
  email:
183
239
  - piousbox@gmail.com
@@ -206,7 +262,6 @@ files:
206
262
  - app/controllers/ishapi/maps_controller.rb
207
263
  - app/controllers/ishapi/measurements_controller.rb
208
264
  - app/controllers/ishapi/my/galleries_controller.rb
209
- - app/controllers/ishapi/my/my_controller.rb-trash
210
265
  - app/controllers/ishapi/my/reports_controller.rb
211
266
  - app/controllers/ishapi/my/videos_controller.rb
212
267
  - app/controllers/ishapi/newsitems_controller.rb
@@ -216,6 +271,7 @@ files:
216
271
  - app/controllers/ishapi/products_controller.rb
217
272
  - app/controllers/ishapi/reports_controller.rb
218
273
  - app/controllers/ishapi/sites_controller.rb
274
+ - app/controllers/ishapi/stock_watches_controller.rb
219
275
  - app/controllers/ishapi/tags_controller.rb
220
276
  - app/controllers/ishapi/unrestricted_controller.rb
221
277
  - app/controllers/ishapi/user_profiles_controller.rb
@@ -263,6 +319,7 @@ files:
263
319
  - app/views/ishapi/reports/index.jbuilder
264
320
  - app/views/ishapi/reports/show.jbuilder
265
321
  - app/views/ishapi/sites/show.jbuilder
322
+ - app/views/ishapi/stock_watches/index.jbuilder
266
323
  - app/views/ishapi/tags/_index.jbuilder
267
324
  - app/views/ishapi/tags/_widget.jbuilder
268
325
  - app/views/ishapi/tags/index.jbuilder
@@ -303,7 +360,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
360
  - !ruby/object:Gem::Version
304
361
  version: '0'
305
362
  requirements: []
306
- rubygems_version: 3.2.25
363
+ rubygems_version: 3.1.6
307
364
  signing_key:
308
365
  specification_version: 4
309
366
  summary: Summary of Ishapi.
@@ -1,42 +0,0 @@
1
-
2
- module Ishapi
3
- module My
4
- class MyController < Ishapi::ApplicationController
5
-
6
- before_action :check_profile
7
-
8
- # @TODO: move to users_controller
9
- def account
10
- @profile = current_user&.profile
11
- authorize! :show, @profile
12
- render 'ishapi/users/account'
13
- rescue CanCan::AccessDenied
14
- render json: {
15
- status: :not_ok,
16
- }, status: 401
17
- end
18
-
19
- =begin
20
- private
21
-
22
- def do_login
23
- token = decode(params[:jwtToken])
24
- @current_user = User.find(token["user_id"])
25
- end
26
-
27
- def set_profile
28
- begin
29
- @graph = Koala::Facebook::API.new( params[:accessToken] )
30
- me = @graph.get_object( 'me', :fields => 'email' )
31
- @profile = IshModels::UserProfile.find_by :email => me['email']
32
- rescue Koala::Facebook::AuthenticationError => e
33
- render :json => { :status => :not_ok, :errors => "Probably expired token." }
34
- return
35
- end
36
- end
37
- =end
38
-
39
- end
40
- end
41
- end
42
-