Skip to content

Commit

Permalink
Merge pull request #709 from alphagov/publishing-api-token
Browse files Browse the repository at this point in the history
Use bearer token for publishing-api authentication
  • Loading branch information
elliotcm committed Jan 14, 2016
2 parents 42f6352 + c513a83 commit 72357f8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
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

0 comments on commit 72357f8

Please sign in to comment.