Skip to content

Commit e4a949c

Browse files
committed
Mfa Flow Fixes 3.2.0 Release
1 parent 405e078 commit e4a949c

File tree

7 files changed

+82
-9
lines changed

7 files changed

+82
-9
lines changed

release-notes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Release 3.2.0
2+
* Fix the state of MFA as it changes through undeclared states
3+
14
# Release 3.1.9
25
* Show the right selected identity fron the context menu
36
* Auto pop MFA if needed

src/app-renderer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ var app = {
373373
} else if (message.Action=="auth_challenge") {
374374
ZitiIdentity.SetMfaState(message.Fingerprint, message.Successful);
375375
ZitiIdentity.refresh();
376+
ZitiService.refresh();
377+
} else if (message.Action=="mfa_auth_status") {
378+
ZitiIdentity.SetMfaState(message.Fingerprint, message.Successful);
379+
ZitiIdentity.refresh();
380+
ZitiService.refresh();
376381
}
377382
}
378383
} else {

src/assets/scripts/identity.js

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,24 @@ var ZitiIdentity = {
4040
app.showScreen("IdentityScreen");
4141
}
4242
ZitiIdentity.notified.push(id.FingerPrint);
43+
ZitiIdentity.refresh();
4344
}
4445
} else {
4546
if ((id.MfaMinTimeoutRem-passed) <= 1200) {
4647
if (!ZitiIdentity.timerNotified.includes(id.FingerPrint) && ZitiIdentity.notifiable.includes(id.FingerPrint)) {
47-
var message = locale.get("MfaWillTimeout").split("{{id}}").join(id.Name)+moment().add(passed, 'seconds').fromNow();
48+
var message = locale.get("MfaWillTimeout").split("{{id}}").join(id.Name)+moment().add(id.MfaMinTimeoutRem-passed, 'seconds').fromNow();
4849
var notify = new Notification(locale.get("TimingOut"), { appID: locale.get("AppTitle"), body: message, tag: id.FingerPrint, icon: path.join(__dirname, '/assets/images/ziti-white.png') });
4950
notify.onclick = function(e) {
5051
ZitiIdentity.select(e.target.tag);
5152
app.showScreen("IdentityScreen");
5253
}
5354
ZitiIdentity.timerNotified.push(id.FingerPrint);
55+
ZitiIdentity.refresh();
56+
}
57+
} else {
58+
if ((id.MfaMinTimeoutRem-passed) <= 0) {
59+
ZitiIdentity.data[i].MfaNeeded = true;
60+
ZitiIdentity.refresh();
5461
}
5562
}
5663
}
@@ -206,9 +213,10 @@ var ZitiIdentity = {
206213
if (item.MfaEnabled) {
207214
var passed = moment.utc().diff(moment.utc(item.MfaLastUpdatedTime), "seconds");
208215
if (item.MfaMaxTimeoutRem>-1) {
209-
if ((item.MfaMaxTimeoutRem-passed) <= 0) {
216+
if ((item.MfaMinTimeoutRem-passed) <= 0) {
210217
status = "error";
211-
if (iconStatus!="mfa") iconStatus = "timed";
218+
iconStatus = "mfa";
219+
ZitiIdentity.data[i].MfaNeeded = true;
212220
} else if ((item.MfaMinTimeoutRem-passed) <= 1200) {
213221
status = "warning";
214222
if (iconStatus!="mfa" && iconStatus!="timed") iconStatus = "timing";
@@ -230,7 +238,7 @@ var ZitiIdentity = {
230238
let pc = service.PostureChecks[p];
231239
if (!pc.IsPassing) {
232240
ZitiIdentity.data[i].PostureFailing = true;
233-
status = "warning";
241+
if (status=="") status = "warning";
234242
break;
235243
}
236244
}
@@ -295,6 +303,34 @@ var ZitiIdentity = {
295303
if (ZitiIdentity.data[i].FingerPrint==fingerprint) {
296304
ZitiIdentity.data[i].MfaEnabled = true;
297305
ZitiIdentity.data[i].MfaNeeded = !isSuccess;
306+
if (isSuccess) {
307+
ZitiIdentity.data[i].MfaMinTimeoutRem = ZitiIdentity.data[i].MfaMinTimeout;
308+
ZitiIdentity.data[i].MfaMaxTimeoutRem = ZitiIdentity.data[i].MfaMaxTimeout;
309+
for (let j=0; j<ZitiService.data.length; j++) {
310+
if (ZitiIdentity.data[i].FingerPrint==fingerprint) {
311+
if (ZitiService.data[j].PostureChecks && ZitiService.data[j].PostureChecks.length>0) {
312+
for (let k=0; k<ZitiService.data[j].PostureChecks.length; k++) {
313+
if (ZitiService.data[j].PostureChecks[k].Timeout>-1) {
314+
ZitiService.data[j].PostureChecks[k].TimeoutRemaining = ZitiService.data[j].PostureChecks[k].Timeout;
315+
}
316+
}
317+
}
318+
ZitiService.data[j].TimeoutRemaining = ZitiService.data[j].Timeout;
319+
}
320+
}
321+
if (ZitiIdentity.data[i].Services && ZitiIdentity.data[i].Services.length>0) {
322+
for (let j=0; j<ZitiIdentity.data[i].Services.length; j++) {
323+
if (ZitiIdentity.data[i].Services[j].PostureChecks && ZitiIdentity.data[i].Services[j].PostureChecks.length>0) {
324+
for (let k=0; k<ZitiIdentity.data[i].Services[j].PostureChecks.length; k++) {
325+
if (ZitiIdentity.data[i].Services[j].PostureChecks[k].Timeout>-1) {
326+
ZitiIdentity.data[i].Services[j].PostureChecks[k].TimeoutRemaining = ZitiService.data[j].PostureChecks[k].Timeout;
327+
}
328+
}
329+
}
330+
ZitiIdentity.data[i].Services[j].TimeoutRemaining = ZitiIdentity.data[i].Services[j].Timeout;
331+
}
332+
}
333+
}
298334
break;
299335
}
300336
}
@@ -332,8 +368,26 @@ var ZitiIdentity = {
332368
$("#MfaStatus").find(".label").html(locale.get("Authorize"));
333369
$("#MfaToggle").addClass("disabled");
334370
} else {
335-
$("#MfaStatus").find(".icon").addClass("connected");
336-
$("#MfaStatus").find(".label").html(locale.get("RecoveryCodes"));
371+
372+
373+
var passed = moment.utc().diff(moment.utc(item.MfaLastUpdatedTime), "seconds");
374+
if ((item.MfaMinTimeoutRem-passed) <= 0) {
375+
for (var i=0; i<ZitiIdentity.data.length; i++) {
376+
if (ZitiIdentity.data[i].FingerPrint==id) {
377+
ZitiIdentity.data[i].MfaNeeded = true;
378+
break;
379+
}
380+
}
381+
$("#MfaStatus").find(".icon").addClass("authorize");
382+
$("#MfaStatus").find(".label").html(locale.get("Authorize"));
383+
$("#MfaToggle").addClass("disabled");
384+
} else {
385+
386+
$("#MfaStatus").find(".icon").addClass("connected");
387+
$("#MfaStatus").find(".label").html(locale.get("RecoveryCodes"));
388+
}
389+
390+
337391
}
338392
$("#MfaStatus").addClass("open");
339393
// Calc Time since

src/assets/scripts/mfa.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var mfa = {
1212
$("#AuthenticateButton").click(mfa.verify);
1313
$("#SaveCodesButton").click(mfa.save);
1414
$("#MfaStatus").click(mfa.showAuthenticate);
15+
$("#MfaTimeout").click(mfa.showAuthenticate);
1516
$("#ReAuthenticateButton").click(mfa.authenticate);
1617
$("#RemoveMfaButton").click(mfa.remove);
1718
$("#RecoveryMfaButton").click(mfa.recoveryAuth);

src/assets/styles/ziti.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,16 @@ input, select {
18641864
opacity: 0.7;
18651865
}
18661866

1867+
#MfaTimeout {
1868+
cursor: pointer;
1869+
transition: var(--transition);
1870+
opacity: 1.0;
1871+
}
1872+
1873+
#MfaTimeout:hover {
1874+
opacity: 0.8;
1875+
}
1876+
18671877
.mainalert .info, .posturealert .info {
18681878
position: relative;
18691879
display: inline-block;
@@ -2610,7 +2620,7 @@ element.style {
26102620
display: inline-block;
26112621
margin-top: 20px;
26122622
width: 100%;
2613-
padding-bottom: 50px;
2623+
padding-bottom: 120px;
26142624
}
26152625

26162626
#ServiceList {

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "zitidesktopedge",
33
"productName": "Ziti Desktop Edge (Preview)",
4-
"version": "3.1.9",
4+
"version": "3.2.0",
55
"homepage": "openziti.io",
66
"description": "Ziti Desktop Edge Client",
77
"main": "app.js",

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.9
1+
3.2.0

0 commit comments

Comments
 (0)