[ARVADOS] updated: 395ee15d9fa6be4c26be4a1ecda5926cf1172b65
git at public.curoverse.com
git at public.curoverse.com
Wed Mar 12 15:35:05 EDT 2014
Summary of changes:
.../api/app/controllers/application_controller.rb | 18 ++++++++++--------
.../app/controllers/user_sessions_controller.rb | 3 ++-
2 files changed, 12 insertions(+), 9 deletions(-)
via 395ee15d9fa6be4c26be4a1ecda5926cf1172b65 (commit)
via 1ef9a09b9407636da43bb356332a49c3a9748480 (commit)
from 850bcd4de3903186ace4fe00a67d6c0910c959c2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 395ee15d9fa6be4c26be4a1ecda5926cf1172b65
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed Mar 12 15:29:18 2014 -0400
Adds scopes: ["all"] when creating a new api client authorization, because database schema does not permit have a null scopes column.
diff --git a/services/api/app/controllers/user_sessions_controller.rb b/services/api/app/controllers/user_sessions_controller.rb
index 71c2823..3674c01 100644
--- a/services/api/app/controllers/user_sessions_controller.rb
+++ b/services/api/app/controllers/user_sessions_controller.rb
@@ -121,7 +121,8 @@ class UserSessionsController < ApplicationController
api_client_auth = ApiClientAuthorization.
new(user: user,
api_client: @api_client,
- created_by_ip_address: remote_ip)
+ created_by_ip_address: remote_ip,
+ scopes: ["all"])
api_client_auth.save!
if callback_url.index('?')
commit 1ef9a09b9407636da43bb356332a49c3a9748480
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed Mar 12 15:26:29 2014 -0400
Replaces postgres-specific 'now()' with standard SQL CURRENT_TIMESTAMP
Render checks that opts which are passed in are valid before trying to use it.
diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 34a22aa..4061b7d 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -265,7 +265,7 @@ class ApplicationController < ActionController::Base
if supplied_token
api_client_auth = ApiClientAuthorization.
includes(:api_client, :user).
- where('api_token=? and (expires_at is null or expires_at > now())', supplied_token).
+ where('api_token=? and (expires_at is null or expires_at > CURRENT_TIMESTAMP)', supplied_token).
first
if api_client_auth.andand.user
session[:user_id] = api_client_auth.user.id
@@ -395,13 +395,15 @@ class ApplicationController < ActionController::Base
end
def render *opts
- response = opts.first[:json]
- if response.is_a?(Hash) &&
- params[:_profile] &&
- Thread.current[:request_starttime]
- response[:_profile] = {
- request_time: Time.now - Thread.current[:request_starttime]
- }
+ if opts.first
+ response = opts.first[:json]
+ if response.is_a?(Hash) &&
+ params[:_profile] &&
+ Thread.current[:request_starttime]
+ response[:_profile] = {
+ request_time: Time.now - Thread.current[:request_starttime]
+ }
+ end
end
super *opts
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list