Skip to content

Commit

Permalink
attributes sudo* isa ArrayRef[Str]
Browse files Browse the repository at this point in the history
LDIF::Sudoer changes sudoUser to be restricted as a Str
  • Loading branch information
shelling committed Sep 17, 2012
1 parent 977d417 commit 2f7acce
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions lib/App/LDAP/LDIF/Sudoer.pm
Expand Up @@ -41,19 +41,20 @@ has '+objectClass' => (
);

has '+sudoUser' => (
isa => "Str",
required => 1,
);

has '+sudoHost' => (
default => "ALL",
default => sub { ["ALL"] },
);

has '+sudoRunAsUser' => (
default => "ALL",
default => sub { ["ALL"] },
);

has '+sudoCommand' => (
default => "ALL",
default => sub { ["ALL"] },
);

__PACKAGE__->meta->make_immutable;
Expand Down
2 changes: 1 addition & 1 deletion lib/App/LDAP/ObjectClass/SudoRole.pm
Expand Up @@ -21,7 +21,7 @@ has [qw( sudoUser
sudoOption
description )] => (
is => "rw",
isa => "Str",
isa => "ArrayRef[Str]",
);

__PACKAGE__->meta->make_immutable;
Expand Down
12 changes: 6 additions & 6 deletions t/ldif/sudoer.t
Expand Up @@ -57,21 +57,21 @@ is (
"sudoUser is name",
);

is (
is_deeply (
$sudoer->sudoHost,
"ALL",
["ALL"],
"sudoHost has default value ALL",
);

is (
is_deeply (
$sudoer->sudoRunAsUser,
"ALL",
["ALL"],
"sudoRunAsUser has default value ALL",
);

is (
is_deeply (
$sudoer->sudoCommand,
"ALL",
["ALL"],
"sudoCommand has default value ALL",
);

Expand Down

0 comments on commit 2f7acce

Please sign in to comment.