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 missing "initiate_login_uri" property to Client #244

Merged
merged 3 commits into from
Apr 16, 2020
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
30 changes: 26 additions & 4 deletions src/main/java/com/auth0/json/mgmt/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class Client {
private Boolean customLoginPageOn;
@JsonProperty("is_heroku_app")
private Boolean isHerokuApp;
@JsonProperty("initiate_login_uri")
private String initiateLoginUri;
@JsonProperty("custom_login_page")
private String customLoginPage;
@JsonProperty("custom_login_page_preview")
Expand Down Expand Up @@ -176,19 +178,19 @@ public void setAppType(String appType) {
}

/**
* Getter for the url of the application logo.
* Getter for the URI of the application logo.
*
* @return the application's logo url.
* @return the application's logo URI.
*/
@JsonProperty("logo_uri")
public String getLogoUri() {
return logoUri;
}

/**
* Setter for the application logo url. An image with size 150x150 is recommended.
* Setter for the application logo URI. An image with size 150x150 is recommended.
*
* @param logoUri the logo url to set.
* @param logoUri the logo URI to set.
*/
@JsonProperty("logo_uri")
public void setLogoUri(String logoUri) {
Expand Down Expand Up @@ -486,6 +488,26 @@ public void setUseCustomLoginPage(Boolean useCustomLoginPage) {
this.customLoginPageOn = useCustomLoginPage;
}

/**
* Getter for the initiate login URI.
*
* @return the initiate login URI.
*/
@JsonProperty("initiate_login_uri")
public String getInitiateLoginUri() {
return initiateLoginUri;
}

/**
* Setter for the initiate login URI.
*
* @param initiateLoginUri the initiate login URI to set.
*/
@JsonProperty("initiate_login_uri")
public void setInitiateLoginUri(String initiateLoginUri) {
this.initiateLoginUri = initiateLoginUri;
}

/**
* Whether this application is a Heroku application or not.
*
Expand Down
5 changes: 4 additions & 1 deletion src/test/java/com/auth0/json/mgmt/client/ClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class ClientTest extends JsonTest<Client> {

private static final String readOnlyJson = "{\"client_id\":\"clientId\",\"is_heroku_app\":true,\"signing_keys\":[{\"cert\":\"ce\",\"pkcs7\":\"pk\",\"subject\":\"su\"}]}";
private static final String json = "{\"name\":\"name\",\"description\":\"description\",\"client_secret\":\"secret\",\"app_type\":\"type\",\"logo_uri\":\"uri\",\"oidc_conformant\":true,\"is_first_party\":true,\"callbacks\":[\"value\"],\"allowed_origins\":[\"value\"],\"web_origins\":[\"value\"],\"grant_types\":[\"value\"],\"client_aliases\":[\"value\"],\"allowed_clients\":[\"value\"],\"allowed_logout_urls\":[\"value\"],\"jwt_configuration\":{\"lifetime_in_seconds\":100,\"scopes\":\"openid\",\"alg\":\"alg\"},\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\"},\"sso\":true,\"sso_disabled\":true,\"custom_login_page_on\":true,\"custom_login_page\":\"custom\",\"custom_login_page_preview\":\"preview\",\"form_template\":\"template\",\"addons\":{\"rms\":{},\"mscrm\":{},\"slack\":{},\"layer\":{}},\"token_endpoint_auth_method\":\"method\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"pkg\",\"sha256_cert_fingerprints\":[\"256\"]},\"ios\":{\"team_id\":\"team\",\"app_bundle_identifier\":\"id\"}}}";
private static final String json = "{\"name\":\"name\",\"description\":\"description\",\"client_secret\":\"secret\",\"app_type\":\"type\",\"logo_uri\":\"uri\",\"oidc_conformant\":true,\"is_first_party\":true,\"initiate_login_uri\":\"https://myhome.com/login\",\"callbacks\":[\"value\"],\"allowed_origins\":[\"value\"],\"web_origins\":[\"value\"],\"grant_types\":[\"value\"],\"client_aliases\":[\"value\"],\"allowed_clients\":[\"value\"],\"allowed_logout_urls\":[\"value\"],\"jwt_configuration\":{\"lifetime_in_seconds\":100,\"scopes\":\"openid\",\"alg\":\"alg\"},\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\"},\"sso\":true,\"sso_disabled\":true,\"custom_login_page_on\":true,\"custom_login_page\":\"custom\",\"custom_login_page_preview\":\"preview\",\"form_template\":\"template\",\"addons\":{\"rms\":{},\"mscrm\":{},\"slack\":{},\"layer\":{}},\"token_endpoint_auth_method\":\"method\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"pkg\",\"sha256_cert_fingerprints\":[\"256\"]},\"ios\":{\"team_id\":\"team\",\"app_bundle_identifier\":\"id\"}}}";

@Test
public void shouldSerialize() throws Exception {
Expand Down Expand Up @@ -44,6 +44,7 @@ public void shouldSerialize() throws Exception {
client.setSSODisabled(true);
client.setUseCustomLoginPage(true);
client.setCustomLoginPage("custom");
client.setInitiateLoginUri("https://appzero.com/login");
client.setCustomLoginPagePreview("preview");
client.setFormTemplate("template");
Addons addons = new Addons(new Addon(), new Addon(), new Addon(), new Addon());
Expand All @@ -63,6 +64,7 @@ public void shouldSerialize() throws Exception {
assertThat(serialized, JsonMatcher.hasEntry("app_type", "type"));
assertThat(serialized, JsonMatcher.hasEntry("logo_uri", "uri"));
assertThat(serialized, JsonMatcher.hasEntry("oidc_conformant", true));
assertThat(serialized, JsonMatcher.hasEntry("initiate_login_uri", "https://appzero.com/login"));
assertThat(serialized, JsonMatcher.hasEntry("is_first_party", true));
assertThat(serialized, JsonMatcher.hasEntry("callbacks", Collections.singletonList("value")));
assertThat(serialized, JsonMatcher.hasEntry("grant_types", Collections.singletonList("value")));
Expand Down Expand Up @@ -115,6 +117,7 @@ public void shouldDeserialize() throws Exception {

assertThat(client.getCustomLoginPage(), is("custom"));
assertThat(client.getCustomLoginPagePreview(), is("preview"));
assertThat(client.getInitiateLoginUri(), is("https://myhome.com/login"));
assertThat(client.getFormTemplate(), is("template"));

assertThat(client.getAddons(), is(notNullValue()));
Expand Down