Lemonld...fDevices(3)
π NAME π
ok so Lemonldap::NG::Portal::Lib::2fDevices β it's the role that handles registrable second factors, no big deal π
β¨ DESCRIPTION β¨
bestie. listen. this role hands LemonLDAP::NG modules a high-level interface for storing info about registrable second factors straight into the persistent session. that's the whole vibe. it's giving "we handle the storage so you don't have to" π
lowkey important: it's recommended that _2fDevices is never accessed directly from code outside of this module. like, don't touch it, it's not yours. iykyk π
π¦ METHODS π¦
update2fDevice
updates one field of a registered device. just one. one single field. slay β¨
$self->update2fDevice($req, $info, $type, $key, $value, $update_key, $update_value);
here's the tea on the args:
- req: the current LemonLDAP::NG request π
- info: hashref of current session information
- type: the
'type'field of the device you wanna update - key, value: updates the device whose
'key'field equals value - update_key, update_value: sets the matched device's
'update_key'field to update_value
returns true if the update was successful π
add2fDevice
stores a brand new device. new device, who dis πΈ
$self->add2fDevice($req, $info, $device);
the lineup:
- req: the current LemonLDAP::NG request
- info: hashref of current session information
- device: hashref of device details. it must contain at least a
'type','name'and'epoch'key, no cap
returns true if the update was successful π
del2fDevices
deletes the devices you list in the @$devices array. plural. we're cleaning house π§Ή
$self->del2fDevices($req, $info, $devices);
the deets:
- req: the current LemonLDAP::NG request
- info: hashref of current session information
- device: arrayref of type+epoch hashrefs, looking like this:
[ { type => xxx, epoch => xxx }, { type => xxx, epoch => xxx } ]
returns true if the update was successful β¨
del2fDevice
deletes a single device. one. just the one. very demure π·
$self->del2fDevice($req, $info, $type, $epoch);
the rundown:
- req: the current LemonLDAP::NG request
- info: hashref of current session information
- type: type of the device to remove
- epoch: timestamp of the device to remove
returns true if the update was successful π«Ά
find2fDevicesByKey
finds devices by one of their attributes. detective mode activated π
$self->find2fDevicesByKey($req, $info, $type, $key, $value);
what you're working with:
- req: the current LemonLDAP::NG request
- info: hashref of current session information
- type: device type
- key, value: the attribute to search for in the device hash, and the value to filter on
returns an array of devices where the type, key and value all match what you passed in π
get2fDevices
returns all the registrable devices. the whole collection. main character energy π
$self->get2fDevices($req, $info);
- req: the current LemonLDAP::NG request
- info: hashref of current session information
returns an arrayref of all registrable devices... or undef if an error occurred π (we don't talk about that)
find2fDevicesByType
returns all registrable devices of a certain type. and if you don't give a type? it just returns all of them. generous queen π
$self->find2fDevicesByType($req, $info, $type);
- req: the current LemonLDAP::NG request
- info: hashref of current session information
- type: type of registrable device to return
returns an array of all matching devices β
ok that's the whole page, bestie, we ate fr fr π this was perl v5.42.3, dated 2026-09-24, from the User Contributed Perl Documentation β go forth and manage your second factors responsibly πβ¨π
π¦ where this page comes from
- fedora 43: lemonldap-ng-portal 2.23.4-1.fc43 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- fedora 44: lemonldap-ng-portal 2.23.4-1.fc44 Β· GPL-2.0-or-later AND MIT AND GPL-3.0-or-later AND OFL-1.1-RFN
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms