ian-young / API_Scripts

API scripts to help automate tasks
GNU General Public License v3.0
0 stars 1 forks source link

[FR] Optional TOTP #35

Closed ian-young closed 2 months ago

ian-young commented 2 months ago

Feature Name

Description

Added the ability to optionally include a TOTP so it is no longer required for all accounts.

Fixes #23

Type of change

How Has This Been Tested?

This was tested by:

Test Configuration:

Checklist:

Summary by Sourcery

Introduce optional TOTP support for authentication, refactor authentication functions to accommodate this change, and enhance error handling for better clarity.

New Features:

Enhancements:

Documentation:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request introduces an optional TOTP (Time-based One-Time Password) feature, allowing users to authenticate without requiring TOTP for all accounts. The changes primarily involve refactoring the authentication logic to make TOTP optional and updating the relevant function calls across multiple files.

File-Level Changes

Files Changes
VCE/delete_device.py
VCE/gather_devices.py
Demo_Org/delete_archives.py
Demo_Org/list_archives.py
Coding_Challenges/trigger_lockdown.py
Coding_Challenges/schedule_override.py
Coding_Challenges/open_door.py
Coding_Challenges/Org_Management/inv_gather_devices.py
QoL/authentication.py
QoL/api_endpoints.py
Coding_Challenges/command_login.py
Refactored the authentication logic to make TOTP optional. Removed redundant login and logout functions from multiple files and replaced them with a centralized implementation in QoL/authentication.py. Updated function calls to use the new optional TOTP parameter.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.