toptranslation_api 4.0.0 → 4.0.1

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: 700cce0881675c0dafc87f6b0164c4de80495fc146ff9487584c1c2d7d1abf02
4
- data.tar.gz: 23384b7748432e0d96ac60f45dba8e6e1c0219fe6c0ed53fdd70c54b7a2e3388
3
+ metadata.gz: 140f94e2e25c9357172453fb58101208550a1098f8048deecd81d1b421ad33ac
4
+ data.tar.gz: a570ab8cf8e7f24c7159010bd1e3d32e94391104e691aef36c8b626c819744ff
5
5
  SHA512:
6
- metadata.gz: 770ef06cea32101858e51b52c0ac6322315174ed484f01ee16809d44242a4d639d12bb18861cb9fbc4ffb0959605095a310ef0255749f595ec8361ea0409617a
7
- data.tar.gz: 710217d985fd2fd1094de9f4d3152cdb8452599b9b414303ad063c326ce6d1b818ef2fa1875a586d23e0c89e658574f35a5463edbea9f584a8c14ed33296e3ec
6
+ metadata.gz: fc1b87834f48e48c83f3afb9c736ef386866b344e7a29a32c00e33102ac3287ba1813e9e66ebdc63cdde2868cc0e0384557061080a7721d1a48d4fd69c7bdca4
7
+ data.tar.gz: eb67def54933c5cba080324dc26f8757e0a3eab55e279823a580cce4c8c27ff1bb387eef5dac1d1e7c71955e3f21a26686e40b9d38cab77d89c41ce68038d33f
@@ -38,20 +38,16 @@ module Toptranslation
38
38
  upload_file(file, uri, &block)
39
39
  end
40
40
 
41
- def sign_in!(options)
42
- return if @access_token
43
-
44
- sign_in_options = {
45
- email: options[:email],
46
- password: options[:password],
47
- application_id: 'pollux'
48
- }.merge(options)
49
-
50
- @access_token = post('/auth/sign_in', sign_in_options)['access_token']
51
-
52
- puts "# Requested access token #{@access_token}" if @verbose
53
-
54
- @access_token
41
+ # @deprecated Email/password sign-in was removed from the Toptranslation
42
+ # API (authentication moved to the auth service) — the endpoint this
43
+ # method used no longer exists. Initialize the client with a static
44
+ # access token instead.
45
+ def sign_in!(_options = {})
46
+ raise Toptranslation::SignInRemovedError,
47
+ 'sign_in! with email/password is no longer supported: the Toptranslation API ' \
48
+ 'removed POST /v2/auth/sign_in. Initialize the client with a static access ' \
49
+ "token instead: Toptranslation.new(access_token: '...'). Contact " \
50
+ 'support@toptranslation.com to obtain a token.'
55
51
  end
56
52
 
57
53
  private
@@ -1,3 +1,3 @@
1
1
  module Toptranslation
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '4.0.1'.freeze
3
3
  end
@@ -20,6 +20,11 @@ require 'toptranslation/resource/upload'
20
20
  require 'toptranslation/resource/user'
21
21
 
22
22
  module Toptranslation
23
+ # Raised when the removed email/password sign-in is used — the API only
24
+ # accepts static access tokens since authentication moved to the
25
+ # Toptranslation auth service.
26
+ class SignInRemovedError < StandardError; end
27
+
23
28
  def self.new(options)
24
29
  Toptranslation::Client.new(options)
25
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toptranslation_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toptranslation GmbH