Skip to content

Commit a56bc5e

Browse files
committed
examples section linter fixes
1 parent 1a169ab commit a56bc5e

19 files changed

+28
-25
lines changed

examples/__init__.py

Whitespace-only changes.

examples/auth/__init__.py

Whitespace-only changes.

examples/auth/interactive.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
in AAD portal ensure Mobile and Desktop application is added for application
88
and http://localhost is set as redirect uri
99
10-
https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#interactive-and-non-interactive-authentication
10+
https://learn.microsoft.com/en-us/azure/active-directory/develop/
11+
msal-authentication-flows#interactive-and-non-interactive-authentication
1112
"""
1213

1314
from office365.graph_client import GraphClient

examples/auth/interactive_custom.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
in AAD portal ensure Mobile and Desktop application is added for application
88
and http://localhost is set as redirect uri
99
10-
https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#interactive-and-non-interactive-authentication
10+
https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows
11+
#interactive-and-non-interactive-authentication
1112
"""
1213

1314
import msal

examples/auth/with_adal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def acquire_token():
13-
import adal
13+
import adal # pylint: disable=E0401
1414

1515
settings = load_settings()
1616
authority_url = "https://login.microsoftonline.com/{0}".format(

examples/auth/with_client_cert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010

1111
def acquire_token():
12-
with open(test_cert_path, "r"):
13-
private_key = open(test_cert_path).read()
12+
with open(test_cert_path, "r", encoding="utf-8") as f:
13+
private_key = f.read()
1414

1515
authority_url = "https://login.microsoftonline.com/{0}".format(test_tenant_name)
1616
credentials = {"thumbprint": test_cert_thumbprint, "private_key": private_key}

examples/onedrive/__init__.py

Whitespace-only changes.

examples/sharepoint/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/sharepoint/auth_app_principal_aad.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
using Client Credentials flow (app-only access) will return 401 error, meaning this flow is NOT supported (blocked)
88
unless:
99
10-
- AAD app is explicitly granted access via ACS as explained here: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs
11-
- Client Certificate flow is utilized instead as explained here https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread
10+
- AAD app is explicitly granted access via ACS as explained here:
11+
https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs
12+
- Client Certificate flow is utilized instead as explained here:
13+
https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread
1214
1315
1416

examples/sharepoint/auth_certificate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread
1010
1111
Refer wiki for a more details:
12-
https://github.com/vgrem/Office365-REST-Python-Client/wiki/How-to-connect-to-SharePoint-Online-with-certificate-credentials
12+
https://github.com/vgrem/Office365-REST-Python-Client/wiki/
13+
How-to-connect-to-SharePoint-Online-with-certificate-credentials
1314
"""
1415

1516
from office365.sharepoint.client_context import ClientContext

0 commit comments

Comments
 (0)