Skip to content

Commit 7f88fae

Browse files
authored
Merge branch 'dev' into WeeklyApiRefresh/202308081559
2 parents d7b4d49 + fbaff2c commit 7f88fae

14 files changed

+565
-151
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ trigger:
2727
include:
2828
- main
2929
- dev
30-
pr: none
30+
pr:
31+
branches:
32+
include:
33+
- main
34+
- dev
3135

3236
jobs:
3337
- job: MsGraphPsSdkCiBuild

.azure-pipelines/generation-templates/workload-modules.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,17 @@ steps:
5454
$ModuleMapping.Keys | ForEach-Object {
5555
$ModuleName = $_
5656
$ModulePath = "$(System.DefaultWorkingDirectory)/src/$ModuleName/$ApiVersion"
57-
if (Test-Path $ModulePath) {
58-
$ModulePsd1 = Join-Path $ModulePath "Microsoft.Graph*.$ModuleName.psd1" -Resolve
59-
$ModulePsm1 = Join-Path $ModulePath "Microsoft.Graph*.$ModuleName.psm1" -Resolve
60-
($ModulePsd1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
61-
($ModulePsm1 | Get-AuthenticodeSignature).Status | Should -Be "Valid"
57+
$ModulePsd1 = Join-Path $ModulePath "Microsoft.Graph*.$ModuleName.psd1"
58+
$ModulePsm1 = Join-Path $ModulePath "Microsoft.Graph*.$ModuleName.psm1"
59+
Write-Host "Validating Authenticode Signature for $ModulePsd1"
60+
Write-Host "Validating Authenticode Signature for $ModulePsm1"
61+
if ((Test-Path $ModulePsd1) -and (Test-Path $ModulePsm1)) {
62+
$ModulePsd1AuthCodeSignature = $ModulePsd1 | Get-AuthenticodeSignature
63+
$ModulePsm1AuthCodeSignature = $ModulePsm1 | Get-AuthenticodeSignature
64+
Write-Host "Authenticode Signature for $ModulePsd1 is $($ModulePsd1AuthCodeSignature.Status)"
65+
Write-Host "Authenticode Signature for $ModulePsm1 is $($ModulePsm1AuthCodeSignature.Status)"
66+
$ModulePsd1AuthCodeSignature.Status | Should -Be "Valid"
67+
$ModulePsm1AuthCodeSignature.Status | Should -Be "Valid"
6268
}
6369
}
6470
}

.github/workflows/projectsbot.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow is used to add new issues to GitHub Projects (Beta)
1+
# This workflow is used to add new issues to GitHub Projects
22

33
name: Add PR to project
44
on:
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- name: Generate token
1313
id: generate_token
14-
uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0
14+
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
1515
with:
1616
app_id: ${{ secrets.GRAPHBOT_APP_ID }}
1717
private_key: ${{ secrets.GRAPHBOT_APP_PEM }}
@@ -25,22 +25,27 @@ jobs:
2525
gh api graphql -f query='
2626
query($org: String!, $number: Int!) {
2727
organization(login: $org){
28-
projectNext(number: $number) {
28+
projectV2(number: $number) {
2929
id
3030
fields(first:20) {
3131
nodes {
32-
id
33-
name
34-
settings
32+
... on ProjectV2SingleSelectField {
33+
id
34+
name
35+
options {
36+
id
37+
name
38+
}
39+
}
3540
}
3641
}
3742
}
3843
}
3944
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
4045
41-
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
42-
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
43-
echo 'TRIAGE_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Needs Triage 🔍") |.id' project_data.json) >> $GITHUB_ENV
46+
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
47+
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
48+
echo 'TRIAGE_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Needs Triage 🔍") |.id' project_data.json) >> $GITHUB_ENV
4449
4550
- name: Add Issue to project
4651
env:
@@ -49,12 +54,12 @@ jobs:
4954
run: |
5055
item_id="$( gh api graphql -f query='
5156
mutation($project:ID!, $issue:ID!) {
52-
addProjectNextItem(input: {projectId: $project, contentId: $issue}) {
53-
projectNextItem {
57+
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
58+
item {
5459
id
5560
}
5661
}
57-
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
62+
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectV2ItemById.item.id')"
5863
5964
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
6065
@@ -69,13 +74,13 @@ jobs:
6974
$status_field: ID!
7075
$status_value: String!
7176
) {
72-
set_status: updateProjectNextItemField(input: {
77+
set_status: updateProjectV2ItemFieldValue(input: {
7378
projectId: $project
7479
itemId: $item
7580
fieldId: $status_field
76-
value: $status_value
81+
value: {singleSelectOptionId: $status_value}
7782
}) {
78-
projectNextItem {
83+
projectV2Item {
7984
id
8085
}
8186
}

src/Teams/beta/custom/GetMgBetaChatRscConfiguration_Get.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,13 @@ protected override void ProcessRecord()
237237
{
238238
await ((Microsoft.Graph.Beta.PowerShell.Runtime.IEventListener)this).Signal(Microsoft.Graph.Beta.PowerShell.Runtime.Events.CmdletBeforeAPICall); if (((Microsoft.Graph.Beta.PowerShell.Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
239239

240+
MGTeamsInternalPermissionGrantPolicyCollection permissionGrantPolicyCollection =
241+
await this.Client.GetPermissionGrantPolicies(selectQuery: "id, resourceScopeType", eventListener: this, sender: this.Pipeline);
242+
243+
WriteVerbose($"Fetched permission grant policies for tenant.");
244+
245+
if (((Microsoft.Graph.Beta.PowerShell.Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
246+
240247
// Get Teams App Settings
241248
Models.IMicrosoftGraphTeamsAppSettings teamsAppSettings = await this.Client.GetTeamsAppSettings(this, Pipeline);
242249

@@ -253,7 +260,11 @@ protected override void ProcessRecord()
253260

254261
RscConfigurationSynthesizer rscConfigurationConverter = new RscConfigurationSynthesizer();
255262
Models.IMicrosoftGraphRscConfiguration microsoftGraphRscConfiguration =
256-
rscConfigurationConverter.ConvertToChatRscConfiguration(teamsAppSettings, authorizationPolicy, this);
263+
rscConfigurationConverter.ConvertToChatRscConfiguration(
264+
permissionGrantPolicyCollection: permissionGrantPolicyCollection,
265+
teamsAppSettings: teamsAppSettings,
266+
authorizationPolicy: authorizationPolicy,
267+
eventListener: this);
257268

258269
WriteObject(microsoftGraphRscConfiguration);
259270

src/Teams/beta/custom/GetMgBetaTeamRscConfiguration_Get.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ protected override void ProcessRecord()
237237
{
238238
await ((Microsoft.Graph.Beta.PowerShell.Runtime.IEventListener)this).Signal(Microsoft.Graph.Beta.PowerShell.Runtime.Events.CmdletBeforeAPICall); if (((Microsoft.Graph.Beta.PowerShell.Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
239239

240+
MGTeamsInternalPermissionGrantPolicyCollection permissionGrantPolicyCollection =
241+
await this.Client.GetPermissionGrantPolicies(selectQuery: "id, resourceScopeType", eventListener: this, sender: this.Pipeline);
242+
243+
WriteVerbose($"Fetched permission grant policies for tenant.");
244+
240245
// Get Group consent settings
241246
MGTeamsInternalTenantConsentSettingsCollection tenantConsentSettingCollection = await this.Client.GetTenantConsentSettings(this, Pipeline);
242247

@@ -252,8 +257,11 @@ protected override void ProcessRecord()
252257
if (((Microsoft.Graph.Beta.PowerShell.Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
253258

254259
RscConfigurationSynthesizer rscConfigurationConverter = new RscConfigurationSynthesizer();
255-
Models.IMicrosoftGraphRscConfiguration microsoftGraphRscConfiguration =
256-
rscConfigurationConverter.ConvertToTeamRscConfiguration(tenantConsentSettingCollection, authorizationPolicy, this);
260+
Models.IMicrosoftGraphRscConfiguration microsoftGraphRscConfiguration = rscConfigurationConverter.ConvertToTeamRscConfiguration(
261+
permissionGrantPolicyCollection,
262+
tenantConsentSettingCollection,
263+
authorizationPolicy,
264+
this);
257265

258266
WriteObject(microsoftGraphRscConfiguration);
259267

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using System.Text;
2+
3+
namespace Microsoft.Graph.Beta.PowerShell.TeamsInternal.Requests
4+
{
5+
/// <summary>
6+
/// Request to get all permission grant policies in the tenant.
7+
/// </summary>
8+
internal class GetPermissionGrantPolicyCollectionRequest : TeamsHttpRequest
9+
{
10+
/// <summary>
11+
/// Select query.
12+
/// </summary>
13+
private readonly string selectQuery;
14+
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="GetPermissionGrantPolicyCollectionRequest"/> class.
17+
/// </summary>
18+
/// <param name="servicePrincipalId">The service principal Id.</param>
19+
internal GetPermissionGrantPolicyCollectionRequest(string selectQuery)
20+
{
21+
this.selectQuery = selectQuery;
22+
}
23+
24+
/// <summary>
25+
/// Gets the Http method for the request.
26+
/// </summary>
27+
/// <returns>The http method.</returns>
28+
protected override System.Net.Http.HttpMethod GetHttpMethod()
29+
{
30+
return Runtime.Method.Get;
31+
}
32+
33+
/// <summary>
34+
/// Gets the base url for the request.
35+
/// </summary>
36+
/// <returns>string containing the base url.</returns>
37+
protected override string GetBaseUrl()
38+
{
39+
StringBuilder sb = new StringBuilder();
40+
sb.Append("https://graph.microsoft.com/beta/policies/permissiongrantpolicies");
41+
if (this.selectQuery != null)
42+
{
43+
sb.Append($"?$select={this.selectQuery}");
44+
}
45+
46+
return sb.ToString();
47+
}
48+
49+
/// <summary>
50+
/// Gets the body of the request as a string.
51+
/// </summary>
52+
/// <returns>The body.</returns>
53+
protected override string GetBodyAsString()
54+
{
55+
return null;
56+
}
57+
}
58+
}

src/Teams/beta/custom/MicrosoftGraphRscConfigurationState.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ public enum MicrosoftGraphRscConfigurationState
2121
/// <summary>
2222
/// Enabled for all apps.
2323
/// </summary>
24-
EnabledForAllApps
24+
EnabledForAllApps,
25+
26+
/// <summary>
27+
/// Enabled for selected group of users.
28+
/// </summary>
29+
EnabledForSelectedGroupOfUsers,
30+
31+
/// <summary>
32+
/// Custom configuration not understood by the sdk.
33+
/// </summary>
34+
Custom
2535
}
2636
}

0 commit comments

Comments
 (0)