et_fake_ccd 0.1.7 → 0.1.8

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: 8c1735b570fc200a1db52f8d4a8485d88eac75334299082a393c67a291b6c21f
4
- data.tar.gz: 2219ca1450bb35ecd8af4ac19d332ec74c269390a0664c38bbdb27dba5d3dd32
3
+ metadata.gz: 7682ef686f9e5a2a30a6ffac4a7a9f4e0d22d067b91bd741bfab37551e627e85
4
+ data.tar.gz: eac92c52598898d3757d2a9d267f8b9f4c7f6bd50aab311840f4eb2fbb8a7305
5
5
  SHA512:
6
- metadata.gz: 7aaa5bc3152d517b0e2f7b0dce4803a5a79a7348ee86537cac5cb1a414591a49c542d50b73344c0c0ddd2a7e696f503426124d7a3c283dcc8b1c90f7eae76a00
7
- data.tar.gz: d09f8a59189714facaab8e47983bd88d83ee14e73bbba40883fc05979f5790ef909fc7fe76430e7285ffb1744d4ef0dbcdc65de1ee9ee52eff852c9d9094701b
6
+ metadata.gz: 9d3d2169a3ecf70d4931cec05cb50e1d9c7769f46a1260e013b0e26b2d1ae56a9caf45104c1d896500a044666c3049cfcbc0a311264799efa92da830bb6fceff
7
+ data.tar.gz: dd7db76403c0e3e12b4500cb2656aae4723922a350bfbf23524b2f62042e5962ecfa8811eaea8b476432402c92234eb5c31f1aed097df4e6cf9933aa6da3e4ae
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- et_fake_ccd (0.1.7)
4
+ et_fake_ccd (0.1.8)
5
5
  activemodel (~> 5.2, >= 5.2.3)
6
6
  roda (~> 3.21)
7
7
  rotp (~> 5.1)
@@ -2,7 +2,6 @@ require "roda"
2
2
  require "et_fake_ccd/service/sidam_app"
3
3
  require "et_fake_ccd/service/auth_app"
4
4
  require "et_fake_ccd/service/data_store_app"
5
- require "et_fake_ccd/service/ui_app"
6
5
  require "et_fake_ccd/service/authentication_web_app"
7
6
  require "et_fake_ccd/service/case_management_web_app"
8
7
  require "et_fake_ccd/service/api_gateway_web_app"
@@ -12,7 +11,6 @@ module EtFakeCcd
12
11
  run "idam", Service::SidamApp
13
12
  run "auth", Service::AuthApp
14
13
  run "data_store", Service::DataStoreApp
15
- run "ui", Service::UiApp
16
14
  run "authentication-web", Service::AuthenticationWebApp
17
15
  run "case-management-web", Service::CaseManagementWebApp
18
16
  run "api-gateway", Service::ApiGatewayWebApp
@@ -27,6 +27,13 @@ module EtFakeCcd
27
27
  end
28
28
  end
29
29
  end
30
+ r.on "data" do
31
+ r.on "internal" do
32
+ r.is "profile" do
33
+ profile_response
34
+ end
35
+ end
36
+ end
30
37
  end
31
38
 
32
39
  private
@@ -63,6 +70,45 @@ module EtFakeCcd
63
70
  "security_classifications": {}
64
71
  }
65
72
  end
73
+
74
+ def profile_response
75
+ j = {
76
+ "user": {
77
+ "idam": {
78
+ "id": "22",
79
+ "email": "m@m.com",
80
+ "forename": "Buzz",
81
+ "surname": "Lightyear",
82
+ "roles": [
83
+ "caseworker",
84
+ "caseworker-employment-tribunal-manchester-caseofficer",
85
+ "caseworker-employment-tribunal-manchester-casesupervisor",
86
+ "caseworker-employment",
87
+ "caseworker-employment-tribunal-manchester",
88
+ "caseworker-employment-tribunal-glasgow-caseofficer",
89
+ "caseworker-employment-tribunal-glasgow-casesupervisor",
90
+ "caseworker-employment-tribunal-glasgow",
91
+ "caseworker",
92
+ "caseworker-loa1",
93
+ "caseworker-employment-tribunal-manchester-caseofficer-loa1",
94
+ "caseworker-employment-tribunal-manchester-casesupervisor-loa1",
95
+ "caseworker-employment-loa1",
96
+ "caseworker-employment-tribunal-manchester-loa1",
97
+ "caseworker-employment-tribunal-glasgow-caseofficer-loa1",
98
+ "caseworker-employment-tribunal-glasgow-casesupervisor-loa1",
99
+ "caseworker-employment-tribunal-glasgow-loa1",
100
+ "caseworker-loa1"
101
+ ],
102
+ "defaultService": "CCD"
103
+ }
104
+ },
105
+ "channels": nil,
106
+ "jurisdictions": [],
107
+ "default": {},
108
+ "_links": {}
109
+ }
110
+ JSON.generate j
111
+ end
66
112
  end
