1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-17 11:08:16 -05:00

more relay logging

This commit is contained in:
Kyle Spearrin 2019-03-20 00:41:11 -04:00
parent dc0bdfa28b
commit 2f3b38a941
2 changed files with 8 additions and 1 deletions

View File

@ -54,12 +54,15 @@ namespace Bit.Core.Services
protected async Task SendAsync(HttpMethod method, string path, object requestModel = null) protected async Task SendAsync(HttpMethod method, string path, object requestModel = null)
{ {
_logger.LogInformation(Constants.BypassFiltersEventId, "SendAsync1");
var tokenStateResponse = await HandleTokenStateAsync(); var tokenStateResponse = await HandleTokenStateAsync();
if(!tokenStateResponse) if(!tokenStateResponse)
{ {
_logger.LogInformation(Constants.BypassFiltersEventId, "SendAsync2");
return; return;
} }
_logger.LogInformation(Constants.BypassFiltersEventId, "SendAsync3");
var message = new TokenHttpRequestMessage(requestModel, AccessToken) var message = new TokenHttpRequestMessage(requestModel, AccessToken)
{ {
Method = method, Method = method,

View File

@ -73,6 +73,7 @@ namespace Bit.Core.Services
RevisionDate = cipher.RevisionDate, RevisionDate = cipher.RevisionDate,
}; };
_logger.LogInformation(Constants.BypassFiltersEventId, "Relay PushCipherAsync");
await SendPayloadToUserAsync(cipher.UserId.Value, type, message, true); await SendPayloadToUserAsync(cipher.UserId.Value, type, message, true);
} }
} }
@ -142,14 +143,17 @@ namespace Bit.Core.Services
private async Task SendPayloadToUserAsync(Guid userId, PushType type, object payload, bool excludeCurrentContext) private async Task SendPayloadToUserAsync(Guid userId, PushType type, object payload, bool excludeCurrentContext)
{ {
_logger.LogInformation(Constants.BypassFiltersEventId, "Relay SendPayloadToUserAsync1");
var request = new PushSendRequestModel var request = new PushSendRequestModel
{ {
UserId = userId.ToString(), UserId = userId.ToString(),
Type = type, Type = type,
Payload = payload Payload = payload
}; };
_logger.LogInformation(Constants.BypassFiltersEventId, "Relay SendPayloadToUserAsync2");
await AddCurrentContextAsync(request, excludeCurrentContext); await AddCurrentContextAsync(request, excludeCurrentContext);
_logger.LogInformation(Constants.BypassFiltersEventId, "Relay SendPayloadToUserAsync3");
await SendAsync(HttpMethod.Post, "push/send", request); await SendAsync(HttpMethod.Post, "push/send", request);
} }