Skip to content

Commit

Permalink
changed Mojolicious default secret to the application moniker to make…
Browse files Browse the repository at this point in the history
… it slightly more secure
  • Loading branch information
kraih committed May 9, 2013
1 parent 440634d commit fa39fde
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -5,6 +5,8 @@
- Added json event to Mojo::Transaction::WebSocket.
- Added is_empty method to Mojo::Transaction::HTTP.
- Added close_gracefully method to Mojo::IOLoop::Stream.
- Changed Mojolicious default secret to the application moniker to make it
slightly more secure.
- Removed Mojolicious::Plugin::PoweredBy and
Mojolicious::Plugin::RequestTimer.
- Removed data attribute from Mojo::URL.
Expand Down
10 changes: 5 additions & 5 deletions lib/Mojolicious.pm
Expand Up @@ -33,8 +33,8 @@ has secret => sub {
# Warn developers about insecure default
$self->log->debug('Your secret passphrase needs to be changed!!!');

# Default to application name
return ref $self;
# Default to moniker
return $self->moniker;
};
has sessions => sub { Mojolicious::Sessions->new };
has static => sub { Mojolicious::Static->new };
Expand Down Expand Up @@ -335,9 +335,9 @@ startup method to define the url endpoints for your application.
$app = $app->secret('passw0rd');
A secret passphrase used for signed cookies and the like, defaults to the
application name which is not very secure, so you should change it!!! As long
as you are using the insecure default there will be debug messages in the log
file reminding you to change your passphrase.
C<moniker> of this application, which is not very secure, so you should change
it!!! As long as you are using the insecure default there will be debug
messages in the log file reminding you to change your passphrase.
=head2 sessions
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Cookbook.pod
Expand Up @@ -1100,7 +1100,7 @@ There are many more useful methods and attributes in L<Mojolicious::Command>
that you can use or overload.

$ mojo spy secret
The secret of this application is "Mojolicious::Lite".
The secret of this application is "HelloWorld".

$ ./myapp.pl spy secret
The secret of this application is "secr3t".
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/FAQ.pod
Expand Up @@ -94,7 +94,7 @@ to use the MOJO_REACTOR environment variable to enforce a more portable one.
=head2 What does "Your secret passphrase needs to be changed" mean?

L<Mojolicious> uses a secret passphrase for security features such as signed
cookies. It defaults to the name of your application, which is not very
cookies. It defaults to the moniker of your application, which is not very
secure, so we added this log message as a reminder. You can change the
passphrase with the attribute L<Mojolicious/"secret">.

Expand Down
1 change: 1 addition & 0 deletions t/mojolicious/app.t
Expand Up @@ -59,6 +59,7 @@ is $t->app, $t->app->commands->app, 'applications are equal';
is $t->app->static->file('hello.txt')->slurp,
"Hello Mojo from a development static file!\n", 'right content';
is $t->app->moniker, 'mojolicious_test', 'right moniker';
is $t->app->secret, $t->app->moniker, 'secret defaults to moniker';

# Hidden controller methods and attributes
$t->app->routes->hide('bar');
Expand Down

0 comments on commit fa39fde

Please sign in to comment.