67
113
  end
68
114
  end
@@ -11,7 +11,8 @@ module EtFakeCcd
11
11
  route do |r|
12
12
  r.is "login" do
13
13
  r.get do
14
- render("login.html", locals: { oauth2_redirect_url: config.oauth2_redirect_url, oauth2_client_id: config.oauth2_client_id })
14
+ file = File.absolute_path(File.join('..', 'views', 'login.html.erb'), __dir__)
15
+ render(path: file, locals: { oauth2_redirect_url: config.oauth2_redirect_url, oauth2_client_id: config.oauth2_client_id })
15
16
  end
16
17
  r.post do
17
18
  r.redirect "/case-management-web/oauth2redirect?code=pfSHb6v4dEDEfqqP"
@@ -14,10 +14,35 @@ module EtFakeCcd
14
14
  ""
15
15
  end
16
16
  end
17
+ r.is "config" do
18
+ r.get do
19
+ config_result
20
+ end
21
+ end
17
22
  end
18
23
 
19
24
  private
20
25
 
26
+ def config_result
27
+ j = {
28
+ "login_url": url_for("/authentication-web/login"),
29
+ "logout_url": url_for("/api-gateway/logout"),
30
+ "api_url": url_for("/api-gateway/aggregated"),
31
+ "case_data_url": url_for("/api-gateway/data"),
32
+ "document_management_url": url_for("/api-gateway/documents"),
33
+ "pagination_page_size": 25,
34
+ "oauth2_token_endpoint_url": url_for("/api-gateway/oauth2"),
35
+ "oauth2_client_id": url_for("ccd_gateway")
36
+ }
37
+ JSON.generate(j)
38
+ end
39
+
40
+ def url_for(path)
41
+ uri = Addressable::URI.parse(request.url)
42
+ uri.path = path
43
+ uri.to_s
44
+ end
45
+
21
46
  def config
22
47
  EtFakeCcd.config
23
48
  end
@@ -1,3 +1,3 @@
1
1
  module EtFakeCcd
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: et_fake_ccd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor
@@ -171,10 +171,9 @@ files:
171
171
  - lib/et_fake_ccd/service/case_management_web_app.rb
172
172
  - lib/et_fake_ccd/service/data_store_app.rb
173
173
  - lib/et_fake_ccd/service/sidam_app.rb
174
- - lib/et_fake_ccd/service/ui_app.rb
175
174
  - lib/et_fake_ccd/validator/otp_validator.rb
176
175
  - lib/et_fake_ccd/version.rb
177
- - views/login.html.erb
176
+ - lib/et_fake_ccd/views/login.html.erb
178
177
  homepage: https://github.com/hmcts/et-fake-ccd
179
178
  licenses:
180
179
  - MIT
@@ -1,42 +0,0 @@
1
- require 'roda'
2
- require 'json'
3
- require 'et_fake_ccd/commands'
4
- require 'et_fake_ccd/auth_service'
5
- require 'addressable/uri'
6
- module EtFakeCcd
7
- module Service
8
- class UiApp < Roda
9
- plugin :request_headers
10
- plugin :halt
11
- route do |r|
12
- r.is "config" do
13
- r.get do
14
- config_result
15
- end
16
- end
17
- end
18
-
19
- private
20
-
21
- def config_result
22
- j = {
23
- "login_url": url_for("/authentication-web/login"),
24
- "logout_url": url_for("/api-gateway/logout"),
25
- "api_url": url_for("/api-gateway/aggregated"),
26
- "case_data_url": url_for("/api-gateway/data"),
27
- "document_management_url": url_for("/api-gateway/documents"),
28
- "pagination_page_size": 25,
29
- "oauth2_token_endpoint_url": url_for("/api-gateway/oauth2"),
30
- "oauth2_client_id": url_for("ccd_gateway")
31
- }
32
- JSON.generate(j)
33
- end
34
-
35
- def url_for(path)
36
- uri = Addressable::URI.parse(request.url)
37
- uri.path = path
38
- uri.to_s
39
- end
40
- end
41
- end
42
- end