conversant 1.0.17 → 1.0.18

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: 964bc9a41a8eaf896bf334a98a80c10abd83ca529fe080c335f293d5ebe94ccc
4
- data.tar.gz: 5b073e3f44dd178f7ac95eca6f0cce42fe6b38e837e32058774c192d561b7374
3
+ metadata.gz: b40e1ec2641cec2c860a7de9bb7a5bb9ff8a85bde847cf9520139f288c9883c3
4
+ data.tar.gz: 9c15c4e3153aad9d60782fe748e3e4324ba573307b6ba91f357be9d78cfab3d1
5
5
  SHA512:
6
- metadata.gz: c46571c45a041450c1f6e002086eead91811b580f9914ad47d81fc9e39fcb8283152090625b5d0c63f1cc96ffa8b85f51ab3b72385ec99052dcd645e9bc30f6f
7
- data.tar.gz: 25d9221a514ba50bdfe29c6abf456b146837adf8d9eb4bc7e1641cc8d90f27db0e276c499b6ecb7fcb6f2220c6c4f785619cc73d7b430b272760e42ead137510
6
+ metadata.gz: ea35d31fc8722f9955e620fb285fe8376fa57a72d18da0a1de12f44de82cff8ad71f76a0c0ce30b50a63faab4cccccdf095867df19ecf4f841762d7f64da07bc
7
+ data.tar.gz: 04f3fed5093b6388c9e66b7991542fe459cbd2b59dec0d50ad21b7de5e358f7f25445cd9617c748236d1b2ced8cc71aea03a7083b05ea4fccf4a75bf6cc87223
data/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.18] - 2025-10-08
9
+
10
+ ### Fixed
11
+ - **Portal Service Authentication**: Fixed SESSION cookie handling to use root sessions directly
12
+ - Portal service now uses root SESSION + SSO_GW_SESSION2 cookies directly instead of attempting to exchange them
13
+ - Removed incorrect cookie extraction from response (Portal doesn't return a new SESSION cookie)
14
+ - Changed from extracting `response.cookies['SESSION']` to using `sessions[:session]` from SSO login
15
+ - Resolves "NO_SESSION_IN_RESPONSE" error when calling `portal.appliances`
16
+ - Matches original implementation behavior where root sessions are used for all Portal API calls
17
+
18
+ ### Changed
19
+ - Updated `Portal#fetch_new_session` method to return root SESSION cookie directly after verification
20
+ - Test call to `#{portal_endpoint}/?cId=#{customer_id}` now only validates session instead of extracting cookies
21
+ - Log message changed from "REQUESTING_SESSION" to "USING_ROOT_SESSIONS" for clarity
22
+
23
+ ### Impact
24
+ - Portal service now works correctly without "Missing SESSION for Portal" errors
25
+ - `portal.appliances` and other Portal API methods now authenticate properly
26
+ - Consistent with other services (CDN, LMS, VMS) that also exchange sessions but Portal uses root sessions directly
27
+
8
28
  ## [1.0.17] - 2025-10-01
9
29
 
10
30
  ### Fixed
@@ -146,17 +146,18 @@ module Conversant
146
146
  # Fetches a new SESSION cookie for Portal API access
147
147
  #
148
148
  # Authenticates with root portal sessions (SESSION + SSO_GW_SESSION2) and
149
- # exchanges them for a customer-specific SESSION cookie. The new session
150
- # is cached in Redis with the configured TTL.
149
+ # uses them directly for Portal API calls. Makes a test call to verify
150
+ # the sessions are valid.
151
151
  #
152
152
  # @return [String, nil] The SESSION cookie value, or nil if authentication fails
153
153
  def fetch_new_session
154
154
  sessions = authenticate
155
155
  return nil unless sessions && sessions[:session] && sessions[:sso_gw_session2]
156
156
 
157
- logger.debug "#{identifier}.METHOD:authorize.REQUESTING_SESSION"
157
+ logger.debug "#{identifier}.METHOD:authorize.USING_ROOT_SESSIONS"
158
158
 
159
- response = RestClient.get(
159
+ # Make a test call to verify sessions are valid
160
+ RestClient.get(
160
161
  "#{portal_endpoint}/?cId=#{customer_id}",
161
162
  {
162
163
  authority: URI.parse(portal_endpoint).hostname,
@@ -171,15 +172,11 @@ module Conversant
171
172
  }
172
173
  )
173
174
 
174
- if response.cookies['SESSION']
175
- session_cookie = response.cookies['SESSION']
176
- redis.set(session_cache_key, session_cookie, ex: configuration.cache_ttl)
177
- logger.debug "#{identifier}.METHOD:authorize.SESSION_OBTAINED"
178
- session_cookie
179
- else
180
- logger.error "#{identifier}.METHOD:authorize.NO_SESSION_IN_RESPONSE"
181
- nil
182
- end
175
+ # Cache and return the root SESSION cookie
176
+ session_cookie = sessions[:session]
177
+ redis.set(session_cache_key, session_cookie, ex: configuration.cache_ttl)
178
+ logger.debug "#{identifier}.METHOD:authorize.SESSION_OBTAINED"
179
+ session_cookie
183
180
  rescue RestClient::Unauthorized, RestClient::Forbidden => e
184
181
  logger.error "#{identifier}.METHOD:authorize.AUTH_ERROR:#{e.message}"
185
182
  nil
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Conversant
4
- VERSION = '1.0.17'
4
+ VERSION = '1.0.18'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conversant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tho Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-10-01 00:00:00.000000000 Z
11
+ date: 2025-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json