hanko-ruby 0.1.1 → 0.1.3

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: 73c45486ef99cb5a9cabbdfaa4fa4900eb336f5cd96f9699c0f8e5cbff32d7f1
4
- data.tar.gz: 46eacc55fd29afc575bd7bb4c829ab878c84c4d73d9e811087b124bcbbede268
3
+ metadata.gz: c3bcb0bf4034664893eb87b40eaa2b94d3b72a17ee487ab14d3d5800bb4a0035
4
+ data.tar.gz: ee7e2172d01844212e168452f7e245922f9d1bfca48dc895b76b3c76307a136d
5
5
  SHA512:
6
- metadata.gz: d929d9d4647418c5e4ff0aa947cedac5dced6b50cb26bb22c4746c0a09489cee4071a18ee748becfaea22d991a852ed9ee3a3686904968910ad1f89e1fca6f67
7
- data.tar.gz: ef0ff26d1c4febd94375452e482e79b2758681bd1db83780f8ec46da11bb5a91e3d701f7d4be88450ffd8a5b0c241293ec539ceccf239f11bd27a2bb19173c3a
6
+ metadata.gz: ae1d89e2697a5a92ca3f1906f84f55e9249966a8ff80e79194cb3bb781789dee5cb8de48d648d199e500be08163ad0f86af36c83513ce6cb0583980b2e840cea
7
+ data.tar.gz: e30e6de9ae56bb8a9240c36d8c7b90f8281f5942722ade88d556597e9f9a9a252e062d2ad915f8808668c8a15f8e84bd98e8571c62a59aa53d7dd9fed96d855a
@@ -11,7 +11,7 @@ module Hanko
11
11
  # @param connection [Hanko::Connection] the HTTP connection to use
12
12
  # @return [AuditLogs] a new AuditLogs instance
13
13
  def initialize(connection)
14
- super(connection, "/audit_logs")
14
+ super(connection, '/audit_logs')
15
15
  end
16
16
  end
17
17
  end
@@ -16,11 +16,11 @@ module Hanko
16
16
  @connection = connection
17
17
  end
18
18
 
19
- # Set an email address as the primary email for the user.
19
+ # Mark an email address as the primary email for the user.
20
20
  #
21
21
  # @param email_id [String] the unique identifier of the email to make primary
22
22
  # @return [Resource] the updated email resource
23
- def set_primary(email_id)
23
+ def make_primary(email_id)
24
24
  response = @connection.post("#{@base_path}/#{email_id}/set_primary")
25
25
  parse_resource(response.body)
26
26
  end
@@ -43,10 +43,10 @@ module Hanko
43
43
 
44
44
  # Delete the user's password.
45
45
  #
46
- # @return [Boolean] true if deletion was successful
46
+ # @return [void]
47
47
  def delete
48
48
  @connection.delete(@base_path)
49
- true
49
+ nil
50
50
  end
51
51
  end
52
52
  end
@@ -11,7 +11,7 @@ module Hanko
11
11
  # @param connection [Hanko::Connection] the HTTP connection to use
12
12
  # @return [Users] a new Users instance
13
13
  def initialize(connection)
14
- super(connection, "/users")
14
+ super(connection, '/users')
15
15
  @connection = connection
16
16
  end
17
17
 
@@ -11,7 +11,7 @@ module Hanko
11
11
  # @param connection [Hanko::Connection] the HTTP connection to use
12
12
  # @return [Webhooks] a new Webhooks instance
13
13
  def initialize(connection)
14
- super(connection, "/webhooks")
14
+ super(connection, '/webhooks')
15
15
  end
16
16
  end
17
17
  end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "admin/users"
4
- require_relative "admin/emails"
5
- require_relative "admin/passwords"
6
- require_relative "admin/sessions"
7
- require_relative "admin/webauthn_credentials"
8
- require_relative "admin/metadata"
9
- require_relative "admin/webhooks"
10
- require_relative "admin/audit_logs"
3
+ require_relative 'admin/users'
4
+ require_relative 'admin/emails'
5
+ require_relative 'admin/passwords'
6
+ require_relative 'admin/sessions'
7
+ require_relative 'admin/webauthn_credentials'
8
+ require_relative 'admin/metadata'
9
+ require_relative 'admin/webhooks'
10
+ require_relative 'admin/audit_logs'
11
11
 
12
12
  module Hanko
13
13
  module Api
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "json"
3
+ require 'json'
4
4
 
5
5
  module Hanko
6
6
  module Api
@@ -57,10 +57,10 @@ module Hanko
57
57
  # Delete a resource by its ID.
