Result:
found more than 553 distributions - search limited to the first 2001 files matching your query ( run in 2.839 )


DBIx-Safe

 view release on metacpan or  search on metacpan

Safe.pm  view on Meta::CPAN

# -*-cperl-*-
#
# Copyright 2006-2007 Greg Sabino Mullane <greg@endpoint.com>
#
# DBIx::Safe is a safer way of handling database connections.
# You can specify exactly which commands can be run.
#

Safe.pm  view on Meta::CPAN


Bugs should be reported to the author or bucardo-general@bucardo.org.

=head1 AUTHOR

Greg Sabino Mullane <greg@endpoint.com>

=head1 LICENSE AND COPYRIGHT

Copyright 2006-2007 Greg Sabino Mullane <greg@endpoint.com>.

This software is free to use: see the LICENSE file for details.

=cut

 view all matches for this distribution


DDG

 view release on metacpan or  search on metacpan

lib/DDG/Rewrite.pm  view on Meta::CPAN

		# https://github.com/agentzh/echo-nginx-module/issues/30
		$cfg .= "\tproxy_set_header Accept-Encoding '';\n";
	}

	if($uses_echo_module || $content_type_javascript) {
		# This is a workaround that deals with endpoints that don't support callback functions.
		# So endpoints that don't support callback functions return a content-type of 'application/json'
		# because what they're returning is not meant to be executed in the first place.
		# Setting content-type to application/javascript for those endpoints solves blocking due to
		# mime type mismatches.
		$cfg .= "\tmore_set_headers 'Content-Type: application/javascript; charset=utf-8';\n";
	}

	$cfg .= "\techo_before_body '$callback(';\n" if $wrap_jsonp_callback;

