Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
40 changes: 40 additions & 0 deletions src/ChangeNotifications/ChangeNotifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,43 @@ require:
``` yaml
# Directives go here!
```

### Wrapper migration audit

The shared file contains no cmdlet suppressions or renames and no parameter
aliases/transforms or schema/response directives to defer. The AutoRest require
and placeholder above remain unchanged. This audit excludes `src/readme.graph.md`
and both profile-local `readme.md` files; their directives are not migrated.

`wrapper/ChangeNotifications_directiveMigrationMap.json` therefore has an empty
`mappings` array, not invented directive-to-operation mappings. Its separate audit
records exact HTTP method/path/operation-ID evidence from both required
`openApiDocs_KiotaCompat` specifications: seven operations in each profile.
Neither profile is excluded. Revalidation against the merged #3849 target also
refreshes the aligned `subscription_*` operation IDs and spec hashes. The current
compatible v1.0 spec now includes `getVapidPublicKey()`, unlike the original
six-operation audit; that spec refresh is not a shared-directive change.

`ChangeNotifications_cmdletConfigurations.cs` intentionally remains empty.
Structural naming supplies subscription CRUD names and the action/function
names. Existing v1.0 parity data renames the structural
`Invoke-MgSubscriptionReauthorize` to `Invoke-MgReauthorizeSubscription`; beta
currently retains the structural name. Beta's structural
`Get-MgSubscriptionGetVapidPublicKey` also differs from the legacy beta published noun
`Get-MgBetaSubscriptionVapidPublicKey`. These baseline naming differences are not
shared directives and do not justify new overrides in this audit.

`tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs`
checks the empty audit and pins every compatible operation's identity,
classification, unsuppressed status, structural name, and data-aware name in both
profiles with derived data enabled and disabled. The profile is separate runtime
context on naming/suppression calls, not authored `GeneratorConfig` state.
Full generation/build evidence is a separate gate; existing tracked
output directories are `wrapper/v1.0` and `wrapper/Beta`.

The module-specific mutation regression also pins the merged #3886 contract:
`Update-MgSubscription` sends one PATCH and does not read the subscription back.
A 204 response produces no object; a model-bearing 200 returns that model.
Callers may explicitly use `Get-MgSubscription` for an independent read. The
PATCH operation has no native query inputs, so GET-only parameters are not
added to Update and no readback switch or selector is introduced.
6 changes: 3 additions & 3 deletions src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"descriptionHash": "E53648C740810AA50C7438897FBB143D286760102F13C6B81BCE8FE0251DBB3FC0248686673119F586579444A35A9615A9643D4D1055AFA243FEF8FEC43E0689",
"descriptionLocation": "../../../../../openApiDocs_KiotaCompat/Beta/ChangeNotifications.yml",
"descriptionHash": "F5354FDC96BF1B98800BD52F1C40992665344C16C4ADFA4A9E38F492E8BED3F3F5E34B188E147C0FFB6280DF9465451089021B234CDAA5502689F0761A8F4B53",
"descriptionLocation": "../../../../../openApiDocs_KiotaCompat/beta/ChangeNotifications.yml",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.34.1",
"kiotaVersion": "1.36.1",
"clientClassName": "ApiClient",
"typeAccessModifier": "Public",
"clientNamespaceName": "Microsoft.Graph.PowerShell.ChangeNotifications.Client",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class GetMgSubscriptionCommand : GraphClientCmdlet




[Parameter(Mandatory = false)]
[Alias("Select")]
public string[]? Property { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class GetMgSubscriptionGetVapidPublicKeyCommand : GraphClientCmdlet
protected override void ProcessRecord()
{

var requestAdapter = GetRequestAdapter();
var requestAdapter = GetRequestAdapter("beta");
var client = new ApiClient(requestAdapter);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class GetMgSubscription_GetCommand : GraphClientCmdlet
protected override void ProcessRecord()
{

var requestAdapter = GetRequestAdapter();
var requestAdapter = GetRequestAdapter("beta");
var client = new ApiClient(requestAdapter);

Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.Subscription? result;
Expand All @@ -44,6 +44,7 @@ protected override void ProcessRecord()




AddRequestHeaders(requestConfiguration.Headers);
}).GetAwaiter().GetResult();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class GetMgSubscription_ListCommand : GraphClientCmdlet
protected override void ProcessRecord()
{

var requestAdapter = GetRequestAdapter();
var requestAdapter = GetRequestAdapter("beta");
var client = new ApiClient(requestAdapter);

Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.SubscriptionCollectionResponse? result;
Expand Down Expand Up @@ -93,6 +93,7 @@ protected override void ProcessRecord()




AddRequestHeaders(requestConfiguration.Headers);
}).GetAwaiter().GetResult();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected override void ProcessRecord()
return;


var requestAdapter = GetRequestAdapter();
var requestAdapter = GetRequestAdapter("beta");
var client = new ApiClient(requestAdapter);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected override void ProcessRecord()



