Skip to content

Commit 9f6d73d

Browse files
committed
security namespace model updates
1 parent b038a95 commit 9f6d73d

File tree

39 files changed

+386
-30
lines changed

39 files changed

+386
-30
lines changed

examples/auth/with_client_secret.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from office365.graph_client import GraphClient
1212
from tests import test_client_id, test_client_secret, test_tenant
1313

14-
client = GraphClient(tenant=test_tenant).with_client_secret(test_client_id, test_client_secret)
14+
client = GraphClient(tenant=test_tenant).with_client_secret(
15+
test_client_id, test_client_secret
16+
)
1517
root_site = client.sites.root.get().execute_query()
1618
print(root_site.web_url)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from office365.graph_client import GraphClient
2+
from tests import test_client_id, test_client_secret, test_tenant
3+
4+
client = GraphClient(tenant=test_tenant).with_client_secret(
5+
test_client_id, test_client_secret
6+
)
7+
8+
result = (
9+
client.reports.authentication_methods.user_registration_details.get().execute_query()
10+
)
11+
for details in result:
12+
print("{0}: {1}".format(details.user_principal_name, details.is_mfa_registered))

examples/sharepoint/auth_user_credential.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
"""
66

77
from office365.sharepoint.client_context import ClientContext
8-
from tests import test_password, test_site_url, test_username, test_team_site_url
8+
from tests import test_password, test_site_url, test_team_site_url, test_username
99

10-
ctx = ClientContext(test_team_site_url).with_user_credentials(test_username, test_password)
10+
ctx = ClientContext(test_team_site_url).with_user_credentials(
11+
test_username, test_password
12+
)
1113
web = ctx.web.get().execute_query()
1214
print(web.url)

generator/import_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ def export_to_file(path, content):
2626
"--endpoint",
2727
dest="endpoint",
2828
help="Import metadata endpoint",
29-
default="graph",
29+
default="sharepoint",
3030
)
3131
parser.add_argument(
3232
"-p",
3333
"--path",
3434
dest="path",
35-
default="./metadata/Graph.xml",
35+
default="./metadata/SharePoint.xml",
3636
help="Import metadata endpoint",
3737
)
3838

generator/metadata/Graph.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29512,6 +29512,7 @@ within the time frame of their original request."/>
2951229512
<Property Name="completedDateTime" Type="Edm.DateTimeOffset"/>
2951329513
<Property Name="createdDateTime" Type="Edm.DateTimeOffset"/>
2951429514
<Property Name="customExtensionCalloutInstances" Type="Collection(graph.customExtensionCalloutInstance)"/>
29515+
<Property Name="justification" Type="Edm.String"/>
2951529516
<Property Name="requestType" Type="graph.accessPackageRequestType"/>
2951629517
<Property Name="schedule" Type="graph.entitlementManagementSchedule"/>
2951729518
<Property Name="state" Type="graph.accessPackageRequestState"/>
@@ -29972,6 +29973,7 @@ within the time frame of their original request."/>
2997229973
<ComplexType Name="accessPackageAssignmentApprovalSettings">
2997329974
<Property Name="isApprovalRequiredForAdd" Type="Edm.Boolean"/>
2997429975
<Property Name="isApprovalRequiredForUpdate" Type="Edm.Boolean"/>
29976+
<Property Name="isRequestorJustificationRequired" Type="Edm.Boolean"/>
2997529977
<Property Name="stages" Type="Collection(graph.accessPackageApprovalStage)"/>
2997629978
</ComplexType>
2997729979
<ComplexType Name="accessPackageAssignmentRequestCallbackData" BaseType="graph.customExtensionData">
@@ -29994,6 +29996,7 @@ within the time frame of their original request."/>
2999429996
<Property Name="allowCustomAssignmentSchedule" Type="Edm.Boolean"/>
2999529997
<Property Name="isApprovalRequiredForAdd" Type="Edm.Boolean"/>
2999629998
<Property Name="isApprovalRequiredForUpdate" Type="Edm.Boolean"/>
29999+
<Property Name="isRequestorJustificationRequired" Type="Edm.Boolean"/>
2999730000
<Property Name="policyDescription" Type="Edm.String"/>
2999830001
<Property Name="policyDisplayName" Type="Edm.String"/>
2999930002
<Property Name="policyId" Type="Edm.String"/>

generator/metadata/SharePoint.xml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,9 @@
807807
<Property Name="IgnoreVersionHistory" Type="Edm.Boolean" Nullable="false"/>
808808
<Property Name="IncludeItemPermissions" Type="Edm.Boolean" Nullable="false"/>
809809
<Property Name="IsMoveMode" Type="Edm.Boolean" Nullable="false"/>
810+
<Property Name="MergeEmailNotifications" Type="Edm.Boolean" Nullable="false"/>
810811
<Property Name="MoveAndShareFileInfo" Type="SP.SPMoveAndShareFileInfo"/>
812+
<Property Name="MoveAndShareItems" Type="Edm.Boolean" Nullable="false"/>
811813
<Property Name="MoveButKeepSource" Type="Edm.Boolean" Nullable="false"/>
812814
<Property Name="NameConflictBehavior" Type="Edm.Int32" Nullable="false"/>
813815
<Property Name="SameWebCopyMoveOptimization" Type="Edm.Boolean" Nullable="false"/>
@@ -1857,6 +1859,7 @@
18571859
<Property Name="CanCurrentUserEditMembership" Type="Edm.Boolean" Nullable="false"/>
18581860
<Property Name="CanCurrentUserManageGroup" Type="Edm.Boolean" Nullable="false"/>
18591861
<Property Name="CanCurrentUserViewMembership" Type="Edm.Boolean" Nullable="false"/>
1862+
<Property Name="ContainsCurrentUser" Type="Edm.Boolean" Nullable="false"/>
18601863
<Property Name="Description" Type="Edm.String"/>
18611864
<Property Name="OnlyAllowMembersViewMembership" Type="Edm.Boolean" Nullable="false"/>
18621865
<Property Name="OwnerTitle" Type="Edm.String"/>
@@ -4889,6 +4892,7 @@
48894892
<EntitySet Name="PlacesEntitys" EntityType="Microsoft.SharePoint.AddToOneDrive.PlacesEntity"/>
48904893
<EntitySet Name="placesInformations" EntityType="Microsoft.SharePoint.AddToOneDrive.placesInformation"/>
48914894
<EntitySet Name="ArchiveFileSizeMetrics" EntityType="Microsoft.SharePoint.Administration.Archiving.ArchiveFileSizeMetric"/>
4895+
<EntitySet Name="SPVivaLearningManagers" EntityType="Microsoft.SharePoint.Administration.Claims.SPVivaLearningManager"/>
48924896
<EntitySet Name="FeatureDefinitions" EntityType="Microsoft.SharePoint.Administration.FeatureDefinition"/>
48934897
<EntitySet Name="SiteMoveServices" EntityType="Microsoft.SharePoint.Administration.SiteMove.Service.SiteMoveService"/>
48944898
<EntitySet Name="SiteRelocationJobManagementServices" EntityType="Microsoft.SharePoint.Administration.SiteMove.Service.SiteRelocationJobManagementService"/>
@@ -8823,9 +8827,6 @@
88238827
<FunctionImport Name="Active" ReturnType="Collection(SP.Publishing.AnnouncementsData)" IsSideEffecting="false" IsBindable="true">
88248828
<Parameter Name="this" Type="SP.Publishing.AnnouncementsController"/>
88258829
</FunctionImport>
8826-
<FunctionImport Name="Channel" ReturnType="Collection(SP.Publishing.ChannelAnnouncement)" IsSideEffecting="false" IsBindable="true">
8827-
<Parameter Name="this" Type="SP.Publishing.AnnouncementsController"/>
8828-
</FunctionImport>
88298830
<FunctionImport Name="FlwPropertyFilteringMapping" IsBindable="true">
88308831
<Parameter Name="this" Type="SP.Publishing.AnnouncementsController"/>
88318832
<Parameter Name="flwPropertyFilteringMapping" Type="Edm.String"/>
@@ -10555,6 +10556,7 @@
1055510556
<FunctionImport Name="Clear" IsBindable="true">
1055610557
<Parameter Name="this" Type="Microsoft.SharePoint.Client.Search.Query.SortCollection"/>
1055710558
</FunctionImport>
10559+
<FunctionImport Name="Microsoft_SharePoint_Client_Search_Administration_DocumentCrawlLog_Create" ReturnType="Microsoft.SharePoint.Client.Search.Administration.DocumentCrawlLog" EntitySet="DocumentCrawlLogs"/>
1055810560
<FunctionImport Name="GetCrawledUrls" ReturnType="SP.SimpleDataTable" IsBindable="true">
1055910561
<Parameter Name="this" Type="Microsoft.SharePoint.Client.Search.Administration.DocumentCrawlLog"/>
1056010562
<Parameter Name="getCountOnly" Type="Edm.Boolean" Nullable="false"/>
@@ -10573,6 +10575,12 @@
1057310575
<Parameter Name="startDateTime" Type="Edm.DateTime" Nullable="false"/>
1057410576
<Parameter Name="endDateTime" Type="Edm.DateTime" Nullable="false"/>
1057510577
</FunctionImport>
10578+
<FunctionImport Name="GetUnsuccesfulCrawledUrlsForEdiscovery" ReturnType="SP.SimpleDataTable" IsBindable="true">
10579+
<Parameter Name="this" Type="Microsoft.SharePoint.Client.Search.Administration.DocumentCrawlLog"/>
10580+
<Parameter Name="displayUrl" Type="Edm.String"/>
10581+
<Parameter Name="startDateTime" Type="Edm.DateTime" Nullable="false"/>
10582+
<Parameter Name="endDateTime" Type="Edm.DateTime" Nullable="false"/>
10583+
</FunctionImport>
1057610584
<FunctionImport Name="Microsoft_SharePoint_Client_Search_Administration_SiteContentProcessingInfoProvider_Create" ReturnType="Microsoft.SharePoint.Client.Search.Administration.SiteContentProcessingInfoProvider" EntitySet="SiteContentProcessingInfoProviders"/>
1057710585
<FunctionImport Name="GetAzureContainerToken" ReturnType="Edm.String" IsBindable="true">
1057810586
<Parameter Name="this" Type="Microsoft.SharePoint.Client.Search.Administration.SiteContentProcessingInfoProvider"/>
@@ -12615,6 +12623,10 @@
1261512623
<Parameter Name="this" Type="SP.AppInstance"/>
1261612624
<Parameter Name="appPackageStream" Type="Edm.Stream"/>
1261712625
</FunctionImport>
12626+
<FunctionImport Name="Microsoft_SharePoint_Administration_Claims_SPVivaLearningManager" ReturnType="Microsoft.SharePoint.Administration.Claims.SPVivaLearningManager" IsComposable="true" EntitySet="SPVivaLearningManagers"/>
12627+
<FunctionImport Name="RegisterListEventReceiver" IsBindable="true">
12628+
<Parameter Name="this" Type="Microsoft.SharePoint.Administration.Claims.SPVivaLearningManager"/>
12629+
</FunctionImport>
1261812630
<FunctionImport Name="Microsoft_SharePoint_AddToOneDrive_MountService_GetRemoteItemInfo" ReturnType="Edm.String">
1261912631
<Parameter Name="request" Type="Microsoft.SharePoint.AddToOneDrive.GetRemoteItemInfoRequest"/>
1262012632
</FunctionImport>
@@ -38180,6 +38192,13 @@
3818038192
<Property Name="Config" Type="Microsoft.SharePoint.Administration.TenantAdmin.Copilot.AdaptiveCardConfig"/>
3818138193
<Property Name="SchemaVersion" Type="Edm.String"/>
3818238194
</ComplexType>
38195+
<ComplexType Name="ReportDetails" BaseType="Microsoft.SharePoint.Administration.TenantAdmin.Copilot.BaseRawDataSources">
38196+
<Property Name="Headers" Type="Collection(Edm.String)"/>
38197+
<Property Name="ReportRows" Type="Collection(Microsoft.SharePoint.Administration.TenantAdmin.Copilot.ReportRow)"/>
38198+
</ComplexType>
38199+
<ComplexType Name="ReportRow">
38200+
<Property Name="Row" Type="Collection(Edm.String)"/>
38201+
</ComplexType>
3818338202
</Schema>
3818438203
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="SP.SiteHealth">
3818538204
<ComplexType Name="SiteHealthResult">
@@ -40478,6 +40497,7 @@
4047840497
<Property Name="EnableSensitivityLabelForPDF" Type="Edm.Boolean" Nullable="false"/>
4047940498
<Property Name="EnableSiteArchive" Type="Edm.Boolean" Nullable="false"/>
4048040499
<Property Name="EnableTenantRestrictionsInsights" Type="Edm.Boolean" Nullable="false"/>
40500+
<Property Name="EnforceRequestDigest" Type="Edm.Boolean" Nullable="false"/>
4048140501
<Property Name="ESignatureAppList" Type="Collection(Edm.String)"/>
4048240502
<Property Name="ESignatureEnabled" Type="Edm.Boolean" Nullable="false"/>
4048340503
<Property Name="ESignatureSiteInfoList" Type="Collection(Microsoft.Online.SharePoint.TenantAdministration.SiteInfoForSitePicker)"/>
@@ -42508,6 +42528,14 @@
4250842528
<Property Name="Id4a81de82eeb94d6080ea5bf63e27023a" Type="Edm.String" Nullable="false"/>
4250942529
</EntityType>
4251042530
</Schema>
42531+
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="Microsoft.SharePoint.Administration.Claims">
42532+
<EntityType Name="SPVivaLearningManager">
42533+
<Key>
42534+
<PropertyRef Name="Id4a81de82eeb94d6080ea5bf63e27023a"/>
42535+
</Key>
42536+
<Property Name="Id4a81de82eeb94d6080ea5bf63e27023a" Type="Edm.String" Nullable="false"/>
42537+
</EntityType>
42538+
</Schema>
4251142539
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="Microsoft.SharePoint.Administration.Archiving">
4251242540
<EntityType Name="ArchiveFileSizeMetric">
4251342541
<Key>

office365/communications/onlinemeetings/collection.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from office365.communications.onlinemeetings.online_meeting import OnlineMeeting
2+
from office365.communications.onlinemeetings.recordings.call import CallRecording
23
from office365.entity_collection import EntityCollection
34
from office365.runtime.queries.create_entity import CreateEntityQuery
45
from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -65,3 +66,31 @@ def create_or_get(
6566
)
6667
self.context.add_query(qry)
6768
return return_type
69+
70+
def get_all_recordings(
71+
self, meeting_organizer_user_id, start_datetime=None, end_datetime=None
72+
):
73+
"""
74+
Get all recordings from scheduled onlineMeeting instances for which the specified user is the organizer.
75+
This API currently doesn't support getting call recordings from channel meetings.
76+
77+
:param str meeting_organizer_user_id: The user identifier of the meeting organizer to filter for artifacts
78+
for meetings organized by the given user identifier.
79+
:param datetime.datetime start_datetime: Optional parameter to filter for artifacts created after the given
80+
start date. The timestamp type represents date and time information using ISO 8601 format and is always
81+
in UTC
82+
:param datetime.datetime end_datetime: Optional parameter to filter for artifacts created before the given
83+
end date. The timestamp type represents date and time information using ISO 8601 format and is always
84+
in UTC
85+
"""
86+
return_type = EntityCollection(self.context, CallRecording)
87+
payload = {
88+
"meetingOrganizerUserId": meeting_organizer_user_id,
89+
"startDateTime": start_datetime,
90+
"endDateTime": end_datetime,
91+
}
92+
qry = ServiceOperationQuery(
93+
self, "getAllRecordings", None, payload, None, return_type
94+
)
95+
self.context.add_query(qry)
96+
return return_type

office365/communications/onlinemeetings/recordings/call.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33

44
class CallRecording(Entity):
55
"""Represents a recording associated with an online meeting."""
6+
7+
@property
8+
def call_id(self):
9+
"""The unique identifier for the call that is related to this recording. Read-only."""
10+
return self.properties.get("callId", None)

office365/directory/directory.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
)
55
from office365.directory.device_local_credential_info import DeviceLocalCredentialInfo
66
from office365.directory.object_collection import DirectoryObjectCollection
7+
from office365.directory.subscriptions.company import CompanySubscription
78
from office365.entity import Entity
89
from office365.entity_collection import EntityCollection
910
from office365.runtime.paths.resource_path import ResourcePath
@@ -50,6 +51,18 @@ def custom_security_attribute_definitions(self):
5051
),
5152
)
5253

54+
@property
55+
def subscriptions(self):
56+
"""List of commercial subscriptions that an organization acquired."""
57+
return self.properties.get(
58+
"subscriptions",
59+
EntityCollection(
60+
self.context,
61+
CompanySubscription,
62+
ResourcePath("subscriptions", self.resource_path),
63+
),
64+
)
65+
5366
def deleted_items(self, entity_type=None):
5467
"""Recently deleted items. Read-only. Nullable."""
5568
if entity_type:

office365/directory/licenses/details.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ def sku_part_number(self):
3434
for example: "AAD_Premium". Read-only
3535
"""
3636
return self.properties.get("skuPartNumber", None)
37+
38+
def get_property(self, name, default_value=None):
39+
if default_value is None:
40+
property_mapping = {"servicePlans": self.service_plans}
41+
default_value = property_mapping.get(name, None)
42+
return super(LicenseDetails, self).get_property(name, default_value)

0 commit comments

Comments
 (0)