Net::D...:Group(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 πŸ’–

Okay so bestie, you're looking at Net::Duo::Admin::Group β€” it's a whole Perl object that is a Duo group. Like, a group from Duo, but in Perl form. This page is the manual page Net::D...:Group(3pm), and yes it ate πŸ’…. Iconic.


🌸 SYNOPSIS 🌸

The vibe in code form:

my $decoded_json = get_json();
my $group = Net::Duo::Admin::Group->new($decoded_json);
say $group->desc;

That's it. That's the whole main character moment. ✨


πŸŽ€ REQUIREMENTS πŸŽ€

You need Perl 5.14 or later, plus these modules, all of which live on CPAN:

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

πŸ¦‹ DESCRIPTION πŸ¦‹

A Net::Duo::Admin::Group object is a Perl representation of a Duo group, exactly as the Duo Admin API hands it back. Usually you get one from the groups() method, or it's just chilling nested inside a user that came out of the users() method. It's carrying all sorts of info about the group, including the privileges that group controls. πŸ‘‘


πŸ‘‘ CLASS METHODS πŸ‘‘

create(DUO, DATA)

Makes a brand-new group over in Duo and hands you the resulting user as a fresh Net::Duo::Admin::Group object.

  • DUO β€” the Net::Duo object that should be used to perform the creation.
  • DATA β€” a reference to a hash. Here's what can go in it:
    • name β€” the name of the group to create. Required. Fr fr, you need this one.
    • desc β€” the description of the group. Optional.
    • push_enabled β€” whether users in the group will be able to use Duo Push to authenticate. Peep the push_enabled() method below for more. Optional.
    • sms_enabled β€” whether users in the group will be able to use SMS to authenticate. Peep the sms_enabled() method below for more. Optional.
    • status β€” the group's authentication status. Peep the status() method below for the possible values. Optional.
    • voice_enabled β€” whether users in the group will be able to use voice callbacks to authenticate. Peep the voice_enabled() method below for more. Optional.

new(DUO, DATA)

Builds a new Net::Duo::Admin::Group object out of a full data set.

  • DUO β€” the Net::Duo object that should be used for any further actions on this object.
  • DATA β€” the data structure the Duo REST API returned for a single user, after JSON decoding.

πŸ”₯ INSTANCE ACTION METHODS πŸ”₯

delete()

Yeets this group from Duo. πŸ—‘οΈ Once this call succeeds, treat the Net::Duo::Admin::Group object as read-only, because there's no meaningful way to send any further changes to Duo. It's done, bestie. It's in its read-only era.

json()

Converts the data stored in the object into JSON and returns the results. The JSON you get back should match the JSON you'd get from the Duo web service when retrieving that same object (plus any changes you made locally with the set_*() methods). This is mostly for debugging dumps, or for passing Duo objects along to other systems through more JSON APIs. Very giving "here's the receipts in JSON form". πŸ’…


🌈 INSTANCE DATA METHODS 🌈

desc()

The description of the group.

group_id()

The unique ID of this group, as generated by Duo when the group was created.

name()

The name of this group.

push_enabled()

If true, users in the group will be able to use Duo Push to authenticate. If false, they won't be able to use Duo Push to authenticate. Lowkey important: this setting has no effect if Duo Push is disabled globally. πŸ™ˆ

sms_enabled()

If true, users in the group will be able to use SMS passcodes to authenticate. If false, they won't be able to use SMS passcodes to authenticate. Also: this setting has no effect if SMS passcodes are disabled globally. πŸ™ˆ

status()

One of these three values, no others, periodt:

  • "active" β€” the users in this group must complete secondary authentication.
  • "bypass" β€” the users in this group will bypass secondary authentication after completing primary authentication.
  • "disabled" β€” the users in this group will not be able to authenticate. πŸ’€

voice_enabled()

If true, users in the group will be able to authenticate with a voice callback. If false, they won't be able to authenticate with a voice callback. And yup: this setting has no effect if voice callback is disabled globally. πŸ™ˆ


🫢 AUTHOR 🫢

Russ Allbery <rra@cpan.org>


Okay so here comes the legal bit, and we're keeping it word-for-word because that's how licenses work, bestie:

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 ⭐


That's the whole page, bestie β€” written against perl v5.36.0, dated 2022-12-18, and it's the manual page Net::D...:Group(3pm). Go make some groups. Slay. πŸ‘‘βœ¨πŸŽ€

πŸ“¦ where this page comes from