gds-api-adapters 73.1.0 → 74.0.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
  SHA256:
3
- metadata.gz: d35a5a4781f1983405b899ebeba4aecbf9d91728a9f82e7ac0a2b75b6c937181
4
- data.tar.gz: 33c37300639794ce84a6afbf35d142afc572b1e17a67e60e1204c7b8d51b8b6a
3
+ metadata.gz: d0fc1bf1088a309b3cea4d2db1528092df0b5c0e87014f268333076cb1536766
4
+ data.tar.gz: 92932cee9d379fa3dff38449a43544a3b0a38165e34c382a38b8494ec39876bd
5
5
  SHA512:
6
- metadata.gz: 86c6188ed9f79fa7b5d8d0426e49453c864b9f4f1c8260f2e25291ad6266de37c869a22ec5298a9c57913f8d4a7141aac8c184cf6b2a1c5eed5ac040b895b608
7
- data.tar.gz: 6361bff544285f8b60dfa099120b0e6b0ffea107dcf592c5ef151d337bd48458354ccfa52528d231cebd6a52211e4cdc0168135ff4e2d41819520e338367368e
6
+ metadata.gz: 8c812eed0e923623c4225ba3a88a414c2b08b012656fd43f9bcf35b928c1a76a5874c03cf0f5debc6b170d5fdd35db7ab653d549e67236a52a0effdad0e61e3c
7
+ data.tar.gz: ce7406f091e64ca710e505b00134397b3769e1a51c038d197d643c32307cf993646e01be1a8eb8f8b7f6a942fe490bda586ffc1aab0fcf2af6e958f7c46d429c
@@ -11,14 +11,14 @@ class GdsApi::AccountApi < GdsApi::Base
11
11
  # Get an OAuth sign-in URL to redirect the user to
12
12
  #
13
13
  # @param [String, nil] redirect_path path on GOV.UK to send the user to after authentication
14
- # @param [String, nil] level_of_authentication either "level1" (require MFA) or "level0" (do not require MFA)
14
+ # @param [Boolean, nil] mfa whether to authenticate the user with MFA or not
15
15
  #
16
16
  # @return [Hash] An authentication URL and the OAuth state parameter (for CSRF protection)
17
- def get_sign_in_url(redirect_path: nil, level_of_authentication: nil)
17
+ def get_sign_in_url(redirect_path: nil, mfa: false)
18
18
  querystring = nested_query_string(
19
19
  {
20
20
  redirect_path: redirect_path,
21
- level_of_authentication: level_of_authentication,
21
+ mfa: mfa,
22
22
  }.compact,
23
23
  )
24
24
  get_json("#{endpoint}/api/oauth2/sign-in?#{querystring}")
@@ -19,8 +19,8 @@ module GdsApi
19
19
  #########################
20
20
  # GET /api/oauth2/sign-in
21
21
  #########################
22
- def stub_account_api_get_sign_in_url(redirect_path: nil, level_of_authentication: nil, auth_uri: "http://auth/provider", state: "state")
23
- querystring = Rack::Utils.build_nested_query({ redirect_path: redirect_path, level_of_authentication: level_of_authentication }.compact)
22
+ def stub_account_api_get_sign_in_url(redirect_path: nil, mfa: false, auth_uri: "http://auth/provider", state: "state")
23
+ querystring = Rack::Utils.build_nested_query({ redirect_path: redirect_path, mfa: mfa }.compact)
24
24
  stub_request(:get, "#{ACCOUNT_API_ENDPOINT}/api/oauth2/sign-in?#{querystring}")
25
25
  .to_return(
26
26
  status: 200,
@@ -69,13 +69,13 @@ module GdsApi
69
69
  ###############
70
70
  # GET /api/user
71
71
  ###############
72
- def stub_account_api_user_info(id: "user-id", level_of_authentication: "level0", email: "email@example.com", email_verified: true, has_unconfirmed_email: false, services: {}, **options)
72
+ def stub_account_api_user_info(id: "user-id", mfa: false, email: "email@example.com", email_verified: true, has_unconfirmed_email: false, services: {}, **options)
73
73
  stub_account_api_request(
74
74
  :get,
75
75
  "/api/user",
76
76
  response_body: {
77
77
  id: id,
78
- level_of_authentication: level_of_authentication,
78
+ mfa: mfa,
79
79
  email: email,
80
80
  email_verified: email_verified,
81
81
  has_unconfirmed_email: has_unconfirmed_email,
@@ -256,13 +256,12 @@ module GdsApi
256
256
  )
257
257
  end
258
258
 
259
- def stub_account_api_forbidden_has_attributes(attributes: [], needed_level_of_authentication: "level1", **options)
259
+ def stub_account_api_forbidden_has_attributes(attributes: [], **options)
260
260
  querystring = Rack::Utils.build_nested_query({ attributes: attributes }.compact)
261
261
  stub_account_api_request(
262
262
  :get,
263
263
  "/api/attributes?#{querystring}",
264
264
  response_status: 403,
265
- response_body: { needed_level_of_authentication: needed_level_of_authentication },
266
265
  **options,
267
266
  )
268
267
  end
@@ -289,13 +288,12 @@ module GdsApi
289
288
  )
290
289
  end
291
290
 
292
- def stub_account_api_forbidden_set_attributes(attributes: nil, needed_level_of_authentication: "level1", **options)
291
+ def stub_account_api_forbidden_set_attributes(attributes: nil, **options)
293
292
  stub_account_api_request(
294
293
  :patch,
295
294
  "/api/attributes",
296
295
  with: { body: hash_including({ attributes: attributes }.compact) },
297
296
  response_status: 403,
298
- response_body: { needed_level_of_authentication: needed_level_of_authentication },
299
297
  **options,
300
298
  )
301
299
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "73.1.0".freeze
2
+ VERSION = "74.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gds-api-adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 73.1.0
4
+ version: 74.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-08 00:00:00.000000000 Z
11
+ date: 2021-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable