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 +4 -4
- data/lib/gds_api/account_api.rb +3 -3
- data/lib/gds_api/test_helpers/account_api.rb +6 -8
- data/lib/gds_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0fc1bf1088a309b3cea4d2db1528092df0b5c0e87014f268333076cb1536766
|
4
|
+
data.tar.gz: 92932cee9d379fa3dff38449a43544a3b0a38165e34c382a38b8494ec39876bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c812eed0e923623c4225ba3a88a414c2b08b012656fd43f9bcf35b928c1a76a5874c03cf0f5debc6b170d5fdd35db7ab653d549e67236a52a0effdad0e61e3c
|
7
|
+
data.tar.gz: ce7406f091e64ca710e505b00134397b3769e1a51c038d197d643c32307cf993646e01be1a8eb8f8b7f6a942fe490bda586ffc1aab0fcf2af6e958f7c46d429c
|
data/lib/gds_api/account_api.rb
CHANGED
@@ -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 [
|
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,
|
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
|
-
|
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,
|
23
|
-
querystring = Rack::Utils.build_nested_query({ redirect_path: redirect_path,
|
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",
|
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
|
-
|
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: [],
|
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,
|
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
|
data/lib/gds_api/version.rb
CHANGED
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:
|
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-
|
11
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|