[Bps-public-commit] smokingit branch, master, updated. da75bf78290eea8ec1281492dc5120747b4dc695

Alex Vandiver alexmv at bestpractical.com
Mon Dec 3 02:53:53 EST 2012


The branch, master has been updated
       via  da75bf78290eea8ec1281492dc5120747b4dc695 (commit)
       via  c0199f1746a80f7173588d3adddb7230e7626e36 (commit)
       via  6505c428f5fcbffa9bd4739a6e2b16306314b8b7 (commit)
       via  9bb77083ae4d7d68be1dd71d382b85ee6f848823 (commit)
      from  124fcb25885514d7d9f68806f75e3f2636e962b0 (commit)

Summary of changes:
 lib/Smokingit/Dispatcher.pm   | 15 +++++++++++++++
 lib/Smokingit/Model/Branch.pm |  2 ++
 lib/Smokingit/Model/Commit.pm | 22 +++++++++++++++-------
 lib/Smokingit/Model/User.pm   |  2 +-
 4 files changed, 33 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit 9bb77083ae4d7d68be1dd71d382b85ee6f848823
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Dec 3 02:17:58 2012 -0500

    There is no reason to expose user information in REST

diff --git a/lib/Smokingit/Model/User.pm b/lib/Smokingit/Model/User.pm
index 9590d79..59987a3 100644
--- a/lib/Smokingit/Model/User.pm
+++ b/lib/Smokingit/Model/User.pm
@@ -9,7 +9,7 @@ use Smokingit::Record schema {};
 use Jifty::Plugin::User::Mixin::Model::User;
 use Jifty::Plugin::Authentication::Password::Mixin::Model::User;
 
-sub is_protected {1}
+sub is_private {1}
 
 sub since { '0.0.6' }
 

commit 6505c428f5fcbffa9bd4739a6e2b16306314b8b7
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Dec 3 02:18:49 2012 -0500

    Branches are automatically produced; mark them as private

diff --git a/lib/Smokingit/Model/Branch.pm b/lib/Smokingit/Model/Branch.pm
index d8c5b42..29d9fba 100644
--- a/lib/Smokingit/Model/Branch.pm
+++ b/lib/Smokingit/Model/Branch.pm
@@ -63,6 +63,8 @@ use Smokingit::Record schema {
         is protected;
 };
 
+sub is_protected { 1 };
+
 sub create {
     my $self = shift;
     my %args = (

commit c0199f1746a80f7173588d3adddb7230e7626e36
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Dec 3 02:19:00 2012 -0500

    Mark commits as immutable

diff --git a/lib/Smokingit/Model/Commit.pm b/lib/Smokingit/Model/Commit.pm
index be12c67..e222269 100644
--- a/lib/Smokingit/Model/Commit.pm
+++ b/lib/Smokingit/Model/Commit.pm
@@ -10,31 +10,39 @@ use Smokingit::Record schema {
 
     column sha =>
         type is 'text',
+        is immutable,
         is mandatory,
         is unique,
         is case_sensitive,
         is indexed;
 
     column author =>
-        type is 'text';
+        type is 'text',
+        is immutable;
 
     column authored_time =>
-        is timestamp;
+        is timestamp,
+        is immutable;
 
     column committer =>
-        type is 'text';
+        type is 'text',
+        is immutable;
 
     column committed_time =>
-        is timestamp;
+        is timestamp,
+        is immutable;
 
     column parents =>
-        type is 'text';
+        type is 'text',
+        is immutable;
 
     column subject =>
-        type is 'text';
+        type is 'text',
+        is immutable;
 
     column body =>
-        type is 'text';
+        type is 'text',
+        is immutable;
 };
 sub is_protected {1}
 

commit da75bf78290eea8ec1281492dc5120747b4dc695
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Dec 3 02:19:25 2012 -0500

    Lock down the set of published actions

diff --git a/lib/Smokingit/Dispatcher.pm b/lib/Smokingit/Dispatcher.pm
index a5c80d7..114f877 100644
--- a/lib/Smokingit/Dispatcher.pm
+++ b/lib/Smokingit/Dispatcher.pm
@@ -4,6 +4,21 @@ use warnings;
 package Smokingit::Dispatcher;
 use Jifty::Dispatcher -base;
 
+# Limit down the set of actions via REST
+before '*' => run {
+    my $api = Jifty->api;
+    $api->hide(qr/^Smokingit::Action/);
+    if (Jifty->web->current_user->id) {
+        $api->allow("Logout");
+        $api->allow("Test");
+        $api->allow("UpdateBranch");
+        $api->allow(qr/^Smokingit::Action::(Create|Update|Delete)(Configuration|Project)$/);
+    } else {
+        $api->allow("Login");
+        $api->allow("GeneratePasswordToken");
+    }
+};
+
 # Auto redirect after create, to the project
 on '' => run {
     my $res = Jifty->web->response->result('create-project');

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list