Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ebbeknudsen committed Dec 11, 2024
1 parent 46884d2 commit 2df100b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 4 additions & 7 deletions source/B2BApi/Authentication/MarketActorAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,13 @@ public bool Authenticate(ActorNumber? actorNumber, ActorRole? actorRole, string?
return false;
}

if (actorId is null)
{
// This is only possible in the case of certificate authentication, since the actor number above
// is retrieved from the actor id in case of token authentication.
_logger.LogWarning("Authenticated market actor identity has no actor id (ActorNumber={ActorNumber}, ActorRole={ActorRole}).", actorId, actorNumber.Value, actorRole.Code);
}

var actorIdGuid = Guid.TryParse(actorId, out var guidParseResult) ? guidParseResult : (Guid?)null;
if (actorIdGuid is null)
{
// This is only possible in the case of certificate authentication (ebIX), since the actor number above
// is retrieved from the actor id in case of token authentication.
_logger.LogWarning("Authenticated market actor identity has no valid actor id (ActorId={ActorId}, ActorNumber={ActorNumber}, ActorRole={ActorRole}).", actorId, actorNumber.Value, actorRole.Code);
}

_authenticatedActor.SetAuthenticatedActor(new ActorIdentity(
actorNumber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Energinet.DataHub.EDI.BuildingBlocks.Infrastructure.FeatureFlag;
using Energinet.DataHub.EDI.BuildingBlocks.Interfaces;
using Energinet.DataHub.EDI.Process.Application.Transactions.AggregatedMeasureData;
using Energinet.DataHub.EDI.Process.Domain.Transactions;
using Energinet.DataHub.EDI.Process.Interfaces;
using MediatR;

Expand Down Expand Up @@ -43,7 +41,6 @@ public bool CanHandle(string processTypeToInitialize)
public async Task ProcessAsync(byte[] processInitializationData)
{
var marketMessage = _serializer.Deserialize<InitializeAggregatedMeasureDataProcessDto>(System.Text.Encoding.UTF8.GetString(processInitializationData));

await _mediator.Send(new InitializeAggregatedMeasureDataProcessesCommand(marketMessage)).ConfigureAwait(false);
}
}

0 comments on commit 2df100b

Please sign in to comment.