var requestAdapter = GetRequestAdapter();
var requestAdapter = GetRequestAdapter("beta");
var client = new ApiClient(requestAdapter);

Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.Subscription? result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected override void ProcessRecord()
if (!ShouldProcess(SubscriptionId, "Remove"))
return;

var requestAdapter = GetRequestAdapter();
var requestAdapter = GetRequestAdapter("beta");
var client = new ApiClient(requestAdapter);

// DeleteAsync returns a plain Task: a standard delete response has no body.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected override void ProcessRecord()



var requestAdapter = GetRequestAdapter();
var requestAdapter = GetRequestAdapter("beta");
var client = new ApiClient(requestAdapter);

Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.Subscription? result;
Expand All @@ -161,20 +161,6 @@ protected override void ProcessRecord()
return;
}


if (result is null)
{
WriteVerbose("PATCH succeeded with no response body, re-fetching the updated resource.");
try
{
result = client.Subscriptions[SubscriptionId].GetAsync().GetAwaiter().GetResult();
}
catch (Exception ex) when (ex is not PipelineStoppedException && ex is not OperationCanceledException)
{
ThrowGraphRequestFailed(ex, SubscriptionId);
return;
}
}
if (result is not null)
WriteObject(result);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"descriptionLocation": "../../../../../openApiDocs_KiotaCompat/Beta/ChangeNotifications.yml"
"descriptionLocation": "../../../../../openApiDocs_KiotaCompat/beta/ChangeNotifications.yml"
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,16 @@
<ProjectReference Include="..\..\..\GraphWrapperRuntime\Runtime\Microsoft.Graph.Wrapper.Runtime.csproj" />
</ItemGroup>

