From 66dd4a9093be4562d2c7a7a7d253d2afb034aef8 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 16 Jul 2014 15:51:13 -0700 Subject: Include the Duo type in the name of Duo integrations Eventually, there will be multiple object types for different Duo integrations, and they will need to have unique names. Add the Duo type in parentheses after the name to help ensure this. Change-Id: I679130f9136077fc6bf5d8c6c9ad98ec83b400d0 Reviewed-on: https://gerrit.stanford.edu/1573 Reviewed-by: Russ Allbery Tested-by: Russ Allbery --- perl/lib/Wallet/Object/Duo.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl/lib/Wallet/Object/Duo.pm') diff --git a/perl/lib/Wallet/Object/Duo.pm b/perl/lib/Wallet/Object/Duo.pm index e3fe2da..fcf3819 100644 --- a/perl/lib/Wallet/Object/Duo.pm +++ b/perl/lib/Wallet/Object/Duo.pm @@ -105,7 +105,7 @@ sub create { # Create the object in Duo. require Net::Duo::Admin::Integration; my %data = ( - name => $name, + name => "$name ($Wallet::Config::DUO_TYPE)", notes => 'Managed by wallet', type => $Wallet::Config::DUO_TYPE, ); -- cgit v1.2.3 From 8d66c66be27f795df314a69aeb49c75d075c8016 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 16 Jul 2014 15:52:51 -0700 Subject: Parse the Duo key_file in relaxed JSON mode When reading the Duo object configuration to retrieve the Duo admin server, parse the JSON in relaxed mode to match the behavior of Net::Duo itself. Otherwise, we get hung up on trailing commas that Net::Duo doesn't care about. Change-Id: I0a7347b22e379fe5dfe5fdabaec3e23420cf9a63 Reviewed-on: https://gerrit.stanford.edu/1574 Reviewed-by: Russ Allbery Tested-by: Russ Allbery --- perl/lib/Wallet/Object/Duo.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl/lib/Wallet/Object/Duo.pm') diff --git a/perl/lib/Wallet/Object/Duo.pm b/perl/lib/Wallet/Object/Duo.pm index fcf3819..6edc4fa 100644 --- a/perl/lib/Wallet/Object/Duo.pm +++ b/perl/lib/Wallet/Object/Duo.pm @@ -190,7 +190,7 @@ sub get { # We also need the admin server name, which we can get from the Duo object # configuration with a bit of JSON decoding. - my $json = JSON->new->utf8 (1); + my $json = JSON->new->utf8 (1)->relaxed (1); my $config = $json->decode (scalar slurp $Wallet::Config::DUO_KEY_FILE); # Construct the returned file. -- cgit v1.2.3