Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to ignore email changes #186

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion backend/common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="6.0.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="7.0.9" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.20" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.15.1" />
Expand Down
26 changes: 18 additions & 8 deletions backend/webapi/Features/AccessRequests/DigitalEvidenceUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class CommandHandler : ICommandHandler<Command, IDomainResult>
private readonly IOrgUnitService orgUnitService;
private readonly IKafkaProducer<string, EdtUserProvisioning> kafkaProducer;
private readonly IKafkaProducer<string, UserChangeModel> kafkaAccountChangeProducer;
private bool JUSTIN_EMAIL_CHANGE_DISABLED;

private readonly IKafkaProducer<string, Notification> kafkaNotificationProducer;

Expand Down Expand Up @@ -83,6 +84,12 @@ public CommandHandler(
this.kafkaNotificationProducer = kafkaNotificationProducer;
this.orgUnitService = orgUnitService;
this.kafkaAccountChangeProducer = kafkaAccountChangeProducer;
this.JUSTIN_EMAIL_CHANGE_DISABLED = Environment.GetEnvironmentVariable("JUSTIN_EMAIL_CHANGE_DISABLED") != null && bool.Parse(Environment.GetEnvironmentVariable("JUSTIN_EMAIL_CHANGE_DISABLED"));

if (this.JUSTIN_EMAIL_CHANGE_DISABLED)
{
Serilog.Log.Warning("*** JUSTIN Email Account Check is disabled - email changes in JUSTIN wont trigger account changes ***");
}
}


Expand Down Expand Up @@ -335,16 +342,19 @@ private async Task<UserChangeModel> DetermineUserChanges(ParticipantDetail justi
};

// see if email has changed - case insensitive
if (!string.IsNullOrEmpty(justinUserInfo.emailAddress))
if (!this.JUSTIN_EMAIL_CHANGE_DISABLED)
{
if (string.IsNullOrEmpty(justinUserInfo.emailAddress))
{
Serilog.Log.Warning($"User {party.Id} email is null or empty in JUSTIN");
}
else if (!party.Email.Equals(justinUserInfo.emailAddress, StringComparison.OrdinalIgnoreCase))
if (!string.IsNullOrEmpty(justinUserInfo.emailAddress))
{
Serilog.Log.Information($"User {party.Id} email changed from {party.Email} to {justinUserInfo.emailAddress}");
userChangeModel.SingleChangeTypes.Add(ChangeType.EMAIL, new SingleChangeType(party.Email, justinUserInfo.emailAddress));
if (string.IsNullOrEmpty(justinUserInfo.emailAddress))
{
Serilog.Log.Warning($"User {party.Id} email is null or empty in JUSTIN");
}
else if (!party.Email.Equals(justinUserInfo.emailAddress, StringComparison.OrdinalIgnoreCase))
{
Serilog.Log.Information($"User {party.Id} email changed from {party.Email} to {justinUserInfo.emailAddress}");
userChangeModel.SingleChangeTypes.Add(ChangeType.EMAIL, new SingleChangeType(party.Email, justinUserInfo.emailAddress));
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions backend/webapi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ namespace Pidp;
using Pidp.Models.Lookups;
using static Pidp.Models.Lookups.CourtLocation;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Authorization;

public class Startup
{
Expand Down Expand Up @@ -302,7 +304,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
);// "/error");

app.UseSwagger();
app.UseSwaggerUI(options => options.SwaggerEndpoint("/swagger/v1/swagger.json", "PIdP Web API"));
app.UseSwaggerUI(options => options.SwaggerEndpoint("/swagger/v1/swagger.json", "DIAM Web API"));

app.UseSerilogRequestLogging(options => options.EnrichDiagnosticContext = (diagnosticContext, httpContext) =>
{
Expand All @@ -327,8 +329,10 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
endpoints.MapControllers();
endpoints.MapMetrics();
endpoints.MapHealthChecks("/health/liveness").AllowAnonymous();
endpoints.MapHealthChecks("/health/liveness", new HealthCheckOptions { AllowCachingResponses = false }).WithMetadata(new AllowAnonymousAttribute());

});




Expand Down
Binary file modified charts/pidp/charts/edt-casemgmt-0.1.0.tgz
Binary file not shown.
Binary file modified charts/pidp/charts/edt-disclosure-0.1.0.tgz
Binary file not shown.
Binary file modified charts/pidp/charts/edt-service-0.1.3.tgz
Binary file not shown.
Binary file modified charts/pidp/charts/frontend-0.1.2.tgz
Binary file not shown.
Binary file modified charts/pidp/charts/jum-backend-0.1.2.tgz
Binary file not shown.
Binary file modified charts/pidp/charts/jum-notification-0.1.2.tgz
Binary file not shown.
Binary file modified charts/pidp/charts/nginx-9.7.3.tgz
Binary file not shown.
Binary file modified charts/pidp/charts/plr-intake-0.1.2.tgz
Binary file not shown.
Binary file modified charts/pidp/charts/webapi-0.1.9.tgz
Binary file not shown.
2 changes: 2 additions & 0 deletions charts/webapi/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ spec:
secretKeyRef:
name: splunk-config
key: SplunkConfig__Host
- name: JUSTIN_EMAIL_CHANGE_DISABLED
value: "true"
volumeMounts:
- name: kafka-truststore
mountPath: "/opt/kafka/certificates"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<ui-page-section>
<ui-page-section-subheader icon="history" heading="Requests">
<ng-container uiPageSectionSubheaderDesc>
This is a log of your interactions with the Provider
Identity Portal.
This is a log of your interactions with the Digital Identity Access Management portal.
</ng-container>
</ui-page-section-subheader>

Expand Down