Group
Extension

Matches 35358

App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/AuthN.pm ( view source; MetaCPAN )
th
      or request->path eq uri_for('/logout')->path
      or request->path eq uri_for('/swagger.json')->path
      or index(request->path, uri_for('/swagger-ui')->path) == 0
    );

    # Dancer wil
> {
    'application/json' => { api_key => 'cc9d5c02d8898e5728b7d7a0339c0785' } } },
  },
},
post '/login' => sub {
    my $api = ((request->accept and request->accept =~ m/(?:json|javascript)/) ? tru
n => \'LOCALTIMESTAMP' });

        if ($api) {
            header('Content-Type' => 'application/json');

            # if there's a current valid token then reissue it and reset timer
            $
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web/Plugin/Report/PortVLANMismatch.pm ( view source; MetaCPAN )
 };
    }

    if (request->is_ajax) {
        my $json = to_json (\@results);
        template 'ajax/report/portvlanmismatch.tt', { results => $json }, { layout => 'noop' };
    }
    else {
        
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Util/Web.pm ( view source; MetaCPAN )
est_is_api

Client has requested JSON format data and an endpoint under C</api>.

=cut

sub request_is_api {
  return ((request->accept and request->accept =~ m/(?:json|javascript)/) and (
    index(r
OpenAPI-Modern ( E/ET/ETHER/OpenAPI-Modern-0.107.tar.gz, ETHER, 2025; MetaCPAN )
OpenAPI-Modern/lib/OpenAPI/Modern/Utilities.pm ( view source; MetaCPAN )
uild time via 'update-schemas'

# the main OpenAPI document schema, with permissive (unvalidated) JSON Schemas
use constant DEFAULT_METASCHEMA => {
  3.1 => 'https://spec.openapis.org/oas/3.1/schema/2
ema/2025-09-17',
};

# metaschema for JSON Schemas contained within OpenAPI documents:
# standard JSON Schema (presently draft2020-12) + OpenAPI vocabulary
use constant DEFAULT_DIALECT => {
  3.1 => '
penapis.org/oas/3.2/dialect/2025-09-17',
};

# OpenAPI document schema that forces the use of the JSON Schema dialect (no $schema overrides
# permitted)
use constant DEFAULT_BASE_METASCHEMA => {
  3.1
Cron-Toolkit ( N/NG/NGRAHAM/Cron-Toolkit-0.08.tar.gz, NGRAHAM, 2025; MetaCPAN )
Cron-Toolkit/lib/Cron/Toolkit.pm ( view source; MetaCPAN )
mp_tree >>

Pretty-printed abstract syntax tree (invaluable for debugging).

=item C<< $c->to_json >>

JSON representation of the object (expression, description, bounds, etc.).

=item Accessors

    
map { $self->_rebuild_from_node($_) } @{ $self->{nodes} } );
}

sub to_json {
   my $self = shift;
   return JSON::PP::encode_json(
      {
         expression  => $self->_as_string,
         descript
OpenAPI-Modern ( E/ET/ETHER/OpenAPI-Modern-0.107.tar.gz, ETHER, 2025; MetaCPAN )
OpenAPI-Modern/lib/OpenAPI/Modern.pm ( view source; MetaCPAN )
requests and responses against an OpenAPI v3.1 or v3.2 document
# KEYWORDS: validation evaluation JSON Schema OpenAPI v3.1 v3.2 Swagger HTTP request response

our $VERSION = '0.107';

use 5.020;
use u
at 'indexed';
use Feature::Compat::Try;
use Encode 2.89 ();
use JSON::Schema::Modern;
use JSON::Schema::Modern::Utilities qw(jsonp unjsonp canonical_uri E abort is_equal is_elements_unique true false)
;
use OpenAPI::Modern::Utilities qw(add_vocab_and_default_schemas);
use JSON::Schema::Modern::Document::OpenAPI;
use MooX::TypeTiny 0.002002;
use Types::Standard qw(InstanceOf Bool);
use Mojo::Util qw
WebDyne ( A/AS/ASPEER/WebDyne-2.034.tar.gz, ASPEER, 2025; MetaCPAN )
WebDyne/lib/WebDyne.pm ( view source; MetaCPAN )
a::Dumper::Indent=1;
use HTML::Entities qw(decode_entities encode_entities);
use CGI::Simple;
use JSON;
use Cwd qw(getcwd);


#  Inherit from the Compile module, not loaded until needed though.
#
@ISA
" tags
#
%CGI_TAG_WEBDYNE=map {$_ => 1} (

    'block',
    'perl',
    'subst',
    'dump',
    'json',
    'api',
    'include',
    'htmx'

);


#  Var to hold package wide hash, for data shared ac



    }
    else {


        #  html/text/json must be a param
        #
        my $html_sr=$param_hr->{'html'} || $param_hr->{'text'} || $param_hr->{'json'} ||
            return err('no data suppl
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Configuration.pm ( view source; MetaCPAN )
       push @new_dcf, $field;
        next;
    }

    # snmp_object implies JSON content in the field
    $field->{'json_list'} = true;
    # snmp_object implies user should not edit in the web
   
type => 'exec',
        event => 'discover',
        with => {
                            # get JSON format of the snmp_object
            cmd => (sprintf q![%% ndo %%] show -d '[%% ip %%]' -e %s --
 if type=="string" then [.] else . end | [ .[] ] | sort'!
                            # send the JSON output into device custom_field (action inline)
                            .q! | [%% ndo %%] %s 
WebDyne ( A/AS/ASPEER/WebDyne-2.034.tar.gz, ASPEER, 2025; MetaCPAN )
WebDyne/lib/WebDyne/HTML/TreeBuilder.pm ( view source; MetaCPAN )
rt_multipart_form
        end_multipart_form
        isindex
        dump
        include
        json

));


#  Update - get from CGI module, add special dump tag
#
#%CGI_TAG_IMPLICIT=map {$_ => 1} (
++} qw(
    perl
    script
    style
    start_html
    end_html
    include
    div
    api
    json
    htmx
    table
);


#  Nullify Entities encode & decode
#
*HTML::Entities::encode=sub { };
*H
reate a .psp file with no leading start_html
#
map { $HTML::Tagset::isBodyElement{$_}++ } qw(htmx json dump);


#  And that we also block <p> tag closures
#
push @HTML::Tagset::p_closure_barriers, key
WebDyne ( A/AS/ASPEER/WebDyne-2.034.tar.gz, ASPEER, 2025; MetaCPAN )
WebDyne/lib/WebDyne/Constant.pm ( view source; MetaCPAN )
 As above
    #
    WEBDYNE_CONTENT_TYPE_TEXT => 'text/plain',
    WEBDYNE_CONTENT_TYPE_JSON => 'application/json',
    
    
    #  Script types which are executable so we won't subst strings in them
t mode - recompile loaded modules
    #
    WEBDYNE_RELOAD => 0,


    #  Use JSON canonical mode ?
    #
    WEBDYNE_JSON_CANONICAL => 1,
    
    
    #  Enable the API mode ?
    #
    WEBDYNE_API_
f',
        'css'  => 'text/css',
        'js'   => 'application/javascript',
        'json' => 'application/json',
        'pdf'  => 'application/pdf',
        'svg'  => 'image/svg+xml'
    },
    
 
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Util/CustomFields.pm ( view source; MetaCPAN )
Netdisco::DB::ResultSet::Device;
use App::Netdisco::DB::ResultSet::DevicePort;

my %device_fields_json = ();
my @inline_device_actions = ();
my @inline_device_port_actions = ();

foreach my $config (@
'name'};
  push @inline_device_actions, $config->{'name'};
  ++$device_fields_json{ $config->{'name'} } if $config->{'json_list'};
}

foreach my $config (@{ setting('custom_fields')->{'device_port'} |
    map {( ('cf_'. $_) => \[
              ($device_fields_json{$_} ? q{ARRAY(SELECT json_array_elements_text((me.custom_fields ->> ?) ::json))::text[]}
                                       : 'me.cu
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/SSHCollector/Platform/EOS.pm ( view source; MetaCPAN )
trict;
use warnings;

use Dancer ':script';
use Moo;
use NetAddr::MAC qw/mac_as_ieee/;
use JSON qw(decode_json);

=head1 PUBLIC METHODS

=over 4

=item B<arpnip($host, $ssh)>

Retrieve ARP entries fro
md_v4 = "show ip arp vrf all | json | no-more\n";
    my @out_v4 = $ssh->capture({ stdin_data => $cmd_v4 });
    if (!$ssh->error) {
        my $data = eval { decode_json(join '', @out_v4) };
        
 "show ipv6 neighbor vrf all | json | no-more\n";
    my @out_v6 = $ssh->capture({ stdin_data => $cmd_v6 });
    if (!$ssh->error) {
        my $data = eval { decode_json(join '', @out_v6) };
        
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Util/Worker.pm ( view source; MetaCPAN )
      event_data  => dclone (vars->{'hook_data'} || {}) };

  # remove scalar references which to_json cannot handle
  visit( $extra->{'event_data'}, sub {
    my ($key, $valueref) = @_;
    $$valuere
' if ref $$valueref eq 'SCALAR';
  });

  jq_insert({
    action => ('hook::'. lc($conf->{'type'})),
    extra  => encode_base64( encode('UTF-8', to_json( $extra )), '' ),
  });

  return 1;
}

true;
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Util/Permission.pm ( view source; MetaCPAN )
      $cf = from_json ($item->custom_fields || '{}');
              }
              elsif (ref {} eq ref $item and exists $item->{'custom_fields'}) {
                  $cf = from_json ($item->{'custom
$cf = from_json ($item->custom_fields || '{}');
                  }
                  elsif (ref {} eq ref $item and exists $item->{'custom_fields'}) {
                      $cf = from_json ($item->{'
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Web.pm ( view source; MetaCPAN )
e->headers('Location' => $destination);
  };

  # neater than using Dancer::Plugin::Res to handle JSON differently
  *Dancer::send_error = sub {
      my ($body, $status) = @_;
      if (request_is_ap
efined $body;
        Dancer::Continuation::Route::ErrorSent->new(
            return_value => to_json { error => $body, return_url => param('return_url') }
        )->throw;
      }
      Dancer::Con
ta structure for DataTables records per page menu
    $tokens->{table_showrecordsmenu} =
      to_json( setting('table_showrecordsmenu') );

    # linked searches will use these default url path param
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Util/SNMP.pm ( view source; MetaCPAN )
pec::Functions qw/splitdir catdir catfile/;
use MIME::Base64 'decode_base64';
use SNMP::Info;
use JSON::PP ();

use base 'Exporter';
our @EXPORT = ();
our @EXPORT_OK = qw/
  get_communities
  snmp_com
 Base64 encoded,
decodes it and then munge to handle data format, before finally pretty
render in JSON format.

=cut

sub get_code_info { return ($_[0]) =~ m/^(.+)::(.*?)$/ }
sub sub_name      { retur
ength $encoded;

    my $json = JSON::PP->new->utf8->pretty->allow_nonref->allow_unknown->canonical;
    $json->sort_by( sub { sortable_oid($JSON::PP::a) cmp sortable_oid($JSON::PP::b) } );

    retur
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Util/Snapshot.pm ( view source; MetaCPAN )
search({ -or => [
        -bool => \q{ array_length(oid_parts, 1) IS NULL },
        -bool => \q{ jsonb_typeof(value) != 'array' }, ] })->count) {

      my @rows = $device->oids->search({},{
        
],
      })->hri->all;

      $oids{$_->{oid}} = {
          %{ $_ },
          value => (@{ from_json($_->{value}) })[0],
      } for @rows;
  }
  # or we have an snmpwalk file on disk
  elsif (-f $
     => $oid,
            oid_parts => [], # not needed temporarily 
            value     => to_json([ ((defined $type and $type eq 'BASE64') ? $value
                                               
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/DB/Result.pm ( view source; MetaCPAN )
ToJSON});

  # this replacement will avoid the issue of relation names which override
  # field names, causing TO_JSON to return object instances, breaking to_json
  *DBIx::Class::Helper::Row::ToJSON:
:TO_JSON = sub {
      my $self = shift;
      my $columns_info = $self->columns_info($self->serializable_columns);
      my $columns_data = { $self->get_columns };
      return {
         map +($_ =>
 $columns_data->{$_}), keys %$columns_info
      };
  };
}

# for DBIx::Class::Helper::Row::ToJSON
# to allow text columns to be included in results

sub unserializable_data_types {
   return {
      
App-Netdisco ( O/OL/OLIVER/App-Netdisco-2.095004.tar.gz, OLIVER, 2025; MetaCPAN )
App-Netdisco/lib/App/Netdisco/Util/DeviceAuth.pm ( view source; MetaCPAN )
}
          else {
            my $stanza = undef;
            try {
              $stanza = from_json( $line );
              debug sprintf '[%s] external credentials stanza added',
                $
Dist-Build ( L/LE/LEONT/Dist-Build-0.021.tar.gz, LEONT, 2025; MetaCPAN )
Dist-Build/lib/Dist/Build.pm ( view source; MetaCPAN )
::Serializer;

my $json_backend = Parse::CPAN::Meta->json_backend;
my $json = $json_backend->new->canonical->pretty->utf8;
my $serializer = 'Dist::Build::Serializer';

sub load_json {
	my $filename = 
nt = do { local $/; <$fh> };
	return $json->decode($content);
}

sub save_json {
	my ($filename, $content) = @_;
	open my $fh, '>:raw', $filename;
	print $fh $json->encode($content);
	return;
}

my @o
turn %options;
}

sub Build_PL {
	my ($args, $env) = @_;

	my $meta = CPAN::Meta->load_file('META.json', { lazy_validation => 0 });

	my @env = defined $env->{PERL_MB_OPT} ? split_like_shell($env->{PE

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.