CatalystX-OAuth2

 view release on metacpan or  search on metacpan

t/lib/AuthServer/Model/DB.pm  view on Meta::CPAN

package AuthServer::Model::DB;
use Moose;

BEGIN { extends 'Catalyst::Model::DBIC::Schema' }

has user_endpoint =>
  ( isa => 'Str', is => 'ro', default => sub {'http://localhost/auth'} );

__PACKAGE__->config(
  schema_class => 'CatalystX::OAuth2::Schema',
  connect_info => [ 'dbi:SQLite:dbname=:memory:', '', '' ]
);

around COMPONENT => sub {
  my $orig  = shift;
  my $class = shift;
  my $self  = $class->$orig(@_);
  $self->schema->deploy;
  $self->schema->resultset('Client')
    ->create(
    { endpoint => $self->user_endpoint, client_secret => 'foosecret' } );
  return $self;
};

1;



( run in 0.771 second using v1.01-cache-2.11-cpan-f56aa216473 )