diff --git a/sources/src/main/java/com/google/solutions/jitaccess/web/ApiResource.java b/sources/src/main/java/com/google/solutions/jitaccess/web/ApiResource.java index 1dddff971..7565e942d 100644 --- a/sources/src/main/java/com/google/solutions/jitaccess/web/ApiResource.java +++ b/sources/src/main/java/com/google/solutions/jitaccess/web/ApiResource.java @@ -24,6 +24,7 @@ import com.google.common.base.Preconditions; import com.google.solutions.jitaccess.core.AccessDeniedException; import com.google.solutions.jitaccess.core.AccessException; +import com.google.solutions.jitaccess.core.ApplicationVersion; import com.google.solutions.jitaccess.core.Exceptions; import com.google.solutions.jitaccess.core.adapters.LogAdapter; import com.google.solutions.jitaccess.core.data.*; @@ -138,6 +139,7 @@ public PolicyResponse getPolicy( return new PolicyResponse( options.justificationHint, iapPrincipal.getId(), + ApplicationVersion.VERSION_STRING, (int)options.maxActivationTimeout.toMinutes(), Math.min(60, (int)options.maxActivationTimeout.toMinutes())); } @@ -679,12 +681,14 @@ private static LogAdapter.LogEntry addLabels( public static class PolicyResponse { public final String justificationHint; public final UserId signedInUser; + public String applicationVersion; public final int defaultActivationTimeout; // in minutes. public final int maxActivationTimeout; // in minutes. private PolicyResponse( String justificationHint, UserId signedInUser, + String applicationVersion, int maxActivationTimeoutInMinutes, int defaultActivationTimeoutInMinutes ) { @@ -696,6 +700,7 @@ private PolicyResponse( this.justificationHint = justificationHint; this.signedInUser = signedInUser; + this.applicationVersion = applicationVersion; this.defaultActivationTimeout = defaultActivationTimeoutInMinutes; this.maxActivationTimeout = maxActivationTimeoutInMinutes; } diff --git a/sources/src/main/resources/META-INF/resources/index.html b/sources/src/main/resources/META-INF/resources/index.html index 73c89844f..8a7298e6b 100644 --- a/sources/src/main/resources/META-INF/resources/index.html +++ b/sources/src/main/resources/META-INF/resources/index.html @@ -371,7 +371,7 @@

Audit and review just-in-time access

Toast!
@@ -934,6 +934,7 @@

Audit and review just-in-time access

} $("#signed-in-user").text(backend.policy.signedInUser.email) + $("#application-version").text(backend.policy.applicationVersion) } catch (error) { gui.showToast(error, true); diff --git a/sources/src/main/resources/META-INF/resources/model.js b/sources/src/main/resources/META-INF/resources/model.js index 33d92ea3b..960ad46ee 100644 --- a/sources/src/main/resources/META-INF/resources/model.js +++ b/sources/src/main/resources/META-INF/resources/model.js @@ -337,7 +337,8 @@ class DebugModel extends Model { email: "user@example.com" }, defaultActivationTimeout: 60, - maxActivationTimeout: 120 + maxActivationTimeout: 120, + applicationVersion: 'debug' }; }