publishing_platform_api_adapters 0.14.10 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 159b5d93581543e942300228779aebce493cc1882cdd40da0d90dd7491a2807b
4
- data.tar.gz: 5fef153339faa91ab5f16afd56cc357a213a6d5c30617934c8ff43f5788ef1a4
3
+ metadata.gz: d2e1a843c826f9eb2a5600e4a49a4329ddb2035d440efed9a5306f941d42d18d
4
+ data.tar.gz: 76d77976bc29dc9879233474cd03028954ed1e59c73b353e5907da9c75984ec0
5
5
  SHA512:
6
- metadata.gz: a470724b0f1a09d209759808e29bb3425ecd3ec556ab83c27370b0f1bcc314389986c1bbbc49a6ea657de71cba938068728b8e000aa918cd4f83e23128a04257
7
- data.tar.gz: e3662d609b742f8e5247240c0118cb67cbd0cd23d20448bc8ff44805d6b9c1115ca2cbda3f26fc4e5355c440dac0fbbccd068ccbc61c25f1fd5163fbca661a7d
6
+ metadata.gz: 3aa7d23e277b3da12fe39595f37e5d79a9c07dcc863af6ee7eb4ae4b5d7d05e106ff8f3c957c896e743beed07c4f28e50b5f950c539a7bcae11b4f2dfcc42e0f
7
+ data.tar.gz: fc541ef87badcfb144e1136dfd8b586adf5eace8ff697a72941e2bb06512cf68322e0b2483c1314acee6f845f3bd66c4eb9b9266f26015d394cdf11fc484d5e3
@@ -0,0 +1,17 @@
1
+ require_relative "base"
2
+
3
+ class PublishingPlatformApi::SignonApi < PublishingPlatformApi::Base
4
+ # Get users with specific UUIDs
5
+ #
6
+ # @param uuids [Array]
7
+ #
8
+ # signon_api.users(
9
+ # ["7ac47b33-c09c-4c1d-a9a7-0cfef99081ac"],
10
+ # )
11
+ #
12
+ # @return [PublishingPlatformApi::Response] A response containing a list of users with the specified UUIDs
13
+ def get_users(uuids:)
14
+ query = query_string(uuids:)
15
+ get_json("#{endpoint}/api/users#{query}")
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PublishingPlatformApi
4
- VERSION = "0.14.10"
4
+ VERSION = "0.15.0"
5
5
  end
@@ -7,6 +7,7 @@ require "publishing_platform_api/publishing_api"
7
7
  require "publishing_platform_api/organisations"
8
8
  require "publishing_platform_api/router"
9
9
  require "publishing_platform_api/search"
10
+ require "publishing_platform_api/signon_api"
10
11
 
11
12
  # @api documented
12
13
  module PublishingPlatformApi
@@ -83,4 +84,17 @@ module PublishingPlatformApi
83
84
  options,
84
85
  )
85
86
  end
87
+
88
+ # Creates a PublishingPlatformApi::SignonApi adapter
89
+ #
90
+ # This will set a bearer token if a SIGNON_API_BEARER_TOKEN environment
91
+ # variable is set
92
+ #
93
+ # @return [PublishingPlatformApi::SignonApi]
94
+ def self.signon_api(options = {})
95
+ PublishingPlatformApi::SignonApi.new(
96
+ PublishingPlatformLocation.find("signon"),
97
+ { bearer_token: ENV["SIGNON_API_BEARER_TOKEN"] }.merge(options),
98
+ )
99
+ end
86
100
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publishing_platform_api_adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.10
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Publishing Platform
@@ -200,6 +200,7 @@ files:
200
200
  - lib/publishing_platform_api/response.rb
201
201
  - lib/publishing_platform_api/router.rb
202
202
  - lib/publishing_platform_api/search.rb
203
+ - lib/publishing_platform_api/signon_api.rb
203
204
  - lib/publishing_platform_api/test_helpers/asset_manager.rb
204
205
  - lib/publishing_platform_api/test_helpers/common_responses.rb
205
206
  - lib/publishing_platform_api/test_helpers/content_item_helpers.rb