Auth::CAS manager part (#1183)
This commit is contained in:
parent
9a0a56b5fd
commit
97e124e997
|
@ -451,14 +451,14 @@ sub _casMetaDataNodes {
|
||||||
my ( $self, $type, $req, @path ) = @_;
|
my ( $self, $type, $req, @path ) = @_;
|
||||||
my $refKey =
|
my $refKey =
|
||||||
( $type eq 'App' ? 'casAppMetaDataOptions' : 'casSrvMetaDataOptions' );
|
( $type eq 'App' ? 'casAppMetaDataOptions' : 'casSrvMetaDataOptions' );
|
||||||
return $self->complexNodesRoot( $req, $refKey, "oidc${type}MetaDataNode" )
|
return $self->complexNodesRoot( $req, $refKey, "cas${type}MetaDataNode" )
|
||||||
unless (@path);
|
unless (@path);
|
||||||
|
|
||||||
my $partner = shift @path;
|
my $partner = shift @path;
|
||||||
my $query = shift @path;
|
my $query = shift @path;
|
||||||
unless ($query) {
|
unless ($query) {
|
||||||
return $self->sendError( $req,
|
return $self->sendError( $req,
|
||||||
"Bad request: oidc${type}MetaDataNode query must ask for a key",
|
"Bad request: cas${type}MetaDataNode query must ask for a key",
|
||||||
400 );
|
400 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,12 +495,12 @@ sub _casMetaDataNodes {
|
||||||
|
|
||||||
sub casSrvMetaDataNodes {
|
sub casSrvMetaDataNodes {
|
||||||
my ( $self, $req, @path ) = @_;
|
my ( $self, $req, @path ) = @_;
|
||||||
return $self->_oidcMetaDataNodes( 'Srv', $req, @path );
|
return $self->_casMetaDataNodes( 'Srv', $req, @path );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub casAppMetaDataNodes {
|
sub casAppMetaDataNodes {
|
||||||
my ( $self, $req, @path ) = @_;
|
my ( $self, $req, @path ) = @_;
|
||||||
return $self->_oidcMetaDataNodes( 'App', $req, @path );
|
return $self->_casMetaDataNodes( 'App', $req, @path );
|
||||||
}
|
}
|
||||||
|
|
||||||
# 32 - Other special nodes
|
# 32 - Other special nodes
|
||||||
|
|
|
@ -632,15 +632,14 @@ sub attributes {
|
||||||
'mail' => 'mail',
|
'mail' => 'mail',
|
||||||
'uid' => 'uid'
|
'uid' => 'uid'
|
||||||
},
|
},
|
||||||
'keyMsgFail' => '__badVariableName__',
|
|
||||||
'keyTest' => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
|
|
||||||
'msgFail' => '__badValue__',
|
|
||||||
'test' => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
|
|
||||||
'type' => 'keyTextContainer'
|
'type' => 'keyTextContainer'
|
||||||
},
|
},
|
||||||
'casAppMetaDataNodes' => {
|
'casAppMetaDataNodes' => {
|
||||||
'type' => 'casAppMetaDataNodeContainer'
|
'type' => 'casAppMetaDataNodeContainer'
|
||||||
},
|
},
|
||||||
|
'casAppMetaDataOptions' => {
|
||||||
|
'type' => 'subContainer'
|
||||||
|
},
|
||||||
'casAttr' => {
|
'casAttr' => {
|
||||||
'type' => 'text'
|
'type' => 'text'
|
||||||
},
|
},
|
||||||
|
@ -657,10 +656,6 @@ sub attributes {
|
||||||
'mail' => 'mail',
|
'mail' => 'mail',
|
||||||
'uid' => 'uid'
|
'uid' => 'uid'
|
||||||
},
|
},
|
||||||
'keyMsgFail' => '__badVariableName__',
|
|
||||||
'keyTest' => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
|
|
||||||
'msgFail' => '__badValue__',
|
|
||||||
'test' => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
|
|
||||||
'type' => 'keyTextContainer'
|
'type' => 'keyTextContainer'
|
||||||
},
|
},
|
||||||
'casSrvMetaDataNodes' => {
|
'casSrvMetaDataNodes' => {
|
||||||
|
|
|
@ -2060,10 +2060,6 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
|
||||||
},
|
},
|
||||||
casSrvMetaDataExportedVars => {
|
casSrvMetaDataExportedVars => {
|
||||||
type => 'keyTextContainer',
|
type => 'keyTextContainer',
|
||||||
keyTest => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
|
|
||||||
keyMsgFail => '__badVariableName__',
|
|
||||||
test => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
|
|
||||||
msgFail => '__badValue__',
|
|
||||||
default => { cn => 'cn', mail => 'mail', uid => 'uid', },
|
default => { cn => 'cn', mail => 'mail', uid => 'uid', },
|
||||||
documentation => 'CAS exported variables',
|
documentation => 'CAS exported variables',
|
||||||
},
|
},
|
||||||
|
@ -2081,12 +2077,9 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
|
||||||
msgFail => '__badUrl__',
|
msgFail => '__badUrl__',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
casAppMetaDataOptions => { type => 'subContainer', },
|
||||||
casAppMetaDataExportedVars => {
|
casAppMetaDataExportedVars => {
|
||||||
type => 'keyTextContainer',
|
type => 'keyTextContainer',
|
||||||
keyTest => qr/^!?[a-zA-Z][a-zA-Z0-9_-]*$/,
|
|
||||||
keyMsgFail => '__badVariableName__',
|
|
||||||
test => qr/^[a-zA-Z][a-zA-Z0-9_:\-]*$/,
|
|
||||||
msgFail => '__badValue__',
|
|
||||||
default => { cn => 'cn', mail => 'mail', uid => 'uid', },
|
default => { cn => 'cn', mail => 'mail', uid => 'uid', },
|
||||||
documentation => 'CAS exported variables',
|
documentation => 'CAS exported variables',
|
||||||
},
|
},
|
||||||
|
|
|
@ -453,7 +453,10 @@ sub _scanNodes {
|
||||||
$self->_scanNodes($subNodes);
|
$self->_scanNodes($subNodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif ( $target =~
|
elsif ( $target =~ /^cas(?:Srv|App)MetaDataOptions/ ) {
|
||||||
|
my $optKey = $&;
|
||||||
|
hdebug " $base sub key: $target";
|
||||||
|
if ( $target =~
|
||||||
/^(?:$casSrvMetaDataNodeKeys|$casAppMetaDataNodeKeys)/o )
|
/^(?:$casSrvMetaDataNodeKeys|$casAppMetaDataNodeKeys)/o )
|
||||||
{
|
{
|
||||||
$self->set( $optKey, [ $oldName, $key ],
|
$self->set( $optKey, [ $oldName, $key ],
|
||||||
|
@ -461,10 +464,17 @@ sub _scanNodes {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
push @{ $self->errors },
|
push @{ $self->errors },
|
||||||
{ message => "Unknown OIDC metadata option $target" };
|
{ message => "Unknown CAS metadata option $target" };
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
push @{ $self->errors },
|
||||||
|
{ message => "Unknown CAS option $target" };
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
next;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
push @{ $self->errors },
|
push @{ $self->errors },
|
||||||
{ message => "Fatal: unknown special sub node $base" };
|
{ message => "Fatal: unknown special sub node $base" };
|
||||||
|
|
Loading…
Reference in New Issue
Block a user