Net::Duo::Admin::Group(3) Representation of a Duo group

SYNOPSIS


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.

DESCRIPTION

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.

AUTHOR

Russ Allbery <[email protected]>

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.