Office365-rest-python-client

Latest version: v2.5.9

Safety actively analyzes 628406 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 9

2.5.9

Changelog

- 847 Add a note for Entra ID permissions when updating SP metadata fields
- 850 Fixes issue of __str__ raising exception when DecodeUrl is None
- 844 changes for `DriveItem.get_files` and `DriveItem.get_folders` methods to address retrieving all the items (if collection exceeds the default page size)

2.5.8

Changelog

- SharePoint resources addressing enhancements
- introduced methods for granting and revoking delegated & application permissions


Example 1: grant an app role to a client service principal

python
client = GraphClient.with_token_interactive(
tenant_name_or_id, app_client_id, admin_principal_name
)

resource = client.service_principals.get_by_name("Microsoft Graph")
app = client.applications.get_by_app_id(app_client_id)
resource.grant_application(app, "MailboxSettings.Read").execute_query()




Example 2: grant a delegated permission to the client service principal on behalf of a user

python
client = GraphClient.with_token_interactive(
tenant_name_or_id, app_client_id, admin_principal_name
)

resource = client.service_principals.get_by_name("Microsoft Graph")
app_role = "User.Read.All"
user = client.users.get_by_principal_name(test_user_principal_name)
resource.grant_delegated(app_client_id, user, app_role).execute_query()

2.5.7

Changelog

- 836: support for passing a passphrase in `ClientContext.with_client_certificate` method



Example:

python
cert_credentials = {
"tenant": tenant_name,
"client_id": client_id,
"thumbprint": cert_thumbprint,
"cert_path": "selfsignkeyenc.pem",
"passphrase": "Password",
}
ctx = ClientContext(site_url).with_client_certificate(**cert_credentials)
current_web = ctx.web.get().execute_query()

2.5.6

Changelog

- 693: support for folder coloring methods in SharePoint API


Example: create a folder with a color

python
ctx = ClientContext(site_url).with_credentials(user_credentials)
root_folder = ctx.web.default_document_library().root_folder
folder = root_folder.folders.add(
"archive", color_hex=FolderColors.DarkGreen
).execute_query()

2.5.5

Changelog

- 745: better support for Range in OneDrive API


Example: get Range

python
client = GraphClient.with_username_and_password(
tenant_name, client_id, username, password
)
drive_item = client.me.drive.root.get_by_path("Financial Report.xlsx")
worksheets = drive_item.workbook.worksheets.get().execute_query()
if len(worksheets) == 0:
sys.exit("No worksheets found")

worksheet_range = worksheets["Sheet1"].range(address="A1:B3").execute_query()

2.5.4

Changelog

- 794 SharePoint authentication support with GCC High Environments by DEADSCOP
- 802 fix listing folders insted of listing files by Yusuf-ASM
- 801 fix for addressing shared drive items

Page 1 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.