Skip to content
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

DOCS:Added documentation of Keyring Feature #2612

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,130 @@ Common resources that a test might need,
like e.g. a running MSColab server or a QApplication instance for GUI tests,
are collected in :mod:`tests.fixtures` in the form of pytest fixtures that can be requested as needed in tests.

Testing Keyring Features
-------------------------

This document provides step-by-step instructions for testing keyring features using both the command line and Python scripts.

Prerequisites
.............

1. **Confirm the Default Keyring Backend**

Use the following command to list available keyring backends and check which one is currently in use:
::

keyring --list-backends

Command-Line Commands for Keyring
.................................

1. **Set a Password**

Store a password for a specific service and user:
::

keyring set SERVICE_NAME USERNAME

**Example:**
::

keyring set msui [email protected]

- The command will securely prompt you to input a password (e.g., `example_password`).

2. **Get a Password**

Retrieve the stored password for a service and user:
::

keyring get SERVICE_NAME USERNAME

**Example:**
::

keyring get msui [email protected]

**Output:**
::

example_password

3. **Delete a Password**

Remove the stored password for a service and user:
::

keyring delete SERVICE_NAME USERNAME

**Example:**
::

keyring delete msui [email protected]

To confirm the deletion, attempt to retrieve the password:
::

keyring get msui [email protected]

If the password has been deleted, you’ll see an error message such as:
::

No password found for 'msui' and '[email protected]'.

Python Script for Keyring Automation
......................................

1. **Set a Password**

Store a password for a specific service and user:
::

import keyring

keyring.set_password("msui", "[email protected]", "example_password")

2. **Retrieve the Password**

Retrieve the stored password:
::

import keyring

print(keyring.get_password("msui", "[email protected]")) # Output: example_password

3. **Delete a Password**

Delete the stored password:
::

import keyring

keyring.delete_password("msui", "[email protected]")

4. **Verify Deletion**

Attempt to retrieve the deleted password:
::

import keyring

print(keyring.get_password("msui", "[email protected]")) # Output: None or error

Examples of Usage in Command Line
......................................

::

# Set a password
keyring set my_service my_user

# Get the password
keyring get my_service my_user

# Delete the password
keyring delete my_service my_user

Changing the database model
---------------------------

Expand Down
Loading