gds-api-adapters 73.0.0 → 73.1.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 +9 -0
- data/lib/gds_api/test_helpers/account_api.rb +20 -0
- 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: d35a5a4781f1983405b899ebeba4aecbf9d91728a9f82e7ac0a2b75b6c937181
|
4
|
+
data.tar.gz: 33c37300639794ce84a6afbf35d142afc572b1e17a67e60e1204c7b8d51b8b6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86c6188ed9f79fa7b5d8d0426e49453c864b9f4f1c8260f2e25291ad6266de37c869a22ec5298a9c57913f8d4a7141aac8c184cf6b2a1c5eed5ac040b895b608
|
7
|
+
data.tar.gz: 6361bff544285f8b60dfa099120b0e6b0ffea107dcf592c5ef151d337bd48458354ccfa52528d231cebd6a52211e4cdc0168135ff4e2d41819520e338367368e
|
data/lib/gds_api/account_api.rb
CHANGED
@@ -34,6 +34,15 @@ class GdsApi::AccountApi < GdsApi::Base
|
|
34
34
|
post_json("#{endpoint}/api/oauth2/callback", code: code, state: state)
|
35
35
|
end
|
36
36
|
|
37
|
+
# Get an OIDC end-session URL to redirect the user to
|
38
|
+
#
|
39
|
+
# @param [String, nil] govuk_account_session Value of the session header
|
40
|
+
#
|
41
|
+
# @return [Hash] An end-session URL
|
42
|
+
def get_end_session_url(govuk_account_session: nil)
|
43
|
+
get_json("#{endpoint}/api/oauth2/end-session", auth_headers(govuk_account_session))
|
44
|
+
end
|
45
|
+
|
37
46
|
# Get all the information about a user needed to render the account home page
|
38
47
|
#
|
39
48
|
# @param [String] govuk_account_session Value of the session header
|
@@ -46,6 +46,26 @@ module GdsApi
|
|
46
46
|
.to_return(status: 401)
|
47
47
|
end
|
48
48
|
|
49
|
+
#############################
|
50
|
+
# GET /api/oauth2/end-session
|
51
|
+
#############################
|
52
|
+
def stub_account_api_get_end_session_url(govuk_account_session: nil, end_session_uri: "http://auth/provider")
|
53
|
+
if govuk_account_session
|
54
|
+
stub_request(:get, "#{ACCOUNT_API_ENDPOINT}/api/oauth2/end-session")
|
55
|
+
.with(headers: { GdsApi::AccountApi::AUTH_HEADER_NAME => govuk_account_session })
|
56
|
+
.to_return(
|
57
|
+
status: 200,
|
58
|
+
body: { end_session_uri: end_session_uri }.to_json,
|
59
|
+
)
|
60
|
+
else
|
61
|
+
stub_request(:get, "#{ACCOUNT_API_ENDPOINT}/api/oauth2/end-session")
|
62
|
+
.to_return(
|
63
|
+
status: 200,
|
64
|
+
body: { end_session_uri: end_session_uri }.to_json,
|
65
|
+
)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
49
69
|
###############
|
50
70
|
# GET /api/user
|
51
71
|
###############
|
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: 73.
|
4
|
+
version: 73.1.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-08
|
11
|
+
date: 2021-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|