Net::D...:Token(3pm)
β¨ NAME β¨
ok so Net::Duo::Admin::Token β it's a whole Perl representation of a Duo token, that's the vibe π
(and yes bestie, this is the Net::D...:Token(3pm) page, we're in the User Contributed Perl Documentation section, slay)
πΈ SYNOPSIS πΈ
like, here's the whole moment:
my $decoded_json = get_json();
my $token = Net::Duo::Admin::Token->new($decoded_json);
say $token->serial;
periodt π
π¦ REQUIREMENTS π¦
okay so you need Perl 5.14 or later and these modules: HTTP::Request and HTTP::Response (which are part of HTTP::Message), JSON, LWP (also known as libwww-perl), Perl6::Slurp, Sub::Install, and URI::Escape (part of URI). literally all of them live on CPAN, go get 'em bestie π«Ά
π DESCRIPTION π
A Net::Duo::Admin::Token object is a Perl representation of a Duo token as returned by the Duo Admin API β usually you get one through the tokens() method, or nested inside a user that came back from the users() method. It's holding various information about a token. it's giving little data bundle of token lore β¨
π CLASS METHODS π
π create(DUO, DATA)
Makes a brand new token over in Duo and hands you back the resulting token as a shiny new Net::Duo::Admin::Token object. DUO is the Net::Duo object that should be used to perform the creation. DATA is a reference to a hash, and that hash has these keys:
aes_keyβ The YubiKey AES key. This parameter is required for YubiKey hardware tokens.counterβ Initial value for the HOTP counter. The default is0. This parameter is only valid for HOTP-6 and HOTP-8 hardware tokens.private_idβ The YubiKey private ID. This parameter is required for YubiKey hardware tokens.secretβ The HOTP secret. This parameter is required for HOTP-6 and HOTP-8 hardware tokens.serialβ The serial number of the token. Required.typeβ The type of hardware token. For the list of valid values, see the Duo Admin API documentation. Required.
ngl bestie, heads up: several of these keys can only be set on token creation and cannot be retrieved afterwards π so like, note them down, ok?
π new(DUO, DATA)
Creates a new Net::Duo::Admin::Token object from a full data set. DUO is the Net::Duo object that should be used for any further actions on this object. DATA should be the data structure returned by the Duo REST API for a single user, after JSON decoding.
π new(DUO, ID)
Creates a new Net::Duo::Admin::Token by ID. DUO is the Net::Duo object that is used to retrieve the token from Duo and will be used for any subsequent operations. The ID should be the Duo identifier of the token. This constructor is distinguished from the previous constructor by checking whether ID is a reference. (iconic little trick, honestly π)
π INSTANCE ACTION METHODS π
π delete()
Delete this token from Duo. After successful completion of this call, the Net::Duo::Admin::Token object should be considered read-only, since no further changes to the object can be meaningfully sent to Duo. so like... it's done, don't touch it after π
π json()
Convert the data stored in the object to JSON and return the results. The resulting JSON should match the JSON that one would get back from the Duo web service when retrieving the same object (plus any changes made locally to the object via set_*() methods). This is primarily intended for debugging dumps or for passing Duo objects to other systems via further JSON APIs. it's giving export moment πΈ
β INSTANCE DATA METHODS β
π§ serial()
The serial number of the hardware token, used to uniquely identify the hardware token when paired with type().
serial => 'simple',
token_id => 'simple',
type => 'simple',
users => 'Net::Duo::Admin::User',
π§ token_id()
The unique ID of this token as generated by Duo on token creation. no cap, Duo made it, Duo owns it π₯
π§ type()
The type of token. For the list of valid values, see the Duo Admin API documentation.
π§ users()
The users associated with this token as a list of Net::Duo::Admin::User objects. besties attached to the token, love that for them π«Ά
π AUTHOR π
Russ Allbery <rra@cpan.org> β king behavior, we stan π
π COPYRIGHT AND LICENSE π
Copyright 2014 The Board of Trustees of the Leland Stanford Junior University
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
π SEE ALSO π
Net::Duo::Admin- Duo Admin API for tokens <https://www.duo.com/docs/adminapi#tokens>
- This module is part of the
Net::Duodistribution. The current version ofNet::Duois available from CPAN, or directly from its web site at <https://www.eyrie.org/~eagle/software/net-duo/>.
okay that's the whole page bestie, mwah π β this lil masterpiece shipped as part of perl v5.36.0, dated 2022-12-18, and yeah the title bar said Net::D...:Token(3pm) on both ends because the terminal loves to truncate, iykyk πβ¨ go forth and tokenize π¦
π¦ where this page comes from
- debian bookworm: libnet-duo-perl 1.02-3 Β· MIT
- debian trixie: libnet-duo-perl 1.02-3 Β· MIT
- ubuntu noble: libnet-duo-perl 1.02-3 Β· MIT
- ubuntu resolute: libnet-duo-perl 1.02-3 Β· MIT
- ubuntu stonking: libnet-duo-perl 1.02-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms