JMAP-Tester

 view release on metacpan or  search on metacpan

lib/JMAP/Tester.pm  view on Meta::CPAN

has _access_token => (
  is  => 'rw',
  init_arg => undef,
);

#pod =method get_client_session
#pod
#pod   $tester->get_client_session;
#pod   $tester->get_client_session($auth_uri);
#pod
#pod This method fetches the content at the authentication endpoint.
#pod
#pod This method respects the C<should_return_futures> attributes of the
#pod JMAP::Tester object, and in futures mode will return a future that will resolve
#pod to the L<JMAP::Tester::Result::Auth> object.
#pod
#pod =cut

sub _get_client_session_future ($self, $auth_uri = undef) {
  $auth_uri //= $self->authentication_uri;

lib/JMAP/Tester.pm  view on Meta::CPAN

sub get_client_session ($self, $auth_uri = undef) {
  my $future = $self->_get_client_session_future($auth_uri);
  return $self->should_return_futures ? $future : $future->$Failsafe->get;
}

#pod =method update_client_session
#pod
#pod   $tester->update_client_session;
#pod   $tester->update_client_session($auth_uri);
#pod
#pod This method fetches the content at the authentication endpoint and uses it to
#pod configure the tester's target URIs and signing keys.
#pod
#pod This method respects the C<should_return_futures> attributes of the
#pod JMAP::Tester object, and in futures mode will return a future that will resolve
#pod to the Result.
#pod
#pod =cut

sub update_client_session ($self, $auth_uri = undef) {
  my $future = $self->_get_client_session_future($auth_uri)->then(sub {

lib/JMAP/Tester.pm  view on Meta::CPAN


  return $self->should_return_futures ? $future : $future->$Failsafe->get;
}

#pod =method http_request
#pod
#pod   my $response = $jtest->http_request($http_request);
#pod
#pod Sometimes, you may need to make an HTTP request with your existing web
#pod connection.  This might be to interact with a custom authentication mechanism,
#pod to access custom endpoints, or just to make very, very specifically crafted
#pod requests.  For this reasons, C<http_request> exists.
#pod
#pod Pass this method an L<HTTP::Request> and it will use the tester's UA object to
#pod make the request.
#pod
#pod This method respects the C<should_return_futures> attributes of the
#pod JMAP::Tester object, and in futures mode will return a future that will resolve
#pod to the L<HTTP::Response>.
#pod
#pod =cut

lib/JMAP/Tester.pm  view on Meta::CPAN


This method respects the C<should_return_futures> attributes of the
JMAP::Tester object, and in futures mode will return a future that will resolve
to the Result.

=head2 get_client_session

  $tester->get_client_session;
  $tester->get_client_session($auth_uri);

This method fetches the content at the authentication endpoint.

This method respects the C<should_return_futures> attributes of the
JMAP::Tester object, and in futures mode will return a future that will resolve
to the L<JMAP::Tester::Result::Auth> object.

=head2 update_client_session

  $tester->update_client_session;
  $tester->update_client_session($auth_uri);

This method fetches the content at the authentication endpoint and uses it to
configure the tester's target URIs and signing keys.

This method respects the C<should_return_futures> attributes of the
JMAP::Tester object, and in futures mode will return a future that will resolve
to the Result.

=head2 configure_from_client_session

  $tester->configure_from_client_session($client_session);

lib/JMAP/Tester.pm  view on Meta::CPAN

This method respects the C<should_return_futures> attributes of the
JMAP::Tester object, and in futures mode will return a future that will resolve
to the Result.

=head2 http_request

  my $response = $jtest->http_request($http_request);

Sometimes, you may need to make an HTTP request with your existing web
connection.  This might be to interact with a custom authentication mechanism,
to access custom endpoints, or just to make very, very specifically crafted
requests.  For this reasons, C<http_request> exists.

Pass this method an L<HTTP::Request> and it will use the tester's UA object to
make the request.

This method respects the C<should_return_futures> attributes of the
JMAP::Tester object, and in futures mode will return a future that will resolve
to the L<HTTP::Response>.

=head2 http_get



( run in 0.451 second using v1.01-cache-2.11-cpan-524268b4103 )