alula-ruby 2.32.0 → 2.33.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: 43063ce672af06858e496cf576c67b3dde36f63def8a24bf6938c29d5e23a791
4
- data.tar.gz: 7d9e6e0cb79a23d4b41926fc755e77d33ee553ac63df442189704d864741be96
3
+ metadata.gz: 31daa0fd131304d5f8c858b4bc4918c051c4d1a1d7a21d0aa1ebaa627cf10af1
4
+ data.tar.gz: f32fde1b206ba13b62bcd8e125505bded5364c9f90b38a951fe364013d95c53e
5
5
  SHA512:
6
- metadata.gz: cf2277aa997330ee970d857d2721b2f554f1aac4cc5fab30b24ad4438d6419178a54f667c8eaff5361979f6e4c2c8e52b6e949006a8a1fe1fde53cda9173b15f
7
- data.tar.gz: 6160a92f5a53bc2d08d382fd4b8bb1114d1f12f033a0385fdea5577b6d87c99945b58c38426dd3097773429d47fc4bb551425b8b352f676b4939621dcefb841c
6
+ metadata.gz: bdf84b81c4560d36b051477d8db8683fb1621f3ad220318cdd2cda3874380845688744b56c72ddb06c7cbe3702ea0475b3fe90c6294045687e9d50a513e9269c
7
+ data.tar.gz: 9681ddcb9749ac4a2491be164e8ac002f72b34eb47952bf738d6ce26adf99c19d3de4634d48cb27db1a4049f9a48f83eb044ee7782d760908de67e305dfa7a5d
data/VERSION.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  | Version | Date | Description |
4
4
  | ------- | ------------| --------------------------------------------------------------------------- |
5
+ | v2.33.0 | 2026-03-02 | Add a new method `Alula::Oauth#authenticate_with_code` for handling grants of type `authorization_code` |
5
6
  | v2.32.0 | 2026-01-30 | Add a new `Alula::Dcp::Config::ClearStaged` class that calls the DCP API endpoint to clear all staged configuration data for a device. |
6
7
  | v2.31.0 | 2025-12-19 | Adds managed_by and sso_access_level properties in Dealer |
7
8
  | v2.30.0 | 2025-12-16 | Adds M2MCentralStation and PermittedCentralStation |
data/lib/alula/oauth.rb CHANGED
@@ -50,6 +50,35 @@ module Alula
50
50
  end
51
51
  end
52
52
 
53
+ def authenticate_with_code(code: nil, redirect_uri: nil)
54
+ raise Alula::NotConfiguredError.new('did you forget to call Alula::Oauth.configure ?') unless api_url
55
+
56
+ opts = {
57
+ body: {
58
+ grant_type: "authorization_code",
59
+ client_id: client_id,
60
+ client_secret: client_secret,
61
+ }
62
+ }
63
+
64
+ opts[:body][:code] = code if code
65
+ opts[:body][:redirect_uri] = redirect_uri if redirect_uri
66
+
67
+ if self.debug
68
+ opts[:debug_output] = Alula.logger
69
+ # sets the HTTParty logger
70
+ logger Alula.logger, :info
71
+ end
72
+
73
+ response = post(api_url + '/oauth/token', opts)
74
+
75
+ if response.ok?
76
+ Response.new(response.parsed_response)
77
+ else
78
+ Error.new(response.parsed_response)
79
+ end
80
+ end
81
+
53
82
  def refresh(refresh_token:, access_token:)
54
83
  opts = {
55
84
  body: {
data/lib/alula/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alula
4
- VERSION = '2.32.0'
4
+ VERSION = '2.33.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alula-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.32.0
4
+ version: 2.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Johnson