58
58
  #
59
59
  # @param id [String] the unique identifier of the resource
60
- # @return [Boolean] true if deletion was successful
60
+ # @return [void]
61
61
  def delete(id)
62
62
  @connection.delete("#{@base_path}/#{id}")
63
- true
63
+ nil
64
64
  end
65
65
 
66
66
  private
@@ -18,7 +18,7 @@ module Hanko
18
18
  # @param params [Hash] optional parameters for the login flow
19
19
  # @return [FlowResponse] the login flow response
20
20
  def login(**params)
21
- post_flow("/login", params)
21
+ post_flow('/login', params)
22
22
  end
23
23
 
24
24
  # Initiate a registration flow.
@@ -26,7 +26,7 @@ module Hanko
26
26
  # @param params [Hash] optional parameters for the registration flow
27
27
  # @return [FlowResponse] the registration flow response
28
28
  def registration(**params)
29
- post_flow("/registration", params)
29
+ post_flow('/registration', params)
30
30
  end
31
31
 
32
32
  # Initiate a profile management flow.
@@ -34,7 +34,7 @@ module Hanko
34
34
  # @param params [Hash] optional parameters for the profile flow
35
35
  # @return [FlowResponse] the profile flow response
36
36
  def profile(**params)
37
- post_flow("/profile", params)
37
+ post_flow('/profile', params)
38
38
  end
39
39
 
40
40
  private
@@ -17,7 +17,7 @@ module Hanko
17
17
  #
18
18
  # @return [Resource] the validated session resource
19
19
  def validate
20
- response = @connection.get("/sessions/validate")
20
+ response = @connection.get('/sessions/validate')
21
21
  Resource.new(JSON.parse(response.body))
22
22
  end
23
23
 
@@ -26,7 +26,7 @@ module Hanko
26
26
  # @param session_token [String] the session token to validate
27
27
  # @return [Resource] the validated session resource
28
28
  def validate_token(session_token)
29
- response = @connection.post("/sessions/validate", session_token: session_token)
29
+ response = @connection.post('/sessions/validate', session_token: session_token)
30
30
  Resource.new(JSON.parse(response.body))
31
31
  end
32
32
  end
@@ -17,7 +17,7 @@ module Hanko
17
17
  #
18
18
  # @return [Resource] the JWKS resource
19
19
  def jwks
20
- response = @connection.get("/.well-known/jwks.json")
20
+ response = @connection.get('/.well-known/jwks.json')
21
21
  Resource.new(JSON.parse(response.body))
22
22
  end
23
23
 
@@ -25,7 +25,7 @@ module Hanko
25
25
  #
26
26
  # @return [Resource] the configuration resource
27
27
  def config
28
- response = @connection.get("/.well-known/config")
28
+ response = @connection.get('/.well-known/config')
29
29
  Resource.new(JSON.parse(response.body))
30
30
  end
31
31
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "public/sessions"
4
- require_relative "public/well_known"
5
- require_relative "public/flow"
3
+ require_relative 'public/sessions'
4
+ require_relative 'public/well_known'
5
+ require_relative 'public/flow'
6
6
 
7
7
  module Hanko
8
8
  module Api
@@ -26,10 +26,10 @@ module Hanko
26
26
  # @param data [Hash] the parsed JSON response from a flow endpoint
27
27
  def initialize(data)
28
28
  @raw = data
29
- @status = data["status"]&.to_sym
30
- @actions = (data["actions"] || []).map { |a| Resource.new(a) }
31
- @session_token = data.dig("payload", "session_token")
32
- @user_id = data.dig("payload", "user_id")
29
+ @status = data['status']&.to_sym
30
+ @actions = (data['actions'] || []).map { |a| Resource.new(a) }
31
+ @session_token = data.dig('payload', 'session_token')
32
+ @user_id = data.dig('payload', 'user_id')
33
33
  end
34
34
 
35
35
  # Returns true when the flow has completed successfully.
data/lib/hanko/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hanko
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanko-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Ruiz
@@ -89,7 +89,7 @@ licenses:
89
89
  - MIT
90
90
  metadata:
91
91
  homepage_uri: https://github.com/fruizg0302/hanko-ruby
92
- source_code_uri: https://github.com/fruizg0302/hanko-ruby
92
+ source_code_uri: https://github.com/fruizg0302/hanko-ruby/tree/main/hanko
93
93
  changelog_uri: https://github.com/fruizg0302/hanko-ruby/blob/main/CHANGELOG.md
94
94
  rubygems_mfa_required: 'true'
95
95
  rdoc_options: []