module DaVinciPASTestKit::SessionIdentification

def bearer_token_to_wait_identifier(token)

- otherwise, use the raw token (provided token)
- if structured like a token returned by the simulated Auth server, return the client URI
interpret the bearer token structure to determine the wait identifer
def bearer_token_to_wait_identifier(token)
  client_id = UDAPSecurityTestKit::MockUDAPServer.issued_token_to_client_id(token)
  return client_id if client_id.present?
  token
end

def session_endpont_url(endpoint, client_id, session_url_path)

def session_endpont_url(endpoint, client_id, session_url_path)
  path =
    if client_id.present?
      ''
    elsif session_url_path.present?
      session_url_path
    else
      test_session_id
    end
  case endpoint
  when :submit
    session_submit_url(path)
  when :inquire
    session_inquire_url(path)
  when :subscription
    session_fhir_subscription_url(path)
  end
end

def session_wait_identifier(client_id, session_url_path)

def session_wait_identifier(client_id, session_url_path)
  # look at test config and determine the wait identifier to use
  # at somepoint this would be an inferno type, for now, just two options
  return client_id if client_id.present?
  return session_url_path if session_url_path.present?
  test_session_id
end