Skip to content

Commit

Permalink
Merge pull request #939 from alphagov/forward-user-organisation-id
Browse files Browse the repository at this point in the history
Forward X-Govuk-Authenticated-User-Organisation header
  • Loading branch information
theseanything authored Jul 17, 2019
2 parents ca18972 + 53a114e commit f51bcdd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Unreleased

* Adds middleware to allow the header `X-Govuk-Authenticated-User-Organisation`
to be passed along to content-store.

# 59.5.1

* Adds `combine_mode` parameter to Email Alert API test helpers
Expand Down
9 changes: 7 additions & 2 deletions lib/gds_api/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ class Railtie < Rails::Railtie
end

initializer "gds_api.initialize_govuk_authenticated_user_sniffer" do |app|
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for X-GOVUK-Authenticated-User header"
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for X-Govuk-Authenticated-User header"
app.middleware.use GdsApi::GovukHeaderSniffer, 'HTTP_X_GOVUK_AUTHENTICATED_USER'
end

initializer "gds_api.initialize_govuk_authenticated_user_organisation_sniffer" do |app|
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for X-Govuk-Authenticated-User-Organisation header"
app.middleware.use GdsApi::GovukHeaderSniffer, 'HTTP_X_GOVUK_AUTHENTICATED_USER_ORGANISATION'
end

initializer "gds_api.initialize_govuk_content_id_sniffer" do |app|
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for GOVUK-Auth-Bypass-Id header"
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for Govuk-Auth-Bypass-Id header"
app.middleware.use GdsApi::GovukHeaderSniffer, 'HTTP_GOVUK_AUTH_BYPASS_ID'
end
end
Expand Down

0 comments on commit f51bcdd

Please sign in to comment.