| 1 | # | ||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||
| 3 | # | ||
| 4 | # vim: set ts=2 sw=2 tw=0: | ||
| 5 | # vim: set expandtab: | ||
| 6 | |||
| 7 | package Rex::Repositorio::Server::Docker::Helper::Auth; | ||
| 8 | |||
| 9 | use strict; | ||
| 10 | use warnings; | ||
| 11 | |||
| 12 | our $VERSION = '1.2.1'; # VERSION | ||
| 13 | |||
| 14 | sub create { | ||
| 15 | my ( $class, $type, $config ) = @_; | ||
| 16 | my $auth_class = "Rex::Repositorio::Server::Docker::Helper::Auth::$type"; | ||
| 17 | eval "use $auth_class;1;"; | ||
| 18 | if ($@) { | ||
| 19 | die "Error finding auth class: $auth_class."; | ||
| 20 | } | ||
| 21 | my $klass = $auth_class->new( %{$config} ); | ||
| 22 | return $klass; | ||
| 23 | } | ||
| 24 | |||
| 25 | 1; |