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
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/WebPush.pm view on Meta::CPAN
my ($subs_session2user_p, $subs_create_p) = @_;
sub {
my ($c) = @_;
my ($decode_ok, $body) = _decode($c->req->body);
return _error($c, $body) if !$decode_ok;
eval { validate_subs_info($body) };
return _error($c, $@) if $@;
return $subs_session2user_p->($c, $c->session)->then(
sub { $subs_create_p->($c, $_[0], $body) },
)->then(
sub { $c->render(json => { data => { success => \1 } }) },
lib/Mojolicious/Plugin/WebPush.pm view on Meta::CPAN
sub register {
my ($self, $app, $conf) = @_;
my @config_errors = grep !exists $conf->{$_}, @MANDATORY_CONF;
die "Missing config keys @config_errors\n" if @config_errors;
$app->helper('webpush.create_p' => sub {
eval { validate_subs_info($_[2]) };
return Mojo::Promise->reject($@) if $@;
goto &{ $conf->{subs_create_p} };
});
$app->helper('webpush.read_p' => $conf->{subs_read_p});
$app->helper('webpush.delete_p' => $conf->{subs_delete_p});
lib/Mojolicious/Plugin/WebPush.pm view on Meta::CPAN
push => $conf->{push_handler} || $DEFAULT_PUSH_HANDLER
);
$self;
}
sub validate_subs_info {
my ($info) = @_;
die "Expected object\n" if ref $info ne 'HASH';
my @errors = map "no $_", grep !exists $info->{$_}, qw(keys endpoint);
push @errors, map "no $_", grep !exists $info->{keys}{$_}, qw(auth p256dh);
die "Errors found in subscription info: " . join(", ", @errors) . "\n"
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
t/package-lock.json view on Meta::CPAN
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true,
"bin": {
"esparse": "bin/esparse.js",
"esvalidate": "bin/esvalidate.js"
},
"engines": {
"node": ">=4"
}
},
view all matches for this distributionview release on metacpan - search on metacpan
view release on metacpan or search on metacpan
t/asset_memory.t
t/author-pod-syntax.t
t/basic.t
t/compression_types_lowercase.t
t/compression_types_setter.t
t/compression_types_validate.t
t/content_type.t
t/if_none_match.t
t/lib/TestHelpers.pm
t/public/compressed_one_larger.txt
t/public/compressed_one_larger.txt.br
t/serve.t
t/serve_asset.t
t/serve_file.t
t/should_serve_asset.t
t/should_serve_asset_setter.t
t/should_serve_asset_validate.t
view all matches for this distributionview release on metacpan - search on metacpan