-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: rework auth flow - part 2 #221
feat: rework auth flow - part 2 #221
Conversation
WalkthroughThe changes introduce a set of updates across multiple files, primarily involving the replacement of a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant CloudModule as Cloud Module
participant CloudClass as Cloud Class
User->>CLI: Run command with cloud option
CLI->>CloudModule: Import SUPPORTED_CLOUDS
CLI->>User: Display help with SUPPORTED_CLOUDS.keys()
User->>CloudModule: Select default cloud
CloudModule->>CloudClass: Initialize with default cloud
User->>CloudModule: Fetch preset account data
CloudModule->>User: Return preset account data
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #221 +/- ##
==========================================
+ Coverage 32.82% 32.94% +0.12%
==========================================
Files 80 80
Lines 6985 6999 +14
==========================================
+ Hits 2293 2306 +13
- Misses 4692 4693 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- library_test.py (2 hunks)
- midealocal/cli.py (2 hunks)
- midealocal/cloud.py (8 hunks)
Additional comments not posted (10)
library_test.py (2)
13-13
: LGTM! Import statement updated correctly.The import statement has been updated to use
SUPPORTED_CLOUDS
, which aligns with the new dictionary name.
34-34
: LGTM! Help message updated correctly.The help message string has been updated to use
SUPPORTED_CLOUDS.keys()
, which aligns with the new dictionary name.midealocal/cli.py (2)
17-17
: LGTM! Import statement updated correctly.The import statement has been updated to use
SUPPORTED_CLOUDS
, which aligns with the new dictionary name.
162-162
: LGTM! Choices for cloud selection updated correctly.The choices for cloud selection have been updated to use
SUPPORTED_CLOUDS.keys()
, which aligns with the new dictionary name.midealocal/cloud.py (6)
Line range hint
29-74
:
LGTM! Dictionary renamed correctly.The dictionary
clouds
has been renamed toSUPPORTED_CLOUDS
, which provides better clarity.Tools
Gitleaks
47-47: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
89-111
: LGTM! New functions added correctly.The functions
get_default_cloud()
andget_preset_account_cloud()
are correctly implemented and provide useful functionality.
291-303
: LGTM! Class initialization updated correctly.The initialization of the class
MeijuCloud
has been updated to useSUPPORTED_CLOUDS
, which aligns with the new dictionary name.
485-502
: LGTM! Class initialization updated correctly.The initialization of the class
MSmartHomeCloud
has been updated to useSUPPORTED_CLOUDS
, which aligns with the new dictionary name.
679-687
: LGTM! Class initialization updated correctly.The initialization of the class
MideaAirCloud
has been updated to useSUPPORTED_CLOUDS
, which aligns with the new dictionary name.
820-828
: LGTM! Function updated correctly.The function
get_midea_cloud
has been updated to useSUPPORTED_CLOUDS
, which aligns with the new dictionary name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- library_test.py (2 hunks)
- midealocal/cli.py (2 hunks)
- midealocal/cloud.py (8 hunks)
Files skipped from review due to trivial changes (1)
- library_test.py
Files skipped from review as they are similar to previous changes (2)
- midealocal/cli.py
- midealocal/cloud.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add coverage for the new method inside cloud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- tests/cloud_test.py (2 hunks)
Additional comments not posted (2)
tests/cloud_test.py (2)
60-63
: Verify the correctness of the default cloud name.Ensure that
MSmartHome
is the correct default cloud name as per the implementation ofget_default_cloud
.
70-75
: Verify the correctness of the preset cloud account credentials.Ensure that the expected values for
username
,password
, andcloud_name
are correct as per the implementation ofget_preset_account_cloud
.
🤖 I have created a release *beep* *boop* --- ## [2.0.0](v1.3.2...v2.0.0) (2024-07-12) ### ⚠ BREAKING CHANGES * rework auth flow - part 1 ([#219](#219)) ([d8ac4fb](d8ac4fb)) ### Features * **cli:** download protocol ([#214](#214)) ([7a99374](7a99374)) * rework auth flow - part 1 ([#219](#219)) ([d8ac4fb](d8ac4fb)) * rework auth flow - part 2 ([#221](#221)) ([f74ff8e](f74ff8e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Reworked authentication flow to enhance user security and ease of use. - CLI download protocol; - **BREAKING CHANGE** - Cloud key retrieval segmentated. Updating to version 2.0.0 is required for continued functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
See #205 for reference <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new functions to retrieve default cloud names and preset account credentials. - **Bug Fixes** - Updated cloud selection options to reflect the correct cloud names. - **Tests** - Added test cases for new functions related to default cloud selection and preset account data retrieval. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Lucas Mindêllo de Andrade <lucas@mindello.com.br>
🤖 I have created a release *beep* *boop* --- ## [2.0.0](v1.3.2...v2.0.0) (2024-07-12) ### ⚠ BREAKING CHANGES * rework auth flow - part 1 ([#219](#219)) ([d8ac4fb](d8ac4fb)) ### Features * **cli:** download protocol ([#214](#214)) ([7a99374](7a99374)) * rework auth flow - part 1 ([#219](#219)) ([d8ac4fb](d8ac4fb)) * rework auth flow - part 2 ([#221](#221)) ([f74ff8e](f74ff8e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Reworked authentication flow to enhance user security and ease of use. - CLI download protocol; - **BREAKING CHANGE** - Cloud key retrieval segmentated. Updating to version 2.0.0 is required for continued functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
See #205 for reference
Summary by CodeRabbit
New Features
Bug Fixes
Tests