Files
server/src/Core/Models/PushNotification.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.5 KiB
C#
Raw Normal View History

using Bit.Core.Enums;
namespace Bit.Core.Models;
2022-08-29 16:06:55 -04:00
public class PushNotificationData<T>
{
2018-08-02 17:23:37 -04:00
public PushNotificationData(PushType type, T payload, string contextId)
{
2018-08-02 17:23:37 -04:00
Type = type;
Payload = payload;
ContextId = contextId;
}
public PushType Type { get; set; }
public T Payload { get; set; }
public string ContextId { get; set; }
}
2018-08-28 08:22:49 -04:00
public class SyncCipherPushNotification
{
public Guid Id { get; set; }
public Guid? UserId { get; set; }
public Guid? OrganizationId { get; set; }
public IEnumerable<Guid> CollectionIds { get; set; }
public DateTime RevisionDate { get; set; }
}
public class SyncFolderPushNotification
2022-08-29 14:53:16 -04:00
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
public DateTime RevisionDate { get; set; }
2022-08-29 14:53:16 -04:00
}
public class UserPushNotification
2022-08-29 16:06:55 -04:00
{
public Guid UserId { get; set; }
public DateTime Date { get; set; }
2022-08-29 16:06:55 -04:00
}
public class SyncSendPushNotification
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
public DateTime RevisionDate { get; set; }
}
[SG-167] Implement Passwordless Authentication via Notifications (#2276) * [SG-549] Commit Initial AuthRequest Repository (#2174) * Model Passwordless * Scaffold database for Passwordless * Implement SQL Repository * [SG-167] Base Passwordless API (#2185) * Implement Passwordless notifications * Implement Controller * Add documentation to BaseRequestValidator * Register AuthRequestRepo * Remove ExpirationDate from the AuthRequest table * [SG-407] Create job to delete expired requests (#2187) * chore: init * remove exp date * fix: log name * [SG-167] Added fingerprint phrase to response model. (#2233) * Remove FailedLoginAttempt logic * Block unknown devices * Add EF Support for passwordless * Got SignalR working for responses * Added delete job method to EF repo * Implement a GetMany API endpoint for AuthRequests * Ran dotnet format * Fix a merge issues * Redated migration scripts * tried sorting sqlproj * Remove FailedLoginAttempts from SQL * Groom Postgres script * Remove extra commas from migration script * Correct isSpent() * [SG-167] Adde identity validation for passwordless requests. Registered IAuthRepository. * [SG-167] Added origin of the request to response model * Use display name for device identifier in response * Add datetime conversions back to postgres migration script * [SG-655] Add anonymous endpoint for checking if a device & user combo match * [review] Consolidate error conditions Co-authored-by: Brandon Maharaj <107377945+BrandonM-Bitwarden@users.noreply.github.com> Co-authored-by: André Filipe da Silva Bispo <andrefsbispo@hotmail.com> Co-authored-by: André Bispo <abispo@bitwarden.com>
2022-09-26 13:21:13 -04:00
public class AuthRequestPushNotification
{
public Guid UserId { get; set; }
public Guid Id { get; set; }
}
public class OrganizationStatusPushNotification
{
public Guid OrganizationId { get; set; }
public bool Enabled { get; set; }
}
public class OrganizationCollectionManagementPushNotification
{
public Guid OrganizationId { get; init; }
public bool LimitCollectionCreation { get; init; }
public bool LimitCollectionDeletion { get; init; }
}