lib/DDG/Rewrite.pm  view on Meta::CPAN

	$cfg .= "\tproxy_ssl_server_name on;\n" if $scheme =~ /https/;

	if($self->has_proxy_cache_valid) {
		# This tells Nginx how long the response should be kept.
		$cfg .= "\tproxy_cache_valid " . $self->proxy_cache_valid . ";\n";
		# Some response headers from the endpoint can affect `proxy_cache_valid` so we ignore them.
		# http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_headers
		$cfg .= "\tproxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie;\n";
	}

	$cfg .= "\tproxy_ssl_session_reuse ".$self->proxy_ssl_session_reuse.";\n" if $self->has_proxy_ssl_session_reuse;
	$cfg .= "\techo_after_body ');';\n" if $wrap_jsonp_callback;
	$cfg .= "\techo_after_body '\");';\n" if $wrap_string_callback;

	# proxy_intercept_errors is used to handle endpoints that don't return 200 OK
	# When we get errors from the endpoint, instead of replying a blank page, it should reply the function instead with no parameters,
	# e.g., ddg_spice_dictionary_definition();. The benefit of doing that is that we know for sure that the Spice failed, and we can do
	# something about it (we know that the Spice failed because it should return Spice.failed('...') when the parameters are not valid).
	if($callback) {
		$cfg .= "\tproxy_intercept_errors on;\n";
		if ($self->error_fallback) {

 view all matches for this distribution


DJabberd-Plugin-Balancer

 view release on metacpan or  search on metacpan

lib/DJabberd/Plugin/Balancer.pm  view on Meta::CPAN

several clients.

Every time a client binds to a resource, this plugin will record that
trial and return a different resource, including a sufix in the #999
format. The original JID will be saved as a load balancing
endpoint. Other clients then can try to bind to the same resource, and
will also be assigned different JIDs, but all that will be recorded.

If some client, on the other hand, tries to bind to the resource of
another real client (already with the #999 sufix), the bind will be
denied.

When a message arrives for the load-balancing-endpoint JID, it will be
dispatched randomly through all the clients that tried to bind to that
resource.

Messages to the real JIDs will be delivered normally, iq stanzas will
work as expected, since when sending that, the client will send using

 view all matches for this distribution


DJabberd

 view release on metacpan or  search on metacpan

lib/DJabberd/Connection/ComponentOut.pm  view on Meta::CPAN

);

sub new {
    my ($class, %opts) = @_;
    
    my $endpoint = delete($opts{endpoint}) or $logger->logdie("No endpoint specified");
    my $vhost = delete($opts{vhost}) or $logger->logdie("No vhost specified");
    my $secret = delete($opts{secret}) || ""; # FIXME: The secret can't currently be the number 0 :)
    $logger->logdie("Invalid options ".join(',',keys %opts)) if %opts;
    
    $logger->warning("No shared secret specified for component connection in $vhost") unless $secret;
    
    my $server = $vhost->server;

    $logger->debug("Making a $class connecting to ".$endpoint->addr.":".$endpoint->port);
    
    my $sock;
    socket $sock, PF_INET, SOCK_STREAM, IPPROTO_TCP;
    unless ($sock && defined fileno($sock)) {
        $logger->logdie("Failed to allocate socket");
        return;
    }
    IO::Handle::blocking($sock, 0) or $logger->logdie("Failed to make socket non-blocking");
    connect $sock, Socket::sockaddr_in($endpoint->port, Socket::inet_aton($endpoint->addr));
    
    my $self = $class->SUPER::new($sock, $server);
    $self->watch_write(1);

    $self->set_vhost($vhost);

 view all matches for this distribution


DNS-Hetzner

 view release on metacpan or  search on metacpan

lib/DNS/Hetzner/API/PrimaryServers.pm  view on Meta::CPAN


with 'MooX::Singleton';

use DNS::Hetzner::Schema;

has endpoint  => ( is => 'ro', isa => Str, default => sub { 'primary_servers' } );

sub list ($self, %params) {
    return $self->_do( 'GetPrimaryServers', \%params, '', { type => 'get' } );
}

lib/DNS/Hetzner/API/PrimaryServers.pm  view on Meta::CPAN


=head1 ATTRIBUTES

=over 4

=item * endpoint

=back

=head1 METHODS

 view all matches for this distribution


DNS-NIOS

 view release on metacpan or  search on metacpan

lib/DNS/NIOS.pm  view on Meta::CPAN

Perl bindings for L<https://www.infoblox.com/company/why-infoblox/nios-platform/>

=head2 Normal usage

Normally, you will add some traits to the client, primarily L<DNS::NIOS::Traits::ApiMethods>
since it provides methods for some endpoints.

=head2 Minimal usage

Without any traits, DNS::NIOS provides access to all API endpoints using the methods described below.

=head1 CONSTRUCTOR

=for Pod::Coverage BUILD

 view all matches for this distribution


DNS-PunyDNS

 view release on metacpan or  search on metacpan

lib/DNS/PunyDNS.pm  view on Meta::CPAN

    }
    return \@domains;
}

sub _build_request {
    my ( $self, $endpoint, $args ) = @_;
    $args->{'ESBUsername'} = $self->{'username'};
    $args->{'ESBPassword'} = $self->{'password'};
    $args->{'lang'}        = 'en';
    my @keys = keys %{$args};

    my $url = $BASE_URL . $endpoint . '?' . join( '&', map { $_ . '=' . $args->{$_} } @keys );

    return $url;
}

sub _get_it {
    my ( $self, $endpoint, $args ) = @_;

    my $url = $self->_build_request( $endpoint, $args );
    delete $self->{'error'};

    my $ua       = new LWP::UserAgent();
    my $req      = new HTTP::Request( 'GET', $url );
    my $response = $ua->request($req);

 view all matches for this distribution


DOCSIS-ConfigFile

 view release on metacpan or  search on metacpan

lib/DOCSIS/ConfigFile/mibs/PKTC-EVENT-MIB  view on Meta::CPAN

    pktcDevEvEndpointName	 OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
            "This is the endpoint identifier followed by the FQDN/IP Address
             of the device. This is in the form - AALN/X:FQDN/IP Address.
             If the event is not specific to an endpoint, then the contents
             is just the FQDN/IP address."
    ::= { pktcDevEventEntry 8 }

--
--	Event Data for Traps - Informs

lib/DOCSIS/ConfigFile/mibs/PKTC-EVENT-MIB  view on Meta::CPAN

    pktcDevEvReportEndpointName	 OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
          "This is the endpoint identifier followed by the FQDN/IP Address of the
           device. in the case of the , this is in the form - AALN/X:FQDN/IP
           Address. If the event is not specific to an endpoint, then the contents
           is just the FQDN/IP address"
    ::= { pktcDevEventNotify 8 }

   pktcDevEvInform NOTIFICATION-TYPE
	OBJECTS { pktcDevEvReportIndex, pktcDevEvReportTime,pktcDevEvReportLevel,

 view all matches for this distribution


Daioikachan-Client

 view release on metacpan or  search on metacpan

lib/Daioikachan/Client.pm  view on Meta::CPAN

        timeout => 10,
        defined $args->{ua_options} ? %{$args->{ua_options}} : (),
    );

    my $default_channel = (defined $args->{default_channel} && ($args->{default_channel} ne '')) ? $args->{default_channel} : '#notify';
    my $endpoint = (defined $args->{endpoint} && ($args->{endpoint} ne '')) ? $args->{endpoint} : die 'Undefined endpoint';

    my $headers = $args->{headers};

    return bless {
        ua              => $ua,
        headers         => $headers,
        default_channel => $default_channel,
        endpoint        => $endpoint,
    }, $class;
}

sub notice {
    my ($self, $args) = @_;

lib/Daioikachan/Client.pm  view on Meta::CPAN

    my ($self, $args) = @_;

    my $channel = (defined $args->{channel} && ($args->{channel} ne '')) ? $args->{channel} : $self->{default_channel};

    return $self->{ua}->post(
        $self->{endpoint} . $args->{type},
        $self->{headers},
        {
            channel => $channel,
            message => $args->{message},
        },

lib/Daioikachan/Client.pm  view on Meta::CPAN

=head1 SYNOPSIS

    use Daioikachan::Client;

    my $client = Daioikachan::Client->new({
        endpoint => 'http://daioikachan_endpoint.example.com/',
    });

    # Send message to Daioikachan.
    $client->notice({ message => 'foo' });

lib/Daioikachan/Client.pm  view on Meta::CPAN


I<$args>:

=over

=item endpoint :Str

Endpoint of Daioikachan server.
You must specify a this parameter.

=item default_channel :Str = #notify

 view all matches for this distribution


Daje-Generate

 view release on metacpan or  search on metacpan

lib/Daje/Generate/Perl/CreateSchema.pm  view on Meta::CPAN


    method build_view_methods($view, $column_names) {

        my $methods->{table_name} = $view->{table_name};
        $methods->{keys} = $self->_get_keys($column_names);
        $methods->{create_endpoint} = 1;
        my $method = $self->get_view_list($view->{table_name},$column_names);
        push @{$methods->{methods}}, $method ;

        return $methods;
    }

 view all matches for this distribution


Daje-Plugin-GenerateSchema

 view release on metacpan or  search on metacpan

lib/Daje/Plugin/Schema/Create.pm  view on Meta::CPAN


sub build_view_methods($self, $view, $column_names) {

    my $methods->{table_name} = $view->{table_name};
    $methods->{keys} = $self->_get_keys($column_names);
    $methods->{create_endpoint} = 1;
    my $method = $self->get_view_list($view->{table_name},$column_names);
    push @{$methods->{methods}}, $method ;

    return $methods;
}

 view all matches for this distribution


Daje-Workflow-GenerateSchema-Activity

 view release on metacpan or  search on metacpan

lib/Daje/Workflow/GenerateSchema/Create/Schema.pm  view on Meta::CPAN


sub build_view_methods($self, $view, $column_names) {

    my $methods->{table_name} = $view->{table_name};
    $methods->{keys} = $self->_get_keys($column_names);
    $methods->{create_endpoint} = 1;
    my $method = $self->get_view_list($view->{table_name},$column_names);
    push @{$methods->{methods}}, $method ;

    return $methods;
}

 view all matches for this distribution


Dallycot

 view release on metacpan or  search on metacpan

lib/Dallycot/Parser.pm  view on Meta::CPAN

  return bless [$expression] => 'Dallycot::AST::Defined';
}

##
# Eventually, Range will be a type representing all values between
# two endpoints.
#
# Q: how to indicate open/closed endpoints
#
# ( e1 .. e2 )
# [ e1 .. e2 )
# ( e1 .. e2 ]
# [ e1 .. e2 ]

 view all matches for this distribution


Dancer-Plugin-Auth-Facebook

 view release on metacpan or  search on metacpan

lib/Dancer/Plugin/Auth/Facebook.pm  view on Meta::CPAN

The authenticated user information will be available as a hash reference under
C<session('fb_user')>. You should probably associate the C<id> field to that
user, so you know which of your users just completed the login.

The information under C<fb_user> is returned by the current user's basic
endpoint, known on Facebook's API as C</me>. You should note that Facebook
has a habit of changing which fields are returned on that endpoint. To force
any particular fields, please use the C<fields> setting in your plugin
configuration as shown below.

Please refer to L<< Facebook's documentation | https://developers.facebook.com/docs/graph-api/reference/v4.0/user >>
for all available data.

 view all matches for this distribution


Dancer-Plugin-Auth-Google

 view release on metacpan or  search on metacpan

lib/Dancer/Plugin/Auth/Google.pm  view on Meta::CPAN

=head4 NOTE: G+ is no more. Add 'legacy_gplus: 1' to keep old code running.

Up to version 0.06 of this module the C<< session('google_user') >>
data structure was as returned by Google Plus' API. Google decided to
discontinue G+ and its API on March 7th 2019, so since version 0.07
we fetch user information from Google's C<oauth2/v2/userinfo> endpoint.

Those two structures are very different, so
B<you will need to update your code> if you used any version of this module
prior to 0.07. If you don't want to, add the C<legacy_gplus> option to
your configuration with a true value and C<< session('google_user') >>

 view all matches for this distribution


Dancer-Plugin-Facebook

 view release on metacpan or  search on metacpan

t/application.t  view on Meta::CPAN

    get '/perl' => sub { fb->fetch ('16665510298')->{name} };
    setup_fb;
    1;
}

route_exists       [GET => '/perl'], "GET /perl endpoint exists";
route_doesnt_exist [GET => '/auth/facebook'], "GET /auth/facebook endpoint does not exist";
route_doesnt_exist [GET => '/auth/facebook/postback'], "GET /auth/facebook/postback endpoint does not exist";

my $response = dancer_response GET => '/perl';
debug "Response is ", $response;
is $response->status, 200, "GET /perl succeeded";
like $response->content, qr,perl,, "GET /perl produced expected output";

 view all matches for this distribution


Dancer-Plugin-RESTModel

 view release on metacpan or  search on metacpan

lib/Dancer/Plugin/RESTModel.pm  view on Meta::CPAN

Dancer::Plugin::RESTModel - REST model class for Dancer apps


=head1 SYNOPSIS

set the REST endpoint in your Dancer configuration file:

    plugins:
      RESTModel:
        MyData:
          server: http://localhost:5000

 view all matches for this distribution


Dancer-Plugin-RPC-RESTISH

 view release on metacpan or  search on metacpan

example/lib/Example.pm  view on Meta::CPAN

            arguments => ['Example::API::System'],
        },
    );
    my @plugins = grep { /^RPC::/ } keys %{ config->{plugins} };
    for my $plugin (@plugins) {
        $system_config->register_endpoint($plugin, '/system');
    }
}

