package System::Introspector::Report::Publish::MediaWiki::HasConnectInfo;
use Moo::Role;

has connection_class    => (is => 'ro', lazy => 1, builder => 1);
has api_uri             => (is => 'ro', required => 1);
has username            => (is => 'ro', required => 1);
has password            => (is => 'ro', required => 1);
has http_auth           => (is => 'ro');
has http_realm          => (is => 'ro');

sub _build_connection_class {
  'System::Introspector::Report::Publish::MediaWiki::Connection'
}

sub connect_info_pairs {
  my ($self) = @_;
  return map { ($_ => $self->$_) } qw(
    api_uri
    username
    password
    http_auth
    http_realm
    connection_class
  );
}

1;
