.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Lemonldap::NG::Portal::Lib::2fDevices 3pm" .TH Lemonldap::NG::Portal::Lib::2fDevices 3pm "2023-05-13" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Lemonldap::NG::Portal::Lib::2fDevices \- Role for registrable second factors .SH "DESCRIPTION" .IX Header "DESCRIPTION" This role provides LemonLDAP::NG modules with a high-level interface to storing information on registrable second factors into the persistent session. .PP It is recommended that _2fDevices is never accessed directly from code outside of this module .SH "METHODS" .IX Header "METHODS" .IP "update2fDevice" 4 .IX Item "update2fDevice" Updates one field of a registered device .Sp .Vb 1 \& $self\->update2fDevice($req, $info, $type, $key, $value, $update_key, $update_value); .Ve .RS 4 .IP "req: Current LemonLDAP::NG request" 4 .IX Item "req: Current LemonLDAP::NG request" .PD 0 .IP "info: hashref of current session information" 4 .IX Item "info: hashref of current session information" .IP "type: 'type' field of the device to update" 4 .IX Item "type: 'type' field of the device to update" .IP "key, value: update the device whose 'key' field equals value" 4 .IX Item "key, value: update the device whose 'key' field equals value" .IP "update_key, update_value: set the matched devices' 'update_key' field to update_value" 4 .IX Item "update_key, update_value: set the matched devices' 'update_key' field to update_value" .RE .RS 4 .PD .Sp Returns true if the update was sucessful .RE .IP "add2fDevice" 4 .IX Item "add2fDevice" Register a new device .Sp .Vb 1 \& $self\->add2fDevice($req, $info, $device); .Ve .RS 4 .IP "req: Current LemonLDAP::NG request" 4 .IX Item "req: Current LemonLDAP::NG request" .PD 0 .IP "info: hashref of current session information" 4 .IX Item "info: hashref of current session information" .IP "device: hashref of device details. It must contain at least a 'type', 'name' and 'epoch' key" 4 .IX Item "device: hashref of device details. It must contain at least a 'type', 'name' and 'epoch' key" .RE .RS 4 .PD .Sp Returns true if the update was sucessful .RE .IP "del2fDevices" 4 .IX Item "del2fDevices" Delete the devices specified in the @$devices array .Sp .Vb 1 \& $self\->del2fDevices($req, $info, $devices); .Ve .RS 4 .IP "req: Current LemonLDAP::NG request" 4 .IX Item "req: Current LemonLDAP::NG request" .PD 0 .IP "info: hashref of current session information" 4 .IX Item "info: hashref of current session information" .IP "device: arrayref of type+epoch hashrefs" 4 .IX Item "device: arrayref of type+epoch hashrefs" .PD .Vb 1 \& [ { type => xxx, epoch => xxx }, { type => xxx, epoch => xxx } ] .Ve .RE .RS 4 .Sp Returns true if the update was sucessful .RE .IP "del2fDevice" 4 .IX Item "del2fDevice" Delete a single device .Sp .Vb 1 \& $self\->del2fDevice($req, $info, $type, $epoch); .Ve .RS 4 .IP "req: Current LemonLDAP::NG request" 4 .IX Item "req: Current LemonLDAP::NG request" .PD 0 .IP "info: hashref of current session information" 4 .IX Item "info: hashref of current session information" .IP "type: type of the device to remove" 4 .IX Item "type: type of the device to remove" .IP "epoch: timestamp of the device to remove" 4 .IX Item "epoch: timestamp of the device to remove" .RE .RS 4 .PD .Sp Returns true if the update was sucessful .RE .IP "find2fDevicesByKey" 4 .IX Item "find2fDevicesByKey" Find devices from one of its attributes .Sp .Vb 1 \& $self\->find2fDevicesByKey($req, $info, $type, $key, $value); .Ve .RS 4 .IP "req: Current LemonLDAP::NG request" 4 .IX Item "req: Current LemonLDAP::NG request" .PD 0 .IP "info: hashref of current session information" 4 .IX Item "info: hashref of current session information" .IP "type: device type" 4 .IX Item "type: device type" .IP "key, value: attribute to search in the device hash and the value to filter on" 4 .IX Item "key, value: attribute to search in the device hash and the value to filter on" .RE .RS 4 .PD .Sp Returns an array of devices for which type, key and value match the supplied ones .RE .IP "get2fDevices" 4 .IX Item "get2fDevices" Return all registrable devices. .Sp .Vb 1 \& $self\->get2fDevices($req, $info); .Ve .RS 4 .IP "req: Current LemonLDAP::NG request" 4 .IX Item "req: Current LemonLDAP::NG request" .PD 0 .IP "info: hashref of current session information" 4 .IX Item "info: hashref of current session information" .RE .RS 4 .PD .Sp Returns an arrayref of all registrable devices, or undef if an error occured .RE .IP "find2fDevicesByType" 4 .IX Item "find2fDevicesByType" Return all registrable devices of a certain type. If type is not given, return all registrable devices .Sp .Vb 1 \& $self\->find2fDevicesByType($req, $info, $type); .Ve .RS 4 .IP "req: Current LemonLDAP::NG request" 4 .IX Item "req: Current LemonLDAP::NG request" .PD 0 .IP "info: hashref of current session information" 4 .IX Item "info: hashref of current session information" .IP "type: type of registrable device to return" 4 .IX Item "type: type of registrable device to return" .RE .RS 4 .PD .Sp Returns an array of all matching devices .RE