Net::D...ration(3pm)

πŸ“¦
version 1.02 Β· 2 versions
  • 1.02 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.02 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Net::Duo::Admin::Integration β€” bestie, it's the Perl glow-up of a Duo integration ✨ (that's Net::Duo::Admin::Integration, the 3pm one, living in User Contributed Perl Documentation, iykyk)


✨ SYNOPSIS ✨

my $decoded_json = get_json();
my $integration = Net::Duo::Admin::Integration->new($decoded_json);
say $integration->secret_key;

Like. That's it. That's the whole vibe. 🫢


πŸŽ€ REQUIREMENTS πŸŽ€

okay so you need Perl 5.14 or later, no negotiating, and then these modules:

  • HTTP::Request and HTTP::Response (they come bundled inside HTTP::Message)
  • JSON
  • LWP (also known as libwww-perl)
  • Perl6::Slurp
  • Sub::Install
  • URI::Escape (part of URI)

and literally all of them are on CPAN, so go get 'em πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So a integration is Duo's cute little name for the metadata of a system or service that's allowed to use one or more of the Duo APIs. And this object? This object is the Perl representation of a Duo integration exactly as it comes back from the Duo Admin API β€” usually you'll get one through the integrations() method of Net::Duo::Admin, or by grabbing an integration by its integration key. Slay. 🌈


πŸ‘‘ CLASS METHODS πŸ‘‘

🌸 create(DUO, DATA)

Makes a brand new integration over in Duo and hands you back the resulting integration as a shiny new Net::Duo::Admin::Integration object. πŸ’–

  • DUO is the Net::Duo object you want doing the actual creating.
  • DATA is a reference to a hash, and it can hold one or more of the keys below. Heads up bestie: the name and type keys are required. No cap.

  • adminapi_admins β€” Only valid for integrations of type adminapi. Set it to a true value to grant permission to use all Admin API methods. Optional, and defaults to false.
  • adminapis_info β€” Only valid for integrations of type adminapi. Set it to a true value to grant permission to use all Admin API account info methods. Optional, and defaults to false.
  • adminapis_integrations β€” Only valid for integrations of type adminapi. Set it to a true value to grant permission to use all Admin API integration methods. Optional, and defaults to false.
  • adminapis_read_log β€” Only valid for integrations of type adminapi. Set it to a true value to grant permission to use all Admin API log methods. Optional, and defaults to false.
  • adminapis_read_resource β€” Only valid for integrations of type adminapi. Set it to a true value to grant permission to use all Admin API methods that retrieve objects like users, phones, and hardware tokens. And listen: setting this key does not grant permission to change those objects or create new ones. Optional, and defaults to false.
  • adminapis_settings β€” Only valid for integrations of type adminapi. Set it to a true value to grant permission to use all Admin API settings methods. These ones control global settings for the entire Duo account. Optional, and defaults to false.
  • adminapis_write_resource β€” Only valid for integrations of type adminapi. Set it to a true value to grant permission to use all Admin API methods that create or modify objects like as users, phones, and hardware tokens. Optional, and defaults to false.
  • enroll_policy β€” What to do after an enrolled user passes primary authentication. Peep the enroll_policy() method below for the possible values. Optional, and defaults to enroll.
  • greeting β€” The voice greeting read before the authentication instructions, for users who authenticate with a phone callback. Optional.
  • groups_allowed β€” A comma-separated list of group IDs that are allowed to authenticate with the integration. Optional. By default, all groups are allowed.
  • ip_whitelist β€” A CSV string of trusted IPs or IP ranges. Both CIDR-style ranges and ranges given as two IP addresses separated by a dash (-) are supported. Authentications coming from these IP addresses will not require a second factor.

This can only be set for certain integrations. For the range of valid values and the circumstances where you can use it, go check the Duo Admin API documentation. Optional.

  • ip_whitelist_enroll_policy β€” What to do after a new user from a trusted IP completes primary authentication. Peep the ip_whitelist_enroll_policy() method below for the possible values. Optional, and defaults to enforce.
  • name β€” The name of the integration. Required. πŸ‘‘
  • notes β€” Any further description of the integration. Optional.
  • trusted_device_days β€” Number of days to allow a user to trust the device they're logging in with. This can only be set for certain integrations, and it has to be between 0 and 60. (0 disables this feature.) For the circumstances where you can use it, go check the Duo Admin API documentation. Optional.
  • type β€” The type of the integration. For a list of valid values, go check the Duo Admin API documentation. Required. πŸ‘‘
  • username_normalization_policy β€” Controls whether or not usernames should be altered before trying to match them to a user account. Peep the username_normalization_policy() method below for the possible values. Optional, and defaults to simple.
  • visual_style β€” The look and feel of the web content generated by the integration. This can only be set for certain integrations. For a list of valid values and the circumstances where you can use it, go check the Duo Admin API documentation. Optional.

🌸 new(DUO, DATA)

Builds a fresh Net::Duo::Admin::Integration object out of 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 that the Duo REST API returns for a single user, after JSON decoding.

This constructor is mainly used internally by other Net::Duo::Admin methods. 🀫