<!-- The module folder may carry ONLY the wrapper assemblies plus the kiota dependencies the
installed Microsoft.Graph.Authentication module does not ship (Std.UriTemplate,
Microsoft.Kiota.Serialization.Multipart). Every other dependency must resolve from that
module's isolated load context: a copy here loads a second type identity into the default
<!-- The module folder carries ONLY the wrapper assemblies. Authentication ships the complete
Kiota dependency closure and bridges its contracts to generated cmdlets. Every dependency
must resolve from that module's isolated load context: a copy here loads a second type identity into the default
context, and the first request through the shared session pipeline dies casting between
the two (proven live: ObservabilityOptions, kiota middleware vs wrapper adapter).
Removal is by package identity, not filename, so the kept assemblies' versions stay
derived from the restore graph instead of being pinned here. -->
Removal is by package identity, not filename. -->
<Target Name="PruneModuleBin" AfterTargets="ResolveReferences">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)"
Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != '' And '%(ReferenceCopyLocalPaths.NuGetPackageId)' != 'Std.UriTemplate' And '%(ReferenceCopyLocalPaths.NuGetPackageId)' != 'Microsoft.Kiota.Serialization.Multipart'" />
Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != ''" />
</ItemGroup>
</Target>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"mappings": [],
"audit": {
"module": "ChangeNotifications",
"source": "src/ChangeNotifications/ChangeNotifications.md",
"disposition": "NoSharedDirectives",
"sharedCmdletDirectiveCount": 0,
"deferredParameterDirectiveCount": 0,
"deferredSchemaDirectiveCount": 0,
"excludedProfiles": [],
"ignoredSources": [
"src/readme.graph.md",
"src/ChangeNotifications/v1.0/readme.md",
"src/ChangeNotifications/beta/readme.md"
],
"notes": "These are unaffected-operation audit evidence, not directive mappings. No curated overrides are needed. Revalidated after #3849 against target 08e409a6aa8fd48736b8f9a9199559f46fc0d1ad: compatible operation IDs now align with the original subscription_* IDs; compatible v1.0 now also includes getVapidPublicKey(). Existing v1.0 parity data renames reauthorize; action/function naming differences from the legacy SDK remain baseline behavior. Runtime profile context is passed separately from shared GeneratorConfig, with derived data both enabled and disabled.",
"profiles": {
"v1.0": {
"spec": "openApiDocs_KiotaCompat/v1.0/ChangeNotifications.yml",
"specGitBlob": "e53bd7d80255a87fe5c11b94c5d1f09e15adc854",
"trackedOutputDirectory": "src/ChangeNotifications/wrapper/v1.0",
"operations": [
{
"method": "GET",
"path": "/subscriptions",
"operationId": "subscription_ListSubscription"
},
{
"method": "POST",
"path": "/subscriptions",
"operationId": "subscription_CreateSubscription"
},
{
"method": "GET",
"path": "/subscriptions/{subscription-id}",
"operationId": "subscription_GetSubscription"
},
{
"method": "PATCH",
"path": "/subscriptions/{subscription-id}",
"operationId": "subscription_UpdateSubscription"
},
{
"method": "DELETE",
"path": "/subscriptions/{subscription-id}",
"operationId": "subscription_DeleteSubscription"
},
{
"method": "POST",
"path": "/subscriptions/{subscription-id}/reauthorize",
"operationId": "subscription_reauthorize"
},
{
"method": "GET",
"path": "/subscriptions/getVapidPublicKey()",
"operationId": "subscription_getVapidPublicKey"
}
]
},
"beta": {
"spec": "openApiDocs_KiotaCompat/beta/ChangeNotifications.yml",
"specGitBlob": "14bf6c727c87c5433274bfec78a4a681169e5390",
"trackedOutputDirectory": "src/ChangeNotifications/wrapper/Beta",
"operations": [
{
"method": "GET",
"path": "/subscriptions",
"operationId": "subscription_ListSubscription"
},
{
"method": "POST",
"path": "/subscriptions",
"operationId": "subscription_CreateSubscription"
},
{
"method": "GET",
"path": "/subscriptions/{subscription-id}",
"operationId": "subscription_GetSubscription"
},
{
"method": "PATCH",
"path": "/subscriptions/{subscription-id}",
"operationId": "subscription_UpdateSubscription"
},
{
"method": "DELETE",
"path": "/subscriptions/{subscription-id}",
"operationId": "subscription_DeleteSubscription"
},
{
"method": "POST",
"path": "/subscriptions/{subscription-id}/reauthorize",
"operationId": "subscription_reauthorize"
},
{
"method": "GET",
"path": "/subscriptions/getVapidPublicKey()",
"operationId": "subscription_getVapidPublicKey"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,30 @@ public partial class Subscription : global::Microsoft.Graph.PowerShell.ChangeNot
#nullable restore
#else
public string Resource { get; set; }
#endif
/// <summary>Optional. The application server&apos;s VAPID public key, base64url-encoded (P-256 uncompressed point, 65 bytes pre-encoding). Obtained by calling the getVapidPublicKey function on the subscription collection. The browser passes this value to PushManager.subscribe({ applicationServerKey: vapidPublicKey }) to bind the push subscription to this server identity. Required when notificationUrl targets a known Web Push service origin (for example, *.push.apple.com, fcm.googleapis.com, updates.push.services.mozilla.com); rejected with 400 Bad Request if supplied on a standard webhook subscription. For more information, see RFC 8292.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? VapidPublicKey { get; set; }
#nullable restore
#else
public string VapidPublicKey { get; set; }
#endif
/// <summary>Optional. The subscriber&apos;s ECDH public key, base64url-encoded (P-256 uncompressed point, 65 bytes pre-encoding). Obtained from the browser via PushSubscription.getKey(&apos;p256dh&apos;). Used as the peer public key during ECDH key agreement to derive the per-message content encryption key for RFC 8291 payload encryption. Required when notificationUrl targets a known Web Push service origin; rejected with 400 Bad Request if supplied on a standard webhook subscription. For more information, see RFC 8291 Section 3.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? WebPushEncryptionP256dhPublicKey { get; set; }
#nullable restore
#else
public string WebPushEncryptionP256dhPublicKey { get; set; }
#endif
/// <summary>Optional. The subscriber&apos;s auth secret, base64url-encoded (16 bytes pre-encoding). Obtained from the browser via PushSubscription.getKey(&apos;auth&apos;). Used as the HMAC-SHA-256 salt for the HKDF combine step that derives key material for RFC 8291 payload encryption. Write-only: this value is never returned in GET responses (returned as null). Treat as a secret. Required when notificationUrl targets a known Web Push service origin; rejected with 400 Bad Request if supplied on a standard webhook subscription. For more information, see RFC 8291 Section 3.</summary>
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? WebPushEncryptionSecret { get; set; }
#nullable restore
#else
public string WebPushEncryptionSecret { get; set; }
#endif
/// <summary>
/// Creates a new instance of the appropriate class based on discriminator value
Expand Down Expand Up @@ -144,6 +168,9 @@ public override IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{ "notificationUrl", n => { NotificationUrl = n.GetStringValue(); } },
{ "notificationUrlAppId", n => { NotificationUrlAppId = n.GetStringValue(); } },
{ "resource", n => { Resource = n.GetStringValue(); } },
{ "vapidPublicKey", n => { VapidPublicKey = n.GetStringValue(); } },
{ "webPushEncryptionP256dhPublicKey", n => { WebPushEncryptionP256dhPublicKey = n.GetStringValue(); } },
{ "webPushEncryptionSecret", n => { WebPushEncryptionSecret = n.GetStringValue(); } },
};
}
/// <summary>
Expand All @@ -168,6 +195,9 @@ public override void Serialize(ISerializationWriter writer)
writer.WriteStringValue("notificationUrl", NotificationUrl);
writer.WriteStringValue("notificationUrlAppId", NotificationUrlAppId);
writer.WriteStringValue("resource", Resource);
writer.WriteStringValue("vapidPublicKey", VapidPublicKey);
writer.WriteStringValue("webPushEncryptionP256dhPublicKey", WebPushEncryptionP256dhPublicKey);
writer.WriteStringValue("webPushEncryptionSecret", WebPushEncryptionSecret);
}
}
}
Expand Down
Loading
Loading