{
    my $db_config = Example::EndpointConfig->new(

example/lib/Example.pm  view on Meta::CPAN

        bread_board => $db_api,
    );
    my @plugins = grep { /^RPC::/ } keys %{ config->{plugins} };
    for my $plugin (@plugins) {
        for my $path (keys %{ config->{plugins}{$plugin} }) {
            $db_config->register_endpoint($plugin, $path);
        }
    }
}

1;

 view all matches for this distribution


Dancer-Plugin-RPC

 view release on metacpan or  search on metacpan

example/lib/Client/MetaCpan.pm  view on Meta::CPAN

    my ($query) = @_;

    $query =~ s{::}{-}g;
    my $params = $http->www_form_urlencode("q=$query");

    (my $endpoint = $self->base_uri->as_string) =~ s{/+$}{};
    my $response = $self->client->get("$endpoint/?$params");

    my $content = eval { decode_json($response->{content}) };
    return $content if !$@;
    return { error => $@, data => $response->{content} };
}

 view all matches for this distribution


Dancer-Plugin-Resource

 view release on metacpan or  search on metacpan

lib/Dancer/Plugin/Resource.pm  view on Meta::CPAN

        $params = ":${singular_resource}_id";
    }

    my ($package) = caller;

    # main resource endpoints
    # CRUD
    _post(
        _endpoint(
            path     => $plural_resource,
            params   => '',
            verbs    => [qw/POST create/],
            function => $singular_resource
        )
    );

    _get(
        _endpoint(
            path     => $plural_resource,
            params   => $params,
            verbs    => [qw/GET get read/],
            loader   => $options{load},
            function => $singular_resource
        )
    );

    _put(
        _endpoint(
            path     => $plural_resource,
            params   => $params,
            verbs    => [qw/PUT update/],
            loader   => $options{load},
            function => $singular_resource
        )
    );

    _del(
        _endpoint(
            path     => $plural_resource,
            params   => $params,
            verbs    => [qw/DELETE delete/],
            loader   => $options{load},
            function => $singular_resource
        )
    );

    _get(
        _endpoint(
            path     => $plural_resource,
            params   => '',
            verbs    => [qw/INDEX index/],
            loader   => $options{load_all},
            function => $singular_resource

lib/Dancer/Plugin/Resource.pm  view on Meta::CPAN

    for my $member (@{$options{member}}) {
        my $path = "${plural_resource}/$params/${member}";
        my $member_param = "";

        _post(
            _endpoint(
                path     => $path,
                params   => '',
                verbs    => [qw/POST create/],
                loader   => $options{load},
                function => "${singular_resource}_${member}"
            )
        );

        _get(
            _endpoint(
                path     => $path,
                params   => $member_param,
                verbs    => [qw/GET get read/],
                loader   => $options{load},
                function => "${singular_resource}_${member}"

            )
        );

        _put(
            _endpoint(
                path     => $path,
                params   => $member_param,
                verbs    => [qw/PUT update/],
                loader   => $options{load},
                function => "${singular_resource}_${member}"

            )
        );

        _del(
            _endpoint(
                path     => $path,
                params   => $member_param,
                verbs    => [qw/DELETE delete/],
                loader   => $options{load},
                function => "${singular_resource}_${member}"

lib/Dancer/Plugin/Resource.pm  view on Meta::CPAN

    # collection routes are actions on the collection. ie /users/foo
    for my $collection (@{$options{collection}}) {
        my $path = "${plural_resource}/${collection}";

        _post(
            _endpoint(
                path     => $path,
                params   => '',
                verbs    => [qw/POST create/],
                loader   => $options{load_all},
                function => "${plural_resource}_${collection}"
            )
        );

        _get(
            _endpoint(
                path     => $path,
                params   => '',
                verbs    => [qw/GET get read/],
                loader   => $options{load_all},
                function => "${plural_resource}_${collection}"
            )
        );

        _put(
            _endpoint(
                path     => $path,
                params   => '',
                verbs    => [qw/PUT update/],
                loader   => $options{load_all},
                function => "${plural_resource}_${collection}"
            )
        );

        _del(
            _endpoint(
                path     => $path,
                params   => '',
                verbs    => [qw/DELETE delete/],
                loader   => $options{load_all},
                function => "${plural_resource}_${collection}"

lib/Dancer/Plugin/Resource.pm  view on Meta::CPAN

        _debug("=> DEL " .(Dancer::App->current->prefix||'').$_."\n");
        del($_ => $sub);
    }
}

sub _endpoint {
    my %opts = @_;
    my ($function, $word, $params, $verbs, $load_func) = @opts{qw/function path params verbs loader/};

    my $package = caller(1);

 view all matches for this distribution


Dancer-SearchApp

 view release on metacpan or  search on metacpan

t/documents/timetable.yapce2016.ics  view on Meta::CPAN

ATTENDEE:Juan Camacho
ATTENDEE:Mark Stringer
ATTENDEE:Virgil Dinu
ATTENDEE:José Joaquín Atria
COMMENT:47 attendees
DESCRIPTION:A dissection of a rather simple API endpoint.\n\nSome likely to
 pics:\n- NoFramework is the new NoSQL\n- Fat Models\n- Bearer Tokens\, JWT
 s & true stateless APIs\n- Postgres Common Table Expressions and window fu
 nctions
DTEND;TZID=Europe/Bucharest:20160824T170500
DTSTART;TZID=Europe/Bucharest:20160824T163500
LOCATION:Amfiteatrul Mircea Dorofteiu\, 1st floor
ORGANIZER:Thomas Klausner
SUMMARY:How to write an API endpoint in 2016
UID:http://act.yapc.eu/ye2016/talk/6714
URL:http://act.yapc.eu/ye2016/talk/6714
END:VEVENT
BEGIN:VEVENT
ATTENDEE:Jean Forget

t/documents/timetable.yapce2016.ics  view on Meta::CPAN

ATTENDEE:Virgil Dinu
ATTENDEE:José Joaquín Atria
COMMENT:40 attendees
DESCRIPTION:Swagger is a specification of a REST API.\nIt is now the base o
 f the Open API Initiative supported by a number of companies\n\nWhat *you*
  have to do:\n* Understand the spec and specify all your API endpoints (pa
 rameters\, input and output schema)\n* Each item of the spec can have a "d
 escription"\n\nWhat does it give you in return:\n* The spec and your descr
 iptions are the public documentation - no need to seperately administrate 
 docs that possibly get out of date\n* A nice javascript frontend for manua
 l testing\, with OAuth2 support\n* A plugin for your web framework (*)\, w

 view all matches for this distribution


Dancer2-Plugin-Github-Webhook

 view release on metacpan or  search on metacpan

t/01-base.t  view on Meta::CPAN

    use Dancer2::Plugin::Github::Webhook;

    set serializer => 'JSON';

    post '/' => require_github_webhook_secret sub { [1] };
    post '/a' => require_github_webhook_secret config->{'github-webhooks'}->{endpoint_a} => sub { [1] };
    post '/b' => require_github_webhook_secret config->{'github-webhooks'}->{endpoint_b} => sub { [1] };
    post '/c' => require_github_webhook_secret 'anotherverysecretsecret'                 => sub { [1] };

}

my $app = MyTestApp->to_app;

t/01-base.t  view on Meta::CPAN

        is $res->code, 200, 'Correct signature is accepted';
        ok JSON::from_json( $res->content )->[0] eq '1', 'Correct signature is accepted';
    }

    {
        # correct signature, other endpoint
        
        my $content = JSON::to_json( { some => 'other', content => [qw/here in this array/] } );
        require Digest::SHA;
        my $signature = 'sha1=' . Digest::SHA::hmac_sha1_hex( $content, 'sk78fozuhv3efgv' );
        my $req = HTTP::Request->new( POST => '/a' => [ 'X-Hub-Signature' => $signature ], $content );

 view all matches for this distribution


Dancer2-Plugin-GraphQL

 view release on metacpan or  search on metacpan

lib/Dancer2/Plugin/GraphQL.pm  view on Meta::CPAN

  };

=head1 DESCRIPTION

The C<graphql> keyword which is exported by this plugin allow you to
define a route handler implementing a GraphQL endpoint.

Parameters, after the route pattern.
The first three can be replaced with a single array-ref. If so,
the first element is a classname-part, which will be prepended with
"L<GraphQL::Plugin::Convert>::". The other values will be passed to

 view all matches for this distribution


Dancer2-Plugin-Menu

 view release on metacpan or  search on metacpan

lib/Dancer2/Plugin/Menu.pm  view on Meta::CPAN

=head2 KEYWORDS

=head3 menu_item( { [title => $str], [weight => $num] }, C<ROUTE METHOD> C<REGEXP>, C<CODE>)

Wraps a conventional route handler preceded by a required hash reference
containing data that will be applied to the route's endpoint.

Two keys can be supplied in the hash reference: a C<title> for the menu item and
a C<weight>. The C<title> will be used as the content for the menu items. The
C<weight> will determine the order of the menu items. Heavier items (with larger
values) will "sink" to the bottom compared to sibling menu items. If two sibling
menu items have the same weight, the menu items will be ordered alphabetically.

Menu items that are not endpoints in the route or that don't have a C<title>,
will automatically generate a title according to the path segment's name. For
example, the route C</categories/fun food/desserts> is converted to a hierarchy
of menu items entitled C<Categories>, C<Fun food>, and C<Desserts>. Note that
capitalization is automatically added.  Automatic titles will be overridden with
endpoint specific titles if they are supplied in a later C<menu_item> call.

If the C<weight> is not supplied it will default to a value of C<5>.

=head1 CONFIGURATION

 view all matches for this distribution


Dancer2-Plugin-OIDC

 view release on metacpan or  search on metacpan

t/auth-code-flow-IT/MyProviderApp.pl  view on Meta::CPAN


# provider server routes
get('/wellknown' => sub {
  my $c = shift;
  my %url = (
    authorization_endpoint => '/authorize',
    end_session_endpoint   => '/logout',
    token_endpoint         => '/token',
    userinfo_endpoint      => '/userinfo',
    jwks_uri               => '/jwks',
  );
  $c->render(json => {map { $_ => $url{$_} } keys %url});
});
get('/jwks' => sub {

 view all matches for this distribution


Dancer2-Plugin-PrometheusTiny

 view release on metacpan or  search on metacpan

lib/Dancer2/Plugin/PrometheusTiny.pm  view on Meta::CPAN

    };
}

# CONFIG

has endpoint => (
    is          => 'ro',
    isa         => Str,
    from_config => sub {'/metrics'},
);

lib/Dancer2/Plugin/PrometheusTiny.pm  view on Meta::CPAN

        );
    }

    $app->add_route(
        method => 'get',
        regexp => $plugin->endpoint,
        code   => sub {
            my $app = shift;
            $plugin->execute_plugin_hook(
                'before_format', $app,
                $prometheus

lib/Dancer2/Plugin/PrometheusTiny.pm  view on Meta::CPAN

=head1 DESCRIPTION

This plugin integrates L<Prometheus::Tiny::Shared> with your L<Dancer2> app,
providing some default metrics for requests and responses, with the ability
to easily add further metrics to your app. A route is added which makes
the metrics available via the configured L</endpoint>.

See L<Prometheus::Tiny> for more details of the kind of metrics supported.

The following metrics are included by default:

lib/Dancer2/Plugin/PrometheusTiny.pm  view on Meta::CPAN


Example:

    plugins:
      PrometheusTiny:
        endpoint: /prometheus-metrics   # default: /metrics
        filename: /run/d2prometheus     # default: (undef)
        include_default_metrics: 0      # default: 1
        metrics:                        # default: {}
          http_request_count:
            help: HTTP Request count
            type: counter
        
See below for full details of each configuration setting.

=head2 endpoint

The endpoint from which metrics are served. Defaults to C</metrics>.

=head2 filename

It is recommended that this is set to a directory on a memory-backed
filesystem. See L<Prometheus::Tiny::Shared/filename> for details and default

 view all matches for this distribution


Dancer2-Plugin-RPC-RESTISH

 view release on metacpan or  search on metacpan

example/lib/Example.pm  view on Meta::CPAN

            arguments => ['Example::API::System'],
        },
    );
    my @plugins = grep { /^RPC::/ } keys %{ config->{plugins} };
    for my $plugin (@plugins) {
        $system_config->register_endpoint($plugin, '/system');
    }
}

{
    my $db_config = Example::EndpointConfig->new(

example/lib/Example.pm  view on Meta::CPAN

        }
    );
    my @plugins = grep { /^RPC::/ } keys %{ config->{plugins} };
    for my $plugin (@plugins) {
        for my $path (keys %{ config->{plugins}{$plugin} }) {
            $db_config->register_endpoint($plugin, $path);
        }
    }
}

1;

 view all matches for this distribution


Dancer2-Plugin-RPC

 view release on metacpan or  search on metacpan

ex/MixedEndpoints.pm  view on Meta::CPAN

use warnings;
use strict;

=head1 DESCRIPTION

Package with calls for diffent endpoints.

=head2 call_for_system

=for xmlrpc system.call call_for_system /system

ex/MixedEndpoints.pm  view on Meta::CPAN


=for restrpc call call_for_system /system

=cut

sub call_for_system { return {endpoint => '/system'} }

=head2 call_for_testing

=for xmlrpc testing.call call_for_testing /testing

ex/MixedEndpoints.pm  view on Meta::CPAN


=for restrpc call call_for_testing /testing

=cut

sub call_for_testing { return {endpoint => '/testing'} }


=head2 call_for_all_endpoints

=for xmlrpc any.call call_for_all_endpoints

=for jsonrpc any_call call_for_all_endpoints

=for restrpc any-call call_for_all_endpoints

=cut

sub call_for_all_endpoints { return {endpoint => '*'} }

1;

 view all matches for this distribution


Dancer2-Plugin-SPID

 view release on metacpan or  search on metacpan

example/app.pl  view on Meta::CPAN


# That's it. Seriously, that's all you need.
# Below you'll see how to customize the behavior further by configuring one or
# more hooks that the SPID plugin will call.

# This hook is called when the login endpoint is called and the AuthnRequest
# is about to be crafted.
hook 'plugin.SPID.before_login' => sub {
    # ...
};

example/app.pl  view on Meta::CPAN

hook 'plugin.SPID.after_failed_login' => sub {
    my $statuscode = shift;
    info "SPID login failed: $statuscode";
};

# This hook is called when the logout endpoint is called and the LogoutRequest
# is about to be crafted.
hook 'plugin.SPID.before_logout' => sub {
    debug "User " . spid_session->nameid . " is about to logout";
};

# This hook is called when a SPID session is terminated (this might be triggered
# also when user initiated logout from another Service Provider or directly
# within the Identity Provider, thus without calling our logout endpoint and
# the 'before_logout' hook).
hook 'plugin.SPID.after_logout' => sub {
    my $success = shift;  # 'success' or 'partial'
    debug "User " . spid_session->nameid . " logged out";
};

 view all matches for this distribution


Dancer2

 view release on metacpan or  search on metacpan

lib/Dancer2/Manual/Cookbook.pod  view on Meta::CPAN

will be serialized and deserialized. This is how the feature works.

As suggested above, if you would like to have both, you need to create
another application which will not be serialized.

A common usage for this is an API providing serialized endpoints (and
receiving serialized requests) and providing rendered pages.

     # MyApp.pm
     package MyApp;
     use Dancer2;

 view all matches for this distribution


( run in 2.839 seconds using v1.01-cache-2.11-cpan-55a6197bec7 )