🌸 new(DUO, KEY)

Builds a fresh Net::Duo::Admin::Integration object out of the integration key.

  • DUO is the Net::Duo object that gets used to retrieve the integration from Duo, and will be used for any subsequent operations.
  • KEY should be the integration key of the integration.

And here's the cute part: this constructor is told apart from the previous one by checking whether KEY is a reference. 🧚


πŸ’… INSTANCE ACTION METHODS πŸ’…

🌺 delete()

Deletes this integration from Duo. And after this call completes successfully? Bestie, the Net::Duo::Admin::Integration object should be considered read-only, because no further changes to the object can be meaningfully sent to Duo. It's giving ghosted. πŸ’€

🌺 json()

Converts the data stored in the object to JSON and returns the results. The resulting JSON should match the JSON you'd 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 meant for debugging dumps, or for passing Duo objects to other systems through further JSON APIs. πŸ“¦βœ¨


πŸ’Ύ INSTANCE DATA METHODS πŸ’Ύ

okay bestie, this is the part where you actually read stuff off your integration object β€” all the little getters that tell you what your integration is and what it's allowed to do. no cap, these are the receipts. ✨

adminapi_admins()

Whether this admin integration may use all Admin API methods. πŸ‘‘

adminapis_info()

Whether this admin integration may use all Admin API account info methods.

adminapis_integrations()

Whether this admin integration may use all Admin API integration methods.

adminapis_read_log()

Whether this admin integration may use all Admin API log methods.

adminapis_read_resource()

Whether this admin integration may use all Admin API methods that retrieve objects such as users, phones, and hardware tokens. literally just the reading ones, she's nosy not handsy πŸ’…

adminapis_settings()

Whether this admin integration may use all Admin API settings methods.

adminapis_write_resource()

Whether this admin integration may use all Admin API methods that create or modify objects such as as users, phones, and hardware tokens.

ngl the original page says "<span>such as as users</span>" with a double "as" and honestly? iconic typo. keeping it, character for character, because the facts are the facts. 🫢

enroll_policy()

What to do after an enrolled user passes primary authentication. The value will be one of "enroll", to prompt the user to enroll, "allow", to allow the user to sign in without presenting an additional factor, and "deny", to deny authentication for this user.

greeting()

Voice greeting read before the authentication instructions to users who authenticate with a phone callback. πŸŽ€

groups_allowed()

A reference to an array of group IDs that are allowed to authenticate with the integration.

ip_whitelist()

List of trusted IPs or IP ranges. Ranges may be in the form of CIDR network blocks or ranges specified by two IP addresses separated by a dash ("-") are supported. Authentications from these IP addresses will not require a second factor. Example values:

192.0.2.8
198.51.100.0-198.51.100.20
203.0.113.0/24

This is only supported with certain integration types.

heads up bestie, that's a conditional setting β€” some integration types just don't do it. don't come for me if it's not there for yours. πŸ™ˆ

ip_whitelist_enroll_policy()

What to do after a new user from a trusted IP completes primary authentication. The value will be either "enforce", meaning that the user will be subject to the normal enrollment policy as returned by enroll_policy(), or "allow", which means that the user will be successfully authenticated without being required to enroll, skipping any enrollment policy.

integration_key()

The identifier of this integration. For "adminapi", "accountsapi", "rest", and "verify" integrations, this is the key used as the "integration_key" value when constructing a Net::Duo object. πŸ”‘

name()

The name of the integration.

notes()

Any further description of the integration.

secret_key()

Secret used when configuring systems to use this integration. For "adminapi", "accountsapi", "rest", and "verify" integrations, this is the key used as the "secret_key" value when constructing a Net::Duo object. This is equivalent to a password and should be treated with the same care.

🚨 BESTIE. THIS. IS. A. PASSWORD. treat it like one. do not commit it, do not paste it in the group chat, do not leave it in a gist. i am dead serious, fr fr. πŸ”₯

trusted_device_days()

Number of days to allow a user to trust the device they are logging in with, or 0 if this is disabled. This setting only has an effect for certain integrations.

type()

The type of the integration. For a list of possible values, see the Duo Admin API documentation.

username_normalization_policy()

Controls whether or not usernames should be altered before trying to match them to a user account. The value will be either "none", indicating no normalization, or "simple", in which "DOMAIN\username" and "username@example.com" will be converted to "username" before authentication is attempted.

visual_style()

Look and feel of web content generated by the integration. This only has an effect for some integrations. For a list of valid values, see the Duo Admin API documentation. 🎨


πŸ‘‘ AUTHOR πŸ‘‘

Russ Allbery <rra@cpan.org>

the one, the only, the legend. respect. πŸ’œ


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.

okay yes that part is in legalese and not in my voice but bestie, it's legal text, you don't remix that. it stays exactly as written. 🫑

🌈 SEE ALSO 🌈


and that's the whole page, bestie!! πŸ’– you made it to the end, main character energy fr. this was perl v5.36.0, dated 2022-12-18, and it's the Net::D...ration(3pm) page β€” go forth and integrate slayfully. πŸ¦‹βœ¨πŸ‘‘

πŸ“¦ where this page comes from