radiant-booking_app-extension 0.1.1 → 0.2.0

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: a5331470a00155ab21fc6817ba578a494e0cb36f
4
- data.tar.gz: 19f019e66df0b6d0397595e5323499776c3af0b4
3
+ metadata.gz: 55efe97874af8834b63eab525715118924e4b38a
4
+ data.tar.gz: 5fe8d585ccc5957bf3320f616575f5994b22d758
5
5
  SHA512:
6
- metadata.gz: 5d4c07c1c8e0ff295489b126a4a343b205dbb5ef4cfde1869e8533ed7b7d611897033976584018ea1100936dbc5b3d55225624af865e6645ca6f763f2d4fd8cb
7
- data.tar.gz: 6e0006146463aa1350b3bcf387f4d5599a6d9420715e6a7c7b32efbc939a33048a7d6b5ee773c54518215dec580f4ab67429f050136f9fe63adc637d4b9a0269
6
+ metadata.gz: b67c9e3fc95998ae632a9f73656aa86eeeecd742ca3ba1330b01031304ba5cf28e2931c31abac32a0f56d77189106dd267af8d08078571e108ed7689e451c727
7
+ data.tar.gz: 24ef32b55f26641660db56e29260d73572d4618567bd64b4f0c4c045a021ed083e37211f12d241e991fa9a9d579460262261b4a90e730d25d05fc8d0808238c9
@@ -0,0 +1,17 @@
1
+ +# Change Log
2
+ +All notable changes to this project will be documented in this file.
3
+ +This project adheres to [Semantic Versioning](http://semver.org/).
4
+ +This changelog adheres to [Keep a
5
+ CHANGELOG](http://keepachangelog.com/).
6
+
7
+ ## Unreleased
8
+ ### Changed
9
+ - [TT-1567] Hack for exclusive products fixed by storing additional details
10
+ (Requires CMS to use ajax login)
11
+
12
+ ### Removed
13
+ - [TT-938] Remove deprecated secure-pay url
14
+
15
+ ### Updated
16
+ - [TT-1377] Maintain the files original status code when proxying
17
+ - [TT-1340] Proxy more content-types as file
@@ -17,6 +17,9 @@ class PageMountController < SiteController
17
17
  # ... or determine if having blank cookies means "don't set anything buddy"
18
18
  session[:proxied_cookies] = response.cookies unless response.cookies.blank?
19
19
 
20
+ # Must be done before redirect (for logout)
21
+ store_client_type_id_in_cms_session(response, request)
22
+
20
23
  if response.redirect?
21
24
  redirect_to response.redirect_location
22
25
  return
@@ -36,11 +39,10 @@ class PageMountController < SiteController
36
39
  send_file(proxy_response)
37
40
  else
38
41
  @title = proxy_response.headers[:x_title]
39
- store_client_type_id_in_cms_session(proxy_response) if login_details_request?(request)
40
42
  render text: proxy_response.body,
41
43
  content_type: proxy_response.content_type,
42
44
  status: proxy_response.code,
43
- layout: true
45
+ layout: (request.path != '/app_cells')
44
46
  end
45
47
  end
46
48
 
@@ -50,13 +52,19 @@ class PageMountController < SiteController
50
52
 
51
53
  private
52
54
 
53
- def store_client_type_id_in_cms_session(proxy_response)
55
+ def store_client_type_id_in_cms_session(response, request)
54
56
  # Special Hack so CC can show exclusive products for clients
55
- session[:client_type_id] = JSON.parse(proxy_response.body)['client_type_id']
56
- end
57
-
58
- def login_details_request?(request)
59
- request.path == '/parties/login_header_details'
57
+ case request.path
58
+ when '/parties/login.json'
59
+ json = JSON.parse(response.body)
60
+ session[:client_id] = json['client_id']
61
+ session[:client_type_id] = json['client_type_id']
62
+ session[:client_type_is_agent] = json['client_type_is_agent']
63
+ when '/parties/logout'
64
+ session[:client_id] = nil
65
+ session[:client_type_id] = nil
66
+ session[:client_type_is_agent] = nil
67
+ end
60
68
  end
61
69
 
62
70
  def http_proxy(url)
@@ -95,6 +103,7 @@ class PageMountController < SiteController
95
103
 
96
104
  def send_file(proxy_response)
97
105
  send_data proxy_response.body,
106
+ status: proxy_response.code,
98
107
  type: proxy_response.content_type,
99
108
  disposition: proxy_response.content_disposition
100
109
  end
@@ -127,7 +136,7 @@ class PageMountController < SiteController
127
136
  headers[:content_disposition] || DEFAULT_CONTENT_DISPOSITION
128
137
  end
129
138
 
130
- delegate :body, :content_type, :code, to: :response
139
+ delegate :body, :code, to: :response
131
140
 
132
141
  def headers
133
142
  @response.body.headers
@@ -20,7 +20,6 @@ ActionController::Routing::Routes.draw do |map|
20
20
 
21
21
  page_mount.connect 'cart/*paths'
22
22
 
23
- page_mount.connect 'secure-pay'
24
23
  page_mount.connect 'secure-payment'
25
24
  page_mount.connect 'cart_activations/*paths'
26
25
  page_mount.connect 'bookings/manage/*paths'
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "radiant-booking_app-extension"
3
- spec.version = '0.1.1'
3
+ spec.version = '0.2.0'
4
4
  spec.authors = ["Michael Noack"]
5
5
  spec.email = ["support@travellink.com.au"]
6
6
  spec.description = %q{Integrate booking app with radiant}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-booking_app-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Noack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-23 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: radius
@@ -73,6 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - CHANGELOG.md
76
77
  - Rakefile
77
78
  - app/controllers/page_mount_controller.rb
78
79
  - app/views/page_mount/proxy.erb