Net::Duo::Admin::Group(3pm)

Net::Duo::Admin::Group3pm

Representation of a duo group

Usage

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

Requirements

Perl 5.14 or later and the modules HTTP::Request and HTTP::Response (part of HTTP::Message), JSON, LWP (also known as libwww-perl), Perl6::Slurp, Sub::Install, and URI::Escape (part of URI), all of which are available from CPAN.

Overview

A Net::Duo::Admin::Group object is a Perl representation of a Duo group as returned by the Duo Admin API, usually via the groups() method or nested in a user returned by the users() method. It contains various information about a group, including the privileges it controls.

Class methods

create(DUO, DATA)

Creates a new group in Duo and returns the resulting user as a new Net::Duo::Admin::Group object. DUO is the Net::Duo object that should be used to perform the creation. DATA is a reference to a hash with the following keys:

name

The name of the group to create. Required.

desc

The description of the group. Optional.

push_enabled

Whether users in the group will be able to use Duo Push to authenticate. See the "push_enabled()" method below for more information. Optional.

sms_enabled

Whether users in the group will be able to use SMS to authenticate. See the "sms_enabled()" method below for more information. Optional.

status

The group's authentication status. See 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. See the "voice_enabled()" method below for more information. Optional.

new(DUO, DATA)

Creates a new Net::Duo::Admin::Group 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.

Instance action methods

delete()

Delete this group from Duo. After successful completion of this call, the Net::Duo::Admin::Group object should be considered read-only, since no further changes to the object can be meaningfully sent to Duo.

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.

Instance data methods

desc()

The description of the group.

group_id()

The unique ID of this group as generated by Duo on group creation.

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, users in the group will not be able to use Duo Push to authenticate. Note that 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, users in the group will not be able to use SMS passcodes to authenticate. Note that this setting has no effect if SMS passcodes are disabled globally.

status()

One of the following values:

"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, users in the group will not be able to authenticate with a voice callback. Note that this setting has no effect if voice callback is disabled globally.

Releases

6 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12–13

Author

Russ Allbery <[email protected]>

From libnet-duo-perl 1.02-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.