mirror of
https://github.com/bitwarden/server.git
synced 2025-12-11 04:34:37 -06:00
* Move PushType to Platform Folder - Move the PushType next to the rest of push notification code - Specifically exclude it from needing Platform code review - Add tests establishing rules Platform has for usage of this enum, making it safe to have no owner * Move NotificationHub code into Platform/Push directory * Update NotificationHub namespace imports * Add attribute for storing push type metadata * Rename Push Engines to have PushEngine suffix * Move Push Registration items to their own directory * Push code move * Add expected usage comment * Add Push feature registration method - Make method able to be called multipes times with no ill effects * Add Push Registration service entrypoint and tests * Use new service entrypoints * Test changes
32 lines
757 B
C#
32 lines
757 B
C#
namespace Bit.Core.Platform.PushRegistration;
|
|
|
|
public record struct WebPushRegistrationData
|
|
{
|
|
public string Endpoint { get; init; }
|
|
public string P256dh { get; init; }
|
|
public string Auth { get; init; }
|
|
}
|
|
|
|
public record class PushRegistrationData
|
|
{
|
|
public string? Token { get; set; }
|
|
public WebPushRegistrationData? WebPush { get; set; }
|
|
public PushRegistrationData(string? token)
|
|
{
|
|
Token = token;
|
|
}
|
|
|
|
public PushRegistrationData(string Endpoint, string P256dh, string Auth) : this(new WebPushRegistrationData
|
|
{
|
|
Endpoint = Endpoint,
|
|
P256dh = P256dh,
|
|
Auth = Auth
|
|
})
|
|
{ }
|
|
|
|
public PushRegistrationData(WebPushRegistrationData webPush)
|
|
{
|
|
WebPush = webPush;
|
|
}
|
|
}
|