Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bearer token for publishing-api authentication #709

Merged
merged 1 commit into from
Jan 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ if ENV['GOVUK_TEMPLATE_DEV']
else
gem 'govuk_template', '0.15.1'
end
gem 'gds-api-adapters', '23.2.2'
gem 'gds-api-adapters', '26.7.0'
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ GEM
crack (0.4.2)
safe_yaml (~> 1.0.0)
debug_inspector (0.0.2)
domain_name (0.5.24)
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
erubis (2.7.0)
execjs (2.6.0)
exifr (1.2.3.1)
fspath (2.1.1)
gds-api-adapters (23.2.2)
gds-api-adapters (26.7.0)
link_header
lrucache (~> 0.1.1)
null_logger
Expand Down Expand Up @@ -127,7 +127,7 @@ GEM
mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.11.2)
netrc (0.10.3)
netrc (0.11.0)
nokogiri (1.6.6.4)
mini_portile (~> 0.6.0)
null_logger (0.0.1)
Expand All @@ -145,7 +145,7 @@ GEM
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.4)
rack-cache (1.2)
rack-cache (1.5.1)
rack (>= 0.4)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -241,7 +241,7 @@ DEPENDENCIES
better_errors
binding_of_caller
capybara (~> 2.5.0)
gds-api-adapters (= 23.2.2)
gds-api-adapters (= 26.7.0)
govuk-lint (~> 0.3.0)
govuk_frontend_toolkit (~> 4.5.0)
govuk_template (= 0.15.1)
Expand Down
10 changes: 9 additions & 1 deletion lib/tasks/publishing_api.rake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ namespace :publishing_api do
task :publish_special_routes do
require 'gds_api/publishing_api/special_route_publisher'

publisher = GdsApi::PublishingApi::SpecialRoutePublisher.new(logger: Logger.new(STDOUT))
publishing_api = GdsApi::PublishingApiV2.new(
Plek.new.find('publishing-api'),
bearer_token: ENV['PUBLISHING_API_BEARER_TOKEN'] || 'example'
)

publisher = GdsApi::PublishingApi::SpecialRoutePublisher.new(
logger: Logger.new(STDOUT),
publishing_api: publishing_api
)

routes = [
{
Expand Down