et_fake_ccd 0.1.6 → 0.1.7

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: b861b770b5cfe8445b20fe64ec186896176d0e2f9c182c48959984333b3d663c
4
- data.tar.gz: 6fbd42a4e759cda1252abb01934cbcc77997babcb586384fa6912e9402218c2d
3
+ metadata.gz: 8c1735b570fc200a1db52f8d4a8485d88eac75334299082a393c67a291b6c21f
4
+ data.tar.gz: 2219ca1450bb35ecd8af4ac19d332ec74c269390a0664c38bbdb27dba5d3dd32
5
5
  SHA512:
6
- metadata.gz: b06ecc8a9d4eb937c6e3db398fe5ddf45d73eea3ca868158c821d711cc1f9d16e1d06b4c462a4511af769f73b0845ad3c47b03eb094358ce4d34172f16b18577
7
- data.tar.gz: aa41901dd32dc346c8c3c49baffc39cf7965048b1326c3d87f42e21d6bd945a8ad7b655b9e531262c7982132b665b1bb4a73530330357d24b1edd026e08d4950
6
+ metadata.gz: 7aaa5bc3152d517b0e2f7b0dce4803a5a79a7348ee86537cac5cb1a414591a49c542d50b73344c0c0ddd2a7e696f503426124d7a3c283dcc8b1c90f7eae76a00
7
+ data.tar.gz: d09f8a59189714facaab8e47983bd88d83ee14e73bbba40883fc05979f5790ef909fc7fe76430e7285ffb1744d4ef0dbcdc65de1ee9ee52eff852c9d9094701b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- et_fake_ccd (0.1.6)
4
+ et_fake_ccd (0.1.7)
5
5
  activemodel (~> 5.2, >= 5.2.3)
6
6
  roda (~> 3.21)
7
7
  rotp (~> 5.1)
@@ -17,7 +17,7 @@ module EtFakeCcd
17
17
  end
18
18
  end
19
19
  r.on "aggregated" do
20
- r.is "caseworkers", Integer, "jurisdictions", String, "case-types", String, "cases" do |uid, jid, ctid|
20
+ r.is "caseworkers", String, "jurisdictions", String, "case-types", String, "cases" do |uid, jid, ctid|
21
21
  r.get do
22
22
  filters = r.params.dup
23
23
  page = (filters.delete('page') || "1").to_i
@@ -9,7 +9,7 @@ module EtFakeCcd
9
9
  plugin :request_headers
10
10
  plugin :halt
11
11
  route do |r|
12
- r.is "caseworkers", Integer, "jurisdictions", String, "case-types", String, "event-triggers", "initiateCase", "token" do |uid, jid, ctid|
12
+ r.is "caseworkers", String, "jurisdictions", String, "case-types", String, "event-triggers", "initiateCase", "token" do |uid, jid, ctid|
13
13
  r.get do
14
14
  if EtFakeCcd::AuthService.validate_service_token(r.headers['ServiceAuthorization'].gsub(/\ABearer /, '')) && EtFakeCcd::AuthService.validate_user_token(r.headers['Authorization'].gsub(/\ABearer /, ''))
15
15
  initiate_case(uid, jid, ctid)
@@ -18,7 +18,7 @@ module EtFakeCcd
18
18
  end
19
19
  end
20
20
  end
21
- r.is "caseworkers", Integer, "jurisdictions", String, "case-types", String, "cases" do |uid, jid, ctid|
21
+ r.is "caseworkers", String, "jurisdictions", String, "case-types", String, "cases" do |uid, jid, ctid|
22
22
  r.post do
23
23
  if !EtFakeCcd::AuthService.validate_service_token(r.headers['ServiceAuthorization'].gsub(/\ABearer /, '')) || !EtFakeCcd::AuthService.validate_user_token(r.headers['Authorization'].gsub(/\ABearer /, ''))
24
24
  r.halt 403, forbidden_error_for(r)
@@ -18,6 +18,11 @@ module EtFakeCcd
18
18
  end
19
19
  end
20
20
  end
21
+ r.is "details" do
22
+ r.get do
23
+ details_result
24
+ end
25
+ end
21
26
  end
22
27
 
23
28
  private
@@ -34,6 +39,29 @@ module EtFakeCcd
34
39
  JSON.generate(j)
35
40
  end
36
41
 
42
+ def details_result
43
+ j = {
44
+ "id": "650692bb-cefe-466a-ba8d-687377173064",
45
+ "forename": "Fred",
46
+ "surname": "Bloggs",
47
+ "email": "fred.bloggs@gmail.com",
48
+ "active": true,
49
+ "roles": [
50
+ "caseworker-publiclaw-localAuthority",
51
+ "caseworker-publiclaw",
52
+ "caseworker",
53
+ "caseworker-employment-tribunal-manchester",
54
+ "caseworker-employment-tribunal-manchester-caseofficer",
55
+ "caseworker-employment-tribunal-manchester-casesupervisor",
56
+ "caseworker-employment-tribunal-glasgow",
57
+ "caseworker-employment",
58
+ "caseworker-employment-tribunal-glasgow-casesupervisor",
59
+ "caseworker-employment-tribunal-glasgow-caseofficer"
60
+ ]
61
+ }
62
+ JSON.generate j
63
+ end
64
+
37
65
  def render_error_for(command)
38
66
  "Its broke"
39
67
  end
@@ -21,12 +21,12 @@ module EtFakeCcd
21
21
  def config_result
22
22
  j = {
23
23
  "login_url": url_for("/authentication-web/login"),
24
- "logout_url": url_for("http://localhost:8080/api-gateway/logout"),
25
- "api_url": url_for("http://localhost:8080/api-gateway/aggregated"),
26
- "case_data_url": url_for("http://localhost:8080/api-gateway/data"),
27
- "document_management_url": url_for("http://localhost:8080/api-gateway/documents"),
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
28
  "pagination_page_size": 25,
29
- "oauth2_token_endpoint_url": url_for("http://localhost:8080/api-gateway/oauth2"),
29
+ "oauth2_token_endpoint_url": url_for("/api-gateway/oauth2"),
30
30
  "oauth2_client_id": url_for("ccd_gateway")
31
31
  }
32
32
  JSON.generate(j)
@@ -1,3 +1,3 @@
1
1
  module EtFakeCcd
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: et_fake_ccd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-03 00:00:00.000000000 Z
11
+ date: 2019-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roda