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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e27eb1087cbf7f61da350a3c09dc2d1c235ed5b6ee6b096ae9ca3c3f25edb2e9
4
- data.tar.gz: 24af32669af502a68d4085e86be5705e8ff98f6899e50f6b01df1b3b884a2e56
3
+ metadata.gz: d35a5a4781f1983405b899ebeba4aecbf9d91728a9f82e7ac0a2b75b6c937181
4
+ data.tar.gz: 33c37300639794ce84a6afbf35d142afc572b1e17a67e60e1204c7b8d51b8b6a
5
5
  SHA512:
6
- metadata.gz: b4b6328db22729d14c8f4f456d8886dd2de5de9d75efd1fbb5f00124f1f067fe520ea5556d67ac32ffd36653598ee9895d029abfcd2ecc3a1ef22c8d8b618574
7
- data.tar.gz: 9c78e6148f87c00c682222bf1468a32b9e70aa05b7a1163f2aabc2b7d0c050d591a43a80ccf502e6f7c01b695859effc33879ca3ced8dd7f3912eed4a2f75c39
6
+ metadata.gz: 86c6188ed9f79fa7b5d8d0426e49453c864b9f4f1c8260f2e25291ad6266de37c869a22ec5298a9c57913f8d4a7141aac8c184cf6b2a1c5eed5ac040b895b608
7
+ data.tar.gz: 6361bff544285f8b60dfa099120b0e6b0ffea107dcf592c5ef151d337bd48458354ccfa52528d231cebd6a52211e4cdc0168135ff4e2d41819520e338367368e
@@ -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
  ###############
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "73.0.0".freeze
2
+ VERSION = "73.1.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.0.0
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-26 00:00:00.000000000 Z
11
+ date: 2021-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable