view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/MySQLViewerLite/Base/Mysqlviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $tables = $command->show_tables($database);
return $self->render(
database => $database,
lib/Mojolicious/Plugin/MySQLViewerLite/Base/Mysqlviewerlite.pm view on Meta::CPAN
],
table => {default => ''} => [
'safety_name'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $table = $vresult->data->{table};
my $table_def = $command->show_create_table($database, $table);
lib/Mojolicious/Plugin/MySQLViewerLite/Base/Mysqlviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $tables = $command->show_tables($database);
# Get create tables
my $create_tables = {};
lib/Mojolicious/Plugin/MySQLViewerLite/Base/Mysqlviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $tables = $command->show_tables($database);
$self->render(
database => $database,
lib/Mojolicious/Plugin/MySQLViewerLite/Base/Mysqlviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
],
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
# Get primary keys
my $primary_keys = $command->show_primary_keys($database);
lib/Mojolicious/Plugin/MySQLViewerLite/Base/Mysqlviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
],
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
# Get null allowed columns
my $null_allowed_columns = $command->show_null_allowed_columns($database);
lib/Mojolicious/Plugin/MySQLViewerLite/Base/Mysqlviewerlite.pm view on Meta::CPAN
],
condition_value => [
'not_blank'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $table = $vresult->data->{table};
# Where
my $column = $vresult->data->{condition_column};
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Notifications/Alertify.pm view on Meta::CPAN
In case an C<ok_label> is passed, this will be the label
for the confirmation button.
In case a C<cancel_label> is passed, this will be the label
for the cancelation button.
The POST will have a L<csrf_token|Mojolicious::Plugin::TagHelpers/csrf_token>
parameter to validate.
B<Confirmation is EXPERIMENTAL!>
=head2 notifications
lib/Mojolicious/Plugin/Notifications/Alertify.pm view on Meta::CPAN
a confirmation notification is used.
If the first parameter is a L<Mojolicious::Controller> object,
and the notification is a confirmation, the requests will have
a L<csrf_token|Mojolicious::Plugin::TagHelpers/csrf_token>
parameter to validate.
B<Confirmation is EXPERIMENTAL!>
=head1 SEE ALSO
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/OAuth2/Server.pm view on Meta::CPAN
unless ( my $oauth_details = $c->oauth( @scopes ) ) {
return $c->render( status => 401, text => 'Unauthorized' );
}
This calls the L<Net::OAuth2::AuthorizationServer::AuthorizationCodeGrant>
module (C<verify_token_and_scope> method) to validate the access/refresh token.
=head2 oauth2_auth_request
This is a helper to allow you get get the redirect URI instead of directing
a user to the authorize_route - it requires the details of the client:
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/OpenAPI/Modern.pm view on Meta::CPAN
die 'Cannot load OpenAPI document: ', $e;
}
$app->helper(openapi => sub ($) { $stash->{openapi} });
$app->helper(validate_request => \&_validate_request);
$app->helper(validate_response => \&_validate_response);
$app->hook(after_dispatch => sub ($c) {
$c->res->on(finish => sub ($res) { $config->{after_response}->($c) });
}) if $config->{after_response};
}
lib/Mojolicious/Plugin/OpenAPI/Modern.pm view on Meta::CPAN
openapi_uri => $config->{document_uri} // $config->{document_filename} // '',
openapi_schema => $schema,
};
}
sub _validate_request ($c) {
my $options = $c->stash->{openapi} //= {};
return $c->openapi->validate_request($c->req, $options);
}
sub _validate_response ($c) {
my $options = $c->stash->{openapi} //= {};
local $options->{request} = $c->req;
return $c->openapi->validate_response($c->res, $options);
}
1;
__END__
lib/Mojolicious/Plugin/OpenAPI/Modern.pm view on Meta::CPAN
});
$app->plugin('OpenAPI::Modern', $app->config->{openapi});
# in a controller...
my $result = $c->openapi->validate_request($c->req);
=head1 DESCRIPTION
This L<Mojolicious> plugin makes an L<OpenAPI::Modern> object available to the application.
lib/Mojolicious/Plugin/OpenAPI/Modern.pm view on Meta::CPAN
A subref which runs after the response has been finalized, to allow you to perform validation on it.
You B<must not> mutate the response here, nor swap it out for a different response, so use this only
for telemetry and logging.
my $after_response = sub ($c) {
my $result = $c->validate_response;
if ($result->valid) {
$c->log->debug('response is valid');
}
else {
# see JSON::Schema::Modern::Result for different output formats
lib/Mojolicious/Plugin/OpenAPI/Modern.pm view on Meta::CPAN
=head2 openapi
The L<OpenAPI::Modern> object; it holds your OpenAPI specification and is reused between requests.
=head2 validate_request
my $result = $c->openapi->validate_request;
Passes C<< $c->req >> to L<OpenAPI::Modern/validate_request> and returns a
L<JSON::Schema::Modern::Result> object.
Note that the matching L<Mojo::Routes::Route> object for this request is I<not> used to find the
OpenAPI path-item that corresponds to this request: only information in the request URI itself is
used (although some information in the route may be used in future features).
You might want to define an C<under> route action that calls C<validate_request> and short-circuits
with an HTTP 400 response on validation failure.
=head2 validate_response
my $result = $c->openapi->validate_response;
Passes C<< $c->res >> and C<< $c->req >> to L<OpenAPI::Modern/validate_response> and returns a
L<JSON::Schema::Modern::Result> object.
As this can only be called in the parts of the dispatch flow where the response has already been
rendered and finalized, a hook has been set up for you; you can access it by providing a subref to the
L</after_response> configuration value:
$app->config->{openapi}{after_response} //= sub ($c) {
my $result = $c->validate_response;
# ... do something with the validation result
};
Note that the matching L<Mojo::Routes::Route> object for this request is I<not> used to find the
OpenAPI path-item that corresponds to this request and response: only information in the request URI
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/OpenAPI.pm view on Meta::CPAN
die @$errors if @$errors;
unless ($app->defaults->{'openapi.base_paths'}) {
$app->helper('openapi.spec' => \&_helper_get_spec);
$app->helper('openapi.valid_input' => \&_helper_valid_input);
$app->helper('openapi.validate' => \&_helper_validate);
$app->helper('reply.openapi' => \&_helper_reply);
$app->hook(before_render => \&_before_render);
$app->renderer->add_handler(openapi => \&_render);
}
lib/Mojolicious/Plugin/OpenAPI.pm view on Meta::CPAN
}
sub _helper_valid_input {
my $c = shift;
return undef if $c->res->code;
return $c unless my @errors = _helper_validate($c);
$c->stash(status => 400)
->render(data => $c->openapi->build_response_body({errors => \@errors, status => 400}));
return undef;
}
sub _helper_validate {
my $c = shift;
my $self = _self($c);
my @errors = $self->validator->validate_request([@{$c->stash}{qw(openapi.method openapi.path)}],
$c->openapi->build_schema_request);
$c->openapi->coerce_request_parameters(
delete $c->stash->{'openapi.evaluated_request_parameters'});
return @errors;
}
lib/Mojolicious/Plugin/OpenAPI.pm view on Meta::CPAN
delete $args->{encoding};
$args->{status} = $status;
$stash->{format} ||= 'json';
if ($op_spec) {
@errors = $self->validator->validate_response($method_path_status,
$c->openapi->build_schema_response);
$c->openapi->coerce_response_parameters(
delete $stash->{'openapi.evaluated_response_parameters'});
$args->{status} = $errors[0]->path eq '/header/Accept' ? 400 : 500 if @errors;
}
lib/Mojolicious/Plugin/OpenAPI.pm view on Meta::CPAN
}
}
}
}
=head2 openapi.validate
@errors = $c->openapi->validate;
Used to validate a request. C<@errors> holds a list of
L<JSON::Validator::Error> objects or empty list on valid input.
Note that this helper is only for customization. You probably want
L</openapi.valid_input> in most cases.
lib/Mojolicious/Plugin/OpenAPI.pm view on Meta::CPAN
This hook is EXPERIMENTAL and subject for change.
=head1 RENDERER
This plugin register a new handler called C<openapi>. The special thing about
this handler is that it will validate the data before sending it back to the
user agent. Examples:
$c->render(json => {foo => 123}); # without validation
$c->render(openapi => {foo => 123}); # with validation
lib/Mojolicious/Plugin/OpenAPI.pm view on Meta::CPAN
=head2 register
$openapi = $openapi->register($app, \%config);
$openapi = $app->plugin(OpenAPI => \%config);
Loads the OpenAPI specification, validates it and add routes to
L<$app|Mojolicious>. It will also set up L</HELPERS> and adds a
L<before_render|Mojolicious/before_render> hook for auto-rendering of error
documents. The return value is the object instance, which allow you to access
the L</ATTRIBUTES> after you load the plugin.
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Passphrase.pm view on Meta::CPAN
}
1;
#ABSTRACT: Securely hash and validate your passwords.
__END__
=pod
=encoding UTF-8
=head1 NAME
Mojolicious::Plugin::Passphrase - Securely hash and validate your passwords.
=head1 VERSION
version 0.003
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/PetalTinyRenderer.pm view on Meta::CPAN
catch {
my $validator;
eval "use XML::Validate; \$validator = XML::Validate->new(Type => 'LibXML');";
if ($validator) {
$xml =~ s/<!DOCTYPE.*?>//;
if ($validator->validate($xml)) {
die "Petal::Tiny blew up handling '$name', and XML::Validate reports the XML is fine.\n\n$_";
}
else {
my $e = $validator->last_error;
my $message = $e->{message} // "";
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
xt/compat/dispatcher_lite_app.t view on Meta::CPAN
};
# Set additional headers for static files
hook after_static => sub {
my $c = shift;
$c->res->headers->cache_control('max-age=3600, must-revalidate');
};
# Make controller available as $_
hook around_action => sub {
my ($next, $c) = @_;
xt/compat/dispatcher_lite_app.t view on Meta::CPAN
my $t = Test::Mojo->new;
# Normal route
$t->get_ok('/')->status_is(200)
->header_isnt('Cache-Control' => 'max-age=3600, must-revalidate')
->content_is('works');
# Normal static file
$t->get_ok('/test.txt')->status_is(200)
->header_is('Cache-Control' => 'max-age=3600, must-revalidate')
->content_is("Normal static file!\n");
# Override static file
$t->get_ok('/hello.txt')->status_is(200)
->content_is('Custom static file works!');
xt/compat/dispatcher_lite_app.t view on Meta::CPAN
# Custom dispatcher
$t->get_ok('/custom?a=works+too')->status_is(205)->content_is('works too');
# Static file
$t->get_ok('/res.txt')->status_is(200)
->header_is('Cache-Control' => 'max-age=3600, must-revalidate')
->content_is("Static response!\n");
# Custom response
$t->get_ok('/res.txt?route=1')->status_is(202)
->header_isnt('Cache-Control' => 'max-age=3600, must-revalidate')
->content_is('Custom response!');
# Conditional response
$t->get_ok('/res.txt?route=1&res=1')->status_is(201)
->header_isnt('Cache-Control' => 'max-age=3600, must-revalidate')
->content_is('Conditional response!');
# Another custom dispatcher
$t->get_ok('/custom_too')->status_is(200)
->header_isnt('Cache-Control' => 'max-age=3600, must-revalidate')
->content_is('this works too');
# First wrapper
$t->get_ok('/wrap')->status_is(200)->content_is('Wrapped!');
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/QuickPg.pm view on Meta::CPAN
foto => 'https://www.flickr.com/search/?text=Moscow' } );
# or you can do like this
my $params = $c->req->json;
# Do not forget to validate $params before it:
my $id = $c->insert('models', $params);
# quick update
# returns numbers of updated rows
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/ReCAPTCHAv2.pm view on Meta::CPAN
that requires human interaction. The interaction is evaluated on a server
(via AJAX) and a dynamic parameter is injected in your form.
When your users submit your form to your server you receive that parameter
and can verify it by sending it to the captcha servers in the background.
You should then stop further processing of the request you received if the
captcha did not validate.
Please note that this module currently does not support some advanced usage
models for the captcha like explicit rendering and AJAX callbacks.
Therefore a few options listed in the official Google docs are not listed
above.
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
share/public/revealjs/plugin/highlight/highlight.js view on Meta::CPAN
}
})();
// END CUSTOM REVEAL.JS INTEGRATION
/*! highlight.js v9.11.0 | BSD3 License | git.io/hljslicense */
!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.r...
c:[{cN:"comment",b:/\(\*/,e:/\*\)/},e.ASM,e.QSM,e.CNM,{b:/\{/,e:/\}/,i:/:/}]}});hljs.registerLanguage("roboconf",function(a){var e="[a-zA-Z-_][^\\n{]+\\{",n={cN:"attribute",b:/[a-zA-Z-_]+/,e:/\s*:/,eE:!0,starts:{e:";",r:0,c:[{cN:"variable",b:/\.[a-zA...
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/RoutesAuthDBI.pm view on Meta::CPAN
{
auth => {
stash_key => PKG."__user__",
current_user_fn => 'auth_user',# helper
load_user => \&load_user,
validate_user => \&validate_user,
},
access => {
namespace => PKG,
module => 'Access',
lib/Mojolicious/Plugin/RoutesAuthDBI.pm view on Meta::CPAN
shift->render(status => 401, format=>'txt', text=>"Please sign in.\n");
},
fail_access_cb => sub {
shift->render(status => 403, format=>'txt', text=>"You don`t have access on this route (url, action).\n");
},
import => [qw(load_user validate_user)],
},
admin => {
namespace => PKG,
controller => 'Admin',
lib/Mojolicious/Plugin/RoutesAuthDBI.pm view on Meta::CPAN
#~ autoload_user => 1,
session_key => 'guest_data',
stash_key => PKG."__guest__",
#~ current_user_fn => 'current_guest',# helper
#~ load_user => \&load_guest,
#~ validate_user => not need
#~ fail_render => not need
#######end Mojolicious::Plugin::Authentication conf#######
namespace => PKG,
module => 'Guest',
#~ import => [qw(load_guest)],
lib/Mojolicious/Plugin/RoutesAuthDBI.pm view on Meta::CPAN
stash_key => "Mojolicious::Plugin::RoutesAuthDBI__user__",
The options:
load_user => \&load_user,
validate_user => \&validate_user,
are imported from package access module. See below.
=head3 access
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/SQLiteViewerLite/Base/Sqliteviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $tables = $command->show_tables($database);
return $self->render(
database => $database,
lib/Mojolicious/Plugin/SQLiteViewerLite/Base/Sqliteviewerlite.pm view on Meta::CPAN
],
table => {default => ''} => [
'safety_name'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $table = $vresult->data->{table};
my $table_def = $command->show_create_table($database, $table);
lib/Mojolicious/Plugin/SQLiteViewerLite/Base/Sqliteviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $tables = $command->show_tables($database);
# Get create tables
my $create_tables = {};
lib/Mojolicious/Plugin/SQLiteViewerLite/Base/Sqliteviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $tables = $command->show_tables($database);
$self->render(
database => $database,
lib/Mojolicious/Plugin/SQLiteViewerLite/Base/Sqliteviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
],
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
# Get primary keys
my $primary_keys = $command->show_primary_keys($database);
lib/Mojolicious/Plugin/SQLiteViewerLite/Base/Sqliteviewerlite.pm view on Meta::CPAN
my $rule = [
database => {default => ''} => [
'safety_name'
],
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
# Get null allowed columns
my $null_allowed_columns = $command->show_null_allowed_columns($database);
lib/Mojolicious/Plugin/SQLiteViewerLite/Base/Sqliteviewerlite.pm view on Meta::CPAN
],
condition_value => [
'not_blank'
]
];
my $vresult = $plugin->validator->validate($params, $rule);
my $database = $vresult->data->{database};
my $table = $vresult->data->{table};
# Where
my $column = $vresult->data->{condition_column};
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/public/vendor/SemanticUI/components/form.min.js view on Meta::CPAN
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
!function(e,t,n,i){"use strict";e.fn.form=function(t,r){var o,a=e(this),s=e.extend(!0,{},e.fn.form.settings,r),l=e.extend({},e.fn.form.settings.defaults,t),c=s.namespace,u=s.metadata,d=s.selector,f=s.className,p=(s.error,"."+c),v="module-"+c,m=a.sele...
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/ServiceWorker.pm view on Meta::CPAN
As above, except the matching URL will be fetched from the network
every time and used if possible. The cached value will only be used if
that fails.
B<Any URL not matching these three criteria> will be treated with a
"cache first" strategy, also known as "stale while revalidate": the cached
version will immediately by returned to the web client for performance,
but also fetched over the network and re-cached for freshness.
=head1 HELPERS
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/StaticCache.pm view on Meta::CPAN
sub register {
my ($self, $app, $conf) = @_;
$conf->{even_in_dev} ||= 0;
$conf->{max_age} ||= 2592000;
$conf->{cache_control} ||= "max-age=$conf->{max_age}, must-revalidate";
my $mode = $app->mode;
my $edev = $conf->{even_in_dev};
$app->hook(after_static => sub {
my $c = shift;
lib/Mojolicious/Plugin/StaticCache.pm view on Meta::CPAN
Default is 2592000.
=head2 cache_control
# Mojolicious
$self->plugin('StaticCache' => { cache_control => 'max-age=2592000, must-revalidate' });
Specify the content of the Cache-Control header.
Default is "max-age=$max_age, must-revalidate".
=head1 METHODS
L<Mojolicious::Plugin::StaticCache> inherits all methods from
L<Mojolicious::Plugin> and implements the following new ones.
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/resources/public/mojo-status/bootstrap/bootstrap.css view on Meta::CPAN
/*!
* Bootstrap v4.4.1 (https://getbootstrap.com/)
* Copyright 2011-2019 The Bootstrap Authors
* Copyright 2011-2019 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c75...
/*# sourceMappingURL=bootstrap.min.css.map */
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Sugar.pm view on Meta::CPAN
# Shortcut to process HTML::FormHandler form
my $form = MyApp::Form::Add->new;
$form->process( $self->params->to_hash );
if ($form->validated) {
[...]
}
else {
[...]
}
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
share/resources/public/swagger-ui/swagger-ui-bundle.js view on Meta::CPAN
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(f...
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function()...
/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
share/resources/public/swagger-ui/swagger-ui-bundle.js view on Meta::CPAN
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var r=n(569),o=n(570),i=n(355);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null=...
/*!
* @description Recursive object extending
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
* @license MIT
*
share/resources/public/swagger-ui/swagger-ui-bundle.js view on Meta::CPAN
* @param {string} eventNameSuffix Event name, e.g. "click".
* @param {?boolean} capture Check if the capture phase is supported.
* @return {boolean} True if the event is supported.
* @internal
* @license Modernizr 3.0.0pre (Custom Build) | MIT
*/,e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=docum...
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017 Joachim Wester
* MIT license
*/
var n=this&&this.__extends||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},r=Object.prototype.hasOwnProperty;function o(e,t){return ...
/** @license React v16.8.6
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):6010...
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017 Joachim Wester
* MIT license
*/
var r=n(267),o=n(456),i=n(456);t.applyOperation=i.applyOperation,t.applyPatch=i.applyPatch,t.applyReducer=i.applyReducer,t.getValueByPointer=i.getValueByPointer,t.validate=i.validate,t.validator=i.validator;var a=n(267);t.JsonPatchError=a.PatchError,...
/*!
* @description Recursive object extending
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
* @license MIT
*
share/resources/public/swagger-ui/swagger-ui-bundle.js view on Meta::CPAN
/*!
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/var r,o="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var n=e.length*t;if(r!==e||void 0===r)r=e,o="";else if(o.length>=n)return o.substr(0,n);for(;n>o.length&&t>1;)1...
/*!
* Autolinker.js
* 0.28.1
*
* Copyright(c) 2016 Gregory Jacobs <greg@greg-jacobs.com>
* MIT License
*
* https://github.com/gregjacobs/Autolinker.js
*/o=[],void 0===(i="function"==typeof(r=function(){var e,t,n,r,o,i,a,s=function(e){e=e||{},this.version=s.version,this.urls=this.normalizeUrlsCfg(e.urls),this.email="boolean"!=typeof e.email||e.email,this.twitter="boolean"!=typeof e.twitter||e.twitt...
//# sourceMappingURL=swagger-ui-bundle.js.map
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
purpose whatsoever, including without limitation commercial, advertising or
promotional purposes (the "License"). The License shall be deemed effective as
of the date CC0 was applied by Affirmer to the Work. Should any part of the
License for any reason be judged legally invalid or ineffective under
applicable law, such partial invalidity or ineffectiveness shall not
invalidate the remainder of the License, and in such case Affirmer hereby
affirms that he or she will not (i) exercise any of his or her remaining
Copyright and Related Rights in the Work or (ii) assert any associated claims
and causes of action with respect to the Work, in either case contrary to
Affirmer's express Statement of Purpose.
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Toto/Assets/public/bootstrap/js/bootstrap.min.js view on Meta::CPAN
/**
* Bootstrap.js v2.3.2 by @fat & @mdo
* Copyright 2012 Twitter, Inc.
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/
!function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",tran...
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/TrustedProxy.pm view on Meta::CPAN
Mojolicious app is directly exposed to the internet, or if it sits behind
multiple upstream proxies. You should therefore ensure your application does
not enable the default Mojolicious reverse proxy handler when using this plugin.
This plugin supports parsing L<RFC 7239|http://tools.ietf.org/html/rfc7239>
compliant C<Forwarded> headers, validates all IP addresses, and will
automatically convert RFC-4291 IPv4-to-IPv6 mapped values (useful for when your
Mojolicious listens on both IP versions). Please be aware that C<Forwarded>
headers are only partially supported. More information is available in L</BUGS>.
Debug logging can be enabled by setting the C<MOJO_TRUSTEDPROXY_DEBUG>
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Validate/Tiny.pm view on Meta::CPAN
my ( $c, $rules, $params ) = @_;
croak "ValidateTiny: Wrong validatation rules"
if (none {$_ eq ref($rules)} ('ARRAY', 'HASH'));
$c->flash('validate_tiny.was_called', 1);
$rules = { checks => $rules } if ref $rules eq 'ARRAY';
$rules->{fields} ||= [];
# Validate GET+POST parameters by default
lib/Mojolicious/Plugin/Validate/Tiny.pm view on Meta::CPAN
my $errors = {};
foreach my $f (@fields_wo_rules) {
$errors->{$f} = "No validation rules for field \"$f\"";
}
$c->flash('validate_tiny.errors' => $errors);
$log->debug($err_msg);
return 0;
}
}
lib/Mojolicious/Plugin/Validate/Tiny.pm view on Meta::CPAN
}
else { # Fall back for old Validate::Tiny version
$result = Validate::Tiny->new( $params, $rules );
}
$c->flash('validate_tiny.result' => $result);
if ( $result->success ) {
$log->debug('ValidateTiny: Successful');
return $result->data;
} else {
$log->debug( 'ValidateTiny: Failed: ' . join( ', ', keys %{ $result->error } ) );
$c->flash('validate_tiny.errors' => $result->error);
return;
}
} );
# Helper validator_has_errors
$app->helper(
validator_has_errors => sub {
my $c = shift;
my $errors = $c->flash('validate_tiny.errors');
return 0 if !$errors || !keys %$errors;
return 1;
} );
# Helper validator_error
$app->helper(
validator_error => sub {
my ( $c, $name ) = @_;
my $errors = $c->flash('validate_tiny.errors');
return $errors unless defined $name;
if ( $errors && defined $errors->{$name} ) {
return $errors->{$name};
lib/Mojolicious/Plugin/Validate/Tiny.pm view on Meta::CPAN
validator_error_string => sub {
my ( $c, $params ) = @_;
return '' unless $c->validator_has_errors();
$params //= {};
return $c->flash('validate_tiny.result')->error_string(%$params);
} );
# Helper validator_any_error
$app->helper(
validator_any_error => sub {
my ( $c ) = @_;
my $errors = $c->flash('validate_tiny.errors');
if ( $errors ) {
return ( ( values %$errors )[0] );
}
lib/Mojolicious/Plugin/Validate/Tiny.pm view on Meta::CPAN
# Print info about actions without validation
$app->hook(
after_dispatch => sub {
my ($c) = @_;
return 1 if $c->flash('validate_tiny.was_called');
my $stash = $c->stash;
if ( $stash->{controller} && $stash->{action} ) {
$log->debug("ValidateTiny: No validation in [$stash->{controller}#$stash->{action}]");
lib/Mojolicious/Plugin/Validate/Tiny.pm view on Meta::CPAN
# Mojolicious::Lite
plugin 'Validate::Tiny';
sub action {
my $self = shift;
my $validate_rules = [
# All of these are required
[qw/name email pass pass2/] => is_required(),
# pass2 must be equal to pass
pass2 => is_equal('pass'),
# custom sub validates an email address
email => sub {
my ( $value, $params ) = @_;
Email::Valid->address($value) ? undef : 'Invalid email';
}
];
return unless $self->do_validation($validate_rules);
... Do something ...
}
sub action2 {
my $self = shift;
my $validate_rules = {
checks => [...],
fields => [...],
filters => [...]
};
if ( my $filtered_params = $self->do_validation($validate_rules) ) {
# all $params are validated and filters are applyed
... do your action ...
} else {
my $errors = $self->validator_error; # hash with errors
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/ValidateMoose.pm view on Meta::CPAN
package Mojolicious::Plugin::ValidateMoose;
=head1 NAME
Mojolicious::Plugin::ValidateMoose - Can validate using Moose objects
=head1 VERSION
0.02
=head1 DESCRIPTION
This module is handy if you want to validate POST/GET parameters
using L<Moose> classes.
=head1 SYNOPSIS
package MyApp;
lib/Mojolicious/Plugin/ValidateMoose.pm view on Meta::CPAN
use Mojo::Base 'Mojolicious::Controller';
sub foo {
my $self = shift;
if($self->req->method eq 'POST') {
if(my $obj = $self->validate_moose('My::Moose::Class')) {
# input validate, and $obj created from My::Moose::Class
# with the params set as attributes
}
}
}
lib/Mojolicious/Plugin/ValidateMoose.pm view on Meta::CPAN
our $VERSION = eval '0.02';
=head1 HELPERS
=head2 validate_moose
$obj = $controller->validate_moose($moose_class, \%args);
$obj = $controller->validate_moose($moose_obj, \%args);
Will either update an existing or create a new L<Moose> object, if all
the attributes gets validated. If any of the attributes is not updated
with the right value from C<param()>, this method will set
C<invalid_form_elements> in the stash to a datastructure like this:
{
$param_name_a => 'required', # fixed
lib/Mojolicious/Plugin/ValidateMoose.pm view on Meta::CPAN
Example moose exception message:
Validation failed for 'Int' with value "asd"
The method will return empty list if it fail to validate the input.
=cut
sub validate_moose {
my($c, $class, $args) = @_;
my $obj = ref $class ? $class : undef;
my $meta = $class->meta;
my(%constructor_args, %invalid);
lib/Mojolicious/Plugin/ValidateMoose.pm view on Meta::CPAN
=cut
sub register {
my($self, $app, $config) = @_;
$app->helper(validate_moose => \&validate_moose);
}
=head1 COPYRIGHT & LICENSE
This library is free software. You can redistribute it and/or modify
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/ValidateTiny.pm view on Meta::CPAN
do_validation => sub {
my ( $c, $rules, $params ) = @_;
croak "ValidateTiny: Wrong validatation rules"
unless ref($rules) ~~ [ 'ARRAY', 'HASH' ];
$c->stash('validate_tiny.was_called', 1);
$rules = { checks => $rules } if ref $rules eq 'ARRAY';
$rules->{fields} ||= [];
# Validate GET+POST parameters by default
lib/Mojolicious/Plugin/ValidateTiny.pm view on Meta::CPAN
my $errors = {};
foreach my $f (@fields_wo_rules) {
$errors->{$f} = "No validation rules for field \"$f\"";
}
$c->stash( 'validate_tiny.errors' => $errors);
$log->debug($err_msg);
return 0;
}
}
lib/Mojolicious/Plugin/ValidateTiny.pm view on Meta::CPAN
}
else { # Fall back for old Validate::Tiny version
$result = Validate::Tiny->new( $params, $rules );
}
$c->stash( 'validate_tiny.result' => $result );
if ( $result->success ) {
$log->debug('ValidateTiny: Successful');
return $result->data;
} else {
$log->debug( 'ValidateTiny: Failed: ' . join( ', ', keys %{ $result->error } ) );
$c->stash( 'validate_tiny.errors' => $result->error );
return;
}
} );
# Helper validator_has_errors
$app->helper(
validator_has_errors => sub {
my $c = shift;
my $errors = $c->stash('validate_tiny.errors');
return 0 if !$errors || !keys %$errors;
return 1;
} );
# Helper validator_error
$app->helper(
validator_error => sub {
my ( $c, $name ) = @_;
my $errors = $c->stash('validate_tiny.errors');
return $errors unless defined $name;
if ( $errors && defined $errors->{$name} ) {
return $errors->{$name};
lib/Mojolicious/Plugin/ValidateTiny.pm view on Meta::CPAN
validator_error_string => sub {
my ( $c, $params ) = @_;
return '' unless $c->validator_has_errors();
$params //= {};
return $c->stash('validate_tiny.result')->error_string(%$params);
} );
# Helper validator_any_error
$app->helper(
validator_any_error => sub {
my ( $c ) = @_;
my $errors = $c->stash('validate_tiny.errors');
if ( $errors ) {
return ( ( values %$errors )[0] );
}
lib/Mojolicious/Plugin/ValidateTiny.pm view on Meta::CPAN
# Print info about actions without validation
$app->hook(
after_dispatch => sub {
my ($c) = @_;
my $stash = $c->stash;
return 1 if $stash->{'validate_tiny.was_called'};
if ( $stash->{controller} && $stash->{action} ) {
$log->debug("ValidateTiny: No validation in [$stash->{controller}#$stash->{action}]");
return 0;
}
lib/Mojolicious/Plugin/ValidateTiny.pm view on Meta::CPAN
# Mojolicious::Lite
plugin 'ValidateTiny';
sub action {
my $self = shift;
my $validate_rules = [
# All of these are required
[qw/name email pass pass2/] => is_required(),
# pass2 must be equal to pass
pass2 => is_equal('pass'),
# custom sub validates an email address
email => sub {
my ( $value, $params ) = @_;
Email::Valid->address($value) ? undef : 'Invalid email';
}
];
return unless $self->do_validation($validate_rules);
... Do something ...
}
sub action2 {
my $self = shift;
my $validate_rules = {
checks => [...],
fields => [...],
filters => [...]
};
if ( my $filtered_params = $self->do_validation($validate_rules) ) {
# all $params are validated and filters are applyed
... do your action ...
} else {
my $errors = $self->validator_error; # hash with errors
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Vparam.pm view on Meta::CPAN
Full Mojolicious::Validator::Validation integration
=back
This module use simple parameters types B<str>, B<int>, B<email>, B<bool>,
etc. to validate.
Instead of many other modules you mostly not need add specific validation
subs or rules.
Just set parameter type. But if you want sub or regexp you can do it too.
=head1 SYNOPSIS
lib/Mojolicious/Plugin/Vparam.pm view on Meta::CPAN
<input name="myparam" value="<%= vvalue 'myparam' %>">
# Return next code if user just open form without submit and validation:
# <input name="myparam" value="">
# Then user submit form and you validate id. For example user submit "abc":
# <input name="myparam" value="abc">
=head2 vtype $name, %opts
Set new type $name if defined %opts. Else return type $name definition.
lib/Mojolicious/Plugin/Vparam.pm view on Meta::CPAN
Simple objects via parameters (without validation!). Example:
# {foo => [ {bar => 1, baz => 2} ]}
?param1[foo][0][bar]=1¶m1[foo][0][baz]=2
This is experimental feature. We think how to validate parameters.
=head1 ATTRIBUTES
You can set a simple mode as in example or full mode. Full mode keys:
lib/Mojolicious/Plugin/Vparam.pm view on Meta::CPAN
formatted scalar.
=head2 jpath or jpath?
If you POST data not form but raw JSON you can use JSON Pointer selectors
from L<Mojo::JSON::Pointer> to get and validate parameters.
# POST data contains:
# {"point":{"address":"some", "lon": 45.123456, "lat": 38.23452}}
%opts = $self->vparams(
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Web/Auth.pm view on Meta::CPAN
on_finished => sub {
my ( $c, $access_token, $user_info ) = @_;
...
};
=head2 C<validate_state>
Optional: OAuth 2.0 only. Default value is 1, see L<http://tools.ietf.org/html/rfc6819#section-5.3.5>.
=head2 C<on_finished>
view all matches for this distributionview release on metacpan - search on metacpan