Skip to content

Commit

Permalink
Tenant jit disabled (#116)
Browse files Browse the repository at this point in the history
* Add JIT disabled to the tenant settings

* Update minor version
  • Loading branch information
slavikm authored May 15, 2024
1 parent 32e119e commit df07bc0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/management-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<dependency>
<groupId>com.descope</groupId>
<artifactId>java-sdk</artifactId>
<version>1.0.21</version>
<version>1.0.22</version>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.descope</groupId>
<artifactId>java-sdk</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>1.0.21</version>
<version>1.0.22</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Java library used to integrate with Descope.</description>
<url>https://github.com/descope/descope-java</url>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/descope/model/tenant/TenantSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ public class TenantSettings {
Boolean enableInactivity;
Integer inactivityTime;
String inactivityTimeUnit;
@JsonAlias({"JITDisabled"})
Boolean jitDisabled;
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public void configureSettings(String id, TenantSettings settings) throws Descope
addIfNotNull(req, "inactivityTimeUnit", settings.getInactivityTimeUnit());
addIfNotNull(req, "enableInactivity", settings.getEnableInactivity());
addIfNotNull(req, "domains", settings.getDomains());
addIfNotNull(req, "JITDisabled", settings.getJitDisabled());
ApiProxy apiProxy = getApiProxy();
apiProxy.post(configureSettingsUri(), req, Void.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ void testFunctionalFullCycle() {
TenantSettings tenantSettings = tenantService.getSettings(tenantId);
assertThat(tenantSettings).isNotNull();
assertThat(tenantSettings.getSelfProvisioningDomains()).containsOnly(name + ".com", name + "1.com");
assertThat(tenantSettings.getJitDisabled()).isFalse();
tenantService.update(tenantId, name + "1", Arrays.asList(name + ".com"), null);
tenants = tenantService.loadAll();
assertThat(tenants).isNotEmpty();
Expand All @@ -256,6 +257,12 @@ void testFunctionalFullCycle() {
tenantSearchRequest = TenantSearchRequest.builder().names(Arrays.asList("doesnotexists")).build();
tenants = tenantService.searchAll(tenantSearchRequest);
assertThat(tenants).isEmpty();

tenantSettings.setJitDisabled(true);
tenantService.configureSettings(tenantId, tenantSettings);
tenantSettings = tenantService.getSettings(tenantId);
assertThat(tenantSettings).isNotNull();
assertThat(tenantSettings.getJitDisabled()).isTrue();
tenantService.delete(tenantId);
}
}

0 comments on commit df07bc0

Please sign in to comment.