diff --git a/Changes b/Changes index 241c651e..7e5b48bc 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,16 @@ +2.042000 - 2019-03-17 + + [NEW FEATURES] + + * Implementation of API authentication and Swagger-UI (pyro3d and ollyg) + +2.041002 - 2019-03-17 + + [BUG FIXES] + + * fix precedence of device_auth over snmp_auth loading + * check legacy config name for nbtstat_response_timeout + 2.041001 - 2019-03-15 [ENHANCEMENTS] diff --git a/MANIFEST b/MANIFEST index 20db16c8..f241ae23 100644 --- a/MANIFEST +++ b/MANIFEST @@ -230,6 +230,7 @@ lib/App/Netdisco/Worker/Plugin/PortName.pm lib/App/Netdisco/Worker/Plugin/Power.pm lib/App/Netdisco/Worker/Plugin/Psql.pm lib/App/Netdisco/Worker/Plugin/Renumber.pm +lib/App/Netdisco/Worker/Plugin/SetUserToken.pm lib/App/Netdisco/Worker/Plugin/Show.pm lib/App/Netdisco/Worker/Plugin/Stats.pm lib/App/Netdisco/Worker/Plugin/Vlan.pm @@ -367,10 +368,24 @@ share/schema_versions/App-Netdisco-DB-50-51-PostgreSQL.sql share/schema_versions/App-Netdisco-DB-51-52-PostgreSQL.sql share/schema_versions/App-Netdisco-DB-52-53-PostgreSQL.sql share/schema_versions/App-Netdisco-DB-53-54-PostgreSQL.sql +share/schema_versions/App-Netdisco-DB-54-55-PostgreSQL.sql share/schema_versions/App-Netdisco-DB-6-7-PostgreSQL.sql share/schema_versions/App-Netdisco-DB-7-8-PostgreSQL.sql share/schema_versions/App-Netdisco-DB-8-9-PostgreSQL.sql share/schema_versions/App-Netdisco-DB-9-10-PostgreSQL.sql +share/swagger-ui/favicon-16x16.png +share/swagger-ui/favicon-32x32.png +share/swagger-ui/index.html +share/swagger-ui/oauth2-redirect.html +share/swagger-ui/swagger-ui-bundle.js +share/swagger-ui/swagger-ui-bundle.js.map +share/swagger-ui/swagger-ui-standalone-preset.js +share/swagger-ui/swagger-ui-standalone-preset.js.map +share/swagger-ui/swagger-ui.css +share/swagger-ui/swagger-ui.css.map +share/swagger-ui/swagger-ui.js +share/swagger-ui/swagger-ui.js.map +share/swagger-ui/version-3.20.3 share/views/admintask.tt share/views/ajax/admintask/duplicatedevices.tt share/views/ajax/admintask/jobqueue.tt diff --git a/META.json b/META.json index 89bbd957..49e06809 100644 --- a/META.json +++ b/META.json @@ -48,6 +48,7 @@ "Dancer::Plugin::Auth::Extensible" : "0.30", "Dancer::Plugin::DBIC" : "0.2001", "Dancer::Plugin::Passphrase" : "v2.0.1", + "Dancer::Plugin::Swagger" : "0", "Dancer::Session::Cookie" : "0.27", "Data::Printer" : "0", "Expect" : "0", @@ -119,7 +120,7 @@ "provides" : { "App::Netdisco" : { "file" : "lib/App/Netdisco.pm", - "version" : "2.041001" + "version" : "2.042000" }, "App::Netdisco::AnyEvent::Nbtstat" : { "file" : "lib/App/Netdisco/AnyEvent/Nbtstat.pm" @@ -141,7 +142,7 @@ }, "App::Netdisco::DB" : { "file" : "lib/App/Netdisco/DB.pm", - "version" : "54" + "version" : "55" }, "App::Netdisco::DB::ExplicitLocking" : { "file" : "lib/App/Netdisco/DB/ExplicitLocking.pm" @@ -770,6 +771,9 @@ "App::Netdisco::Worker::Plugin::Renumber" : { "file" : "lib/App/Netdisco/Worker/Plugin/Renumber.pm" }, + "App::Netdisco::Worker::Plugin::SetUserToken" : { + "file" : "lib/App/Netdisco/Worker/Plugin/SetUserToken.pm" + }, "App::Netdisco::Worker::Plugin::Show" : { "file" : "lib/App/Netdisco/Worker/Plugin/Show.pm" }, @@ -810,6 +814,6 @@ "x_IRC" : "irc://irc.freenode.org/#netdisco", "x_MailingList" : "https://lists.sourceforge.net/lists/listinfo/netdisco-users" }, - "version" : "2.041001", + "version" : "2.042000", "x_serialization_backend" : "JSON::PP version 2.97001" } diff --git a/META.yml b/META.yml index 1fb921b8..5f33dadb 100644 --- a/META.yml +++ b/META.yml @@ -23,7 +23,7 @@ name: App-Netdisco provides: App::Netdisco: file: lib/App/Netdisco.pm - version: '2.041001' + version: '2.042000' App::Netdisco::AnyEvent::Nbtstat: file: lib/App/Netdisco/AnyEvent/Nbtstat.pm App::Netdisco::Backend::Job: @@ -38,7 +38,7 @@ provides: file: lib/App/Netdisco/Configuration.pm App::Netdisco::DB: file: lib/App/Netdisco/DB.pm - version: '54' + version: '55' App::Netdisco::DB::ExplicitLocking: file: lib/App/Netdisco/DB/ExplicitLocking.pm App::Netdisco::DB::Result::Admin: @@ -457,6 +457,8 @@ provides: file: lib/App/Netdisco/Worker/Plugin/Psql.pm App::Netdisco::Worker::Plugin::Renumber: file: lib/App/Netdisco/Worker/Plugin/Renumber.pm + App::Netdisco::Worker::Plugin::SetUserToken: + file: lib/App/Netdisco/Worker/Plugin/SetUserToken.pm App::Netdisco::Worker::Plugin::Show: file: lib/App/Netdisco/Worker/Plugin/Show.pm App::Netdisco::Worker::Plugin::Stats: @@ -492,6 +494,7 @@ requires: Dancer::Plugin::Auth::Extensible: '0.30' Dancer::Plugin::DBIC: '0.2001' Dancer::Plugin::Passphrase: v2.0.1 + Dancer::Plugin::Swagger: '0' Dancer::Session::Cookie: '0.27' Data::Printer: '0' Expect: '0' @@ -556,5 +559,5 @@ resources: homepage: http://netdisco.org/ license: http://opensource.org/licenses/BSD-3-Clause repository: https://github.com/netdisco/netdisco -version: '2.041001' +version: '2.042000' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff --git a/bin/netdisco-do b/bin/netdisco-do index 9396f61f..f24da01f 100755 --- a/bin/netdisco-do +++ b/bin/netdisco-do @@ -388,6 +388,11 @@ Set the PoE on/off status on a device port. Requires the C<-d> parameter Will dump the loaded and parsed configuration for the application. Pass a specific configuration setting name to the C<-e> parameter to dump only that. +Some configuration items like device_auth are evaluated against the ACL first. +Pass a device in C<-d> to display them: + + ~/bin/netdisco-do dumpconfig -d 192.0.2.1 -e device_auth + =head1 DEBUG OPTIONS The flag "C<-R>" will cause any changes to the database to be rolled back @@ -416,4 +421,7 @@ L trace enabled =back +In case of issues with the colored output, setting the environment variable +C can be used to suppress it. + =cut diff --git a/lib/App/Netdisco.pm b/lib/App/Netdisco.pm index 71cf175d..58ed9967 100644 --- a/lib/App/Netdisco.pm +++ b/lib/App/Netdisco.pm @@ -4,7 +4,7 @@ use strict; use warnings; use 5.010_000; -our $VERSION = '2.041001'; +our $VERSION = '2.042000'; use App::Netdisco::Configuration; =head1 NAME diff --git a/lib/App/Netdisco/Util/DeviceAuth.pm b/lib/App/Netdisco/Util/DeviceAuth.pm index 31f68472..9c4f4c11 100644 --- a/lib/App/Netdisco/Util/DeviceAuth.pm +++ b/lib/App/Netdisco/Util/DeviceAuth.pm @@ -33,7 +33,7 @@ config changes over time. Returns a list which can replace C. =cut sub fixup_device_auth { - my $config = (setting('snmp_auth') || setting('device_auth')); + my $config = (setting('device_auth') || setting('snmp_auth')); my @new_stanzas = (); # new style snmp config diff --git a/lib/App/Netdisco/Util/Nbtstat.pm b/lib/App/Netdisco/Util/Nbtstat.pm index b0a4478a..6ca6c93b 100644 --- a/lib/App/Netdisco/Util/Nbtstat.pm +++ b/lib/App/Netdisco/Util/Nbtstat.pm @@ -42,7 +42,8 @@ service status for addresses which responded. sub nbtstat_resolve_async { my $ips = shift; - my $timeout = setting('nbtstat_response_timeout') || 1; + my $timeout = (setting('nbtstat_response_timeout') + || setting('nbtstat_timeout') || 1); my $interval = setting('nbtstat_interval') || 0.02; my $stater = App::Netdisco::AnyEvent::Nbtstat->new(