Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add: support for Key-Auth (API-Key)

fix: old code removed
  • Loading branch information...
commit 57300149c91327b2aba101ab9b785e092d59f5a7 1 parent 73ef170
Sven Krzyzak authored
View
2  app/controllers/mylyn_connector/custom_fields_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::CustomFieldsController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
5 app/controllers/mylyn_connector/information_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::InformationController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :version, :token
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
@@ -17,6 +19,9 @@ def version
end
def token
+ #Workaround: we need a session, some operations does'nt support key-auth
+ self.logged_user = User.current
+
render :text => form_authenticity_token
end
end
View
2  app/controllers/mylyn_connector/issue_categories_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::IssueCategoriesController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
2  app/controllers/mylyn_connector/issue_priorities_controller.rb
@@ -5,6 +5,8 @@ class MylynConnector::IssuePrioritiesController < ApplicationController
include MylynConnector::Rescue::ClassMethods
include MylynConnector::Version::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
2  app/controllers/mylyn_connector/issue_status_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::IssueStatusController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
26 app/controllers/mylyn_connector/issues_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::IssuesController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :show, :index, :list, :updated_since
+
skip_before_filter :verify_authenticity_token
before_filter :find_optional_project, :only => [:index]
@@ -43,30 +45,6 @@ def index
render_404
end
- def query
- query = retrieve_query params[:query_id], params[:query_string]
- if !query.blank? && query.valid?
- begin
-
- condition = ARCondition.new
- condition << ["issues.project_id = ?", @project.id] if @project
- condition << query.statement
-
- @issues = Issue.find :all,
- :include => [ :assigned_to, :status, :tracker, :project, :priority, :category, :fixed_version ],
- :conditions => condition.conditions
-
- respond_to do |format|
- format.xml {render :xml => @issues, :template => 'mylyn_connector/issues/index.rxml'}
- end
- rescue ActiveRecord::StatementInvalid
- render_404
- end
- else
- render_404
- end
- end
-
def updated_since
time = Time.at(params[:unixtime].to_i)
View
2  app/controllers/mylyn_connector/projects_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::ProjectsController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
2  app/controllers/mylyn_connector/queries_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::QueriesController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
2  app/controllers/mylyn_connector/settings_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::SettingsController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
2  app/controllers/mylyn_connector/time_entry_activities_controller.rb
@@ -5,6 +5,8 @@ class MylynConnector::TimeEntryActivitiesController < ApplicationController
include MylynConnector::Rescue::ClassMethods
include MylynConnector::Version::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
2  app/controllers/mylyn_connector/trackers_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::TrackersController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
2  app/controllers/mylyn_connector/users_controller.rb
@@ -5,6 +5,8 @@ class MylynConnector::UsersController < ApplicationController
include MylynConnector::Rescue::ClassMethods
include MylynConnector::Version::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
View
2  app/controllers/mylyn_connector/versions_controller.rb
@@ -4,6 +4,8 @@ class MylynConnector::VersionsController < ApplicationController
unloadable
include MylynConnector::Rescue::ClassMethods
+ accept_key_auth :all
+
skip_before_filter :verify_authenticity_token
helper MylynConnector::MylynHelper
Please sign in to comment.
Something went wrong with that request. Please try again.