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 +4 -4
- data/VERSION.md +1 -0
- data/lib/alula/oauth.rb +29 -0
- data/lib/alula/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 31daa0fd131304d5f8c858b4bc4918c051c4d1a1d7a21d0aa1ebaa627cf10af1
|
|
4
|
+
data.tar.gz: f32fde1b206ba13b62bcd8e125505bded5364c9f90b38a951fe364013d95c53e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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