Merge branch 'release/4.2' into release/4.3

pull/3212/merge
Jens Ulferts 9 years ago
commit 4b0b57b8ef
  1. 13
      CONTRIBUTING.md
  2. 2
      app/controllers/api/v2/authentication_controller.rb
  3. 5
      config/locales/en.yml
  4. 4
      frontend/package.json
  5. 2
      lib/open_project/authentication.rb
  6. 19
      spec/controllers/api/v2/authentication_spec.rb
  7. 9
      spec/features/work_packages/details/activity_comments_spec.rb
  8. 2
      spec/legacy/support/legacy_assertions.rb
  9. 2
      spec/requests/api/v3/authentication_spec.rb

@ -59,6 +59,19 @@ We will then review your pull request.
Please note that you can add commits after the pull request has been created by pushing
to the branch in your fork.
## Translations
Beginning with OpenProject 4.2.0 the OpenProject core only holds the
english locales and all other locales are stored in
OpenProject-Translations. But since this plugin is hardwired in the
Gemfile, german and other locales are available again.
If you want to contribute to the localization of OpenProject and its
plugins you can do so on [Crowdin](https://crowdin.com/projects/opf).
Once a day we will fetch those locales and upload them to GitHub.
More on this topic can be found [in our blog](https://www.openproject.org/2015/07/10/help-translate-openproject-into-your-language/).
## Important notes
To ensure a smooth workflow for everyone, please take note of the following:

@ -35,7 +35,7 @@ module Api
unloadable
AuthorizationData = Struct.new(:authorized, :authenticated_user_id)
skip_before_filter :require_login
skip_before_filter :require_login, :check_if_login_required
before_filter :api_allows_login, :require_login
def index

@ -578,8 +578,8 @@ en:
error_scm_annotate: "The entry does not exist or cannot be annotated."
error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
error_scm_not_found: "The entry or revision was not found in the repository."
error_unable_delete_status: "Unable to delete work package status because it contains work packages."
error_unable_delete_default_status: "Unable to delete default work package status. Please select another default work package status before deleting the current one."
error_unable_delete_status: "The work package status cannot be deleted since it is used by at least one work package."
error_unable_delete_default_status: "Unable to delete the default work package status. Please select another default work package status before deleting the current one."
error_unable_to_connect: "Unable to connect (%{value})"
error_workflow_copy_source: "Please select a source type or role"
error_workflow_copy_target: "Please select target type(s) and role(s)"
@ -1235,6 +1235,7 @@ en:
project_module_news: "News"
project_module_repository: "Repository"
project_module_time_tracking: "Time tracking"
project_module_timelines: "Timelines"
project_module_wiki: "Wiki"
# possible query parameters (e.g. issue queries),

@ -13,7 +13,7 @@
"gulp-filter": "^2.0.2",
"gulp-jshint": "^1.8.5",
"gulp-livingstyleguide": "0.1.5",
"gulp-protractor": "0.0.11",
"gulp-protractor": "1.0.0",
"gulp-replace": "^0.5.3",
"gulp-ruby-sass": "^0.7.1",
"gulp-util": "^3.0.4",
@ -34,7 +34,7 @@
"mocha": "~1.18.2",
"mocha-jenkins-reporter": "^0.1.2",
"phantomjs": "~1.9.2",
"protractor": "^2.0.0",
"protractor": "^2.1.0",
"sinon": "~1.9.1",
"sinon-chai": "~2.5.0",
"sorted-object": "^1.0.0",

@ -83,7 +83,7 @@ module OpenProject
module_function
def pick_auth_scheme(supported_schemes, default_scheme, request_headers = {})
req_scheme = request_headers['X-Authentication-Scheme']
req_scheme = request_headers['HTTP_X_AUTHENTICATION_SCHEME']
if supported_schemes.include? req_scheme
req_scheme

@ -39,14 +39,23 @@ describe Api::V2::AuthenticationController, type: :controller do
it_should_behave_like 'a controller action with require_login'
describe 'REST API disabled' do
before do
before { allow(Setting).to receive(:rest_api_enabled?).and_return false }
allow(Setting).to receive(:rest_api_enabled?).and_return false
context 'without login_required' do
before { fetch }
fetch
it { expect(response.status).to eq(403) }
end
it { expect(response.status).to eq(403) }
context 'with login_required' do
before do
allow(Setting).to receive(:login_required?).and_return true
fetch
end
it { expect(response.status).to eq(403) }
end
end
describe 'authorization data' do
@ -120,7 +129,7 @@ describe Api::V2::AuthenticationController, type: :controller do
context 'with Session auth scheme requested' do
before do
request.env['X-Authentication-Scheme'] = 'Session'
request.env['HTTP_X_AUTHENTICATION_SCHEME'] = 'Session'
end
it 'has Session auth scheme' do

@ -1,16 +1,23 @@
require 'spec_helper'
require 'features/work_packages/details/inplace_editor/shared_contexts'
describe 'activity comments', js: true do
let(:project) { FactoryGirl.create :project_with_types, is_public: true }
let!(:work_package) { FactoryGirl.create(:work_package, project: project) }
let(:user) { FactoryGirl.create :admin }
include_context 'maximized window'
before do
allow(User).to receive(:current).and_return(user)
visit project_work_packages_path(project)
current_window.resize_to(1440, 800)
ensure_wp_table_loaded
row = page.find("#work-package-#{work_package.id}")
row.double_click
expect(find('#add-comment-text')).to be_present
end

@ -294,7 +294,7 @@ module LegacyAssertionsAndHelpers
context "should not send www authenticate when header accept auth is session #{http_method} #{url}" do
context 'without credentials' do
before do
send(http_method, url, parameters, 'X-Authentication-Scheme' => 'Session')
send(http_method, url, parameters, 'HTTP_X_AUTHENTICATION_SCHEME' => 'Session')
end
it { should respond_with failure_code }
it { should_respond_with_content_type_based_on_url(url) }

@ -101,7 +101,7 @@ describe API::V3, type: :request do
let(:headers) do
auth = basic_auth(username, password.reverse)
auth.merge('X-Authentication-Scheme' => 'Session')
auth.merge('HTTP_X_AUTHENTICATION_SCHEME' => 'Session')
end
before do

Loading…
Cancel
Save