Skip to content
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: 2 additions & 0 deletions src/main/java/com/auth0/client/HttpOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

/**
* Used to configure additional configuration options when customizing the API client instance.
* @deprecated use the {@link com.auth0.net.client.DefaultHttpClient} to configure HTTP client behavior
*/
@Deprecated
public class HttpOptions {

private ProxyOptions proxyOptions;
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/com/auth0/client/auth/AuthAPI.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.auth0.client.auth;

import com.auth0.client.HttpOptions;
import com.auth0.client.mgmt.ManagementAPI;
import com.auth0.json.auth.PasswordlessEmailResponse;
import com.auth0.json.auth.PasswordlessSmsResponse;
Expand Down Expand Up @@ -71,7 +70,7 @@ public class AuthAPI {
/**
* Create a new instance with the given tenant's domain, application's client id and client secret.
* These values can be obtained at {@code https://manage.auth0.com/#/applications/{YOUR_CLIENT_ID}/settings}.
* In addition, accepts an {@link HttpOptions} that will be used to configure the networking client.
* In addition, accepts an {@link com.auth0.client.HttpOptions} that will be used to configure the networking client.
*
* @deprecated Use the {@link Builder} to configure and create instances.
*
Expand All @@ -82,7 +81,8 @@ public class AuthAPI {
* @see #AuthAPI(String, String, String)
*/
@Deprecated
public AuthAPI(String domain, String clientId, String clientSecret, HttpOptions options) {
@SuppressWarnings("deprecation")
public AuthAPI(String domain, String clientId, String clientSecret, com.auth0.client.HttpOptions options) {
this(domain, clientId, clientSecret, buildNetworkingClient(options));
}

Expand All @@ -98,7 +98,7 @@ public AuthAPI(String domain, String clientId, String clientSecret, HttpOptions
*/
@Deprecated
public AuthAPI(String domain, String clientId, String clientSecret) {
this(domain, clientId, clientSecret, new HttpOptions());
this(domain, clientId, clientSecret, new com.auth0.client.HttpOptions());
}

/**
Expand Down Expand Up @@ -145,7 +145,8 @@ private AuthAPI(String domain, String clientId, String clientSecret, Auth0HttpCl
* @param options the options to set to the client.
* @return a new networking client instance configured as requested.
*/
private static Auth0HttpClient buildNetworkingClient(HttpOptions options) {
@SuppressWarnings("deprecation")
private static Auth0HttpClient buildNetworkingClient(com.auth0.client.HttpOptions options) {
Asserts.assertNotNull(options, "Http options");
return DefaultHttpClient.newBuilder()
.withLogging(options.getLoggingOptions())
Expand Down
19 changes: 0 additions & 19 deletions src/main/java/com/auth0/client/mgmt/ClientGrantsEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,6 @@ public Request<ClientGrantsPage> list(ClientGrantsFilter filter) {
});
}

/**
* Request all the Client Grants. A token with scope read:client_grants is needed.
* See https://auth0.com/docs/api/management/v2#!/Client_Grants/get_client_grants
*
* @return a Request to execute.
* @deprecated Calling this method will soon stop returning the complete list of client grants and instead, limit to the first page of results.
* Please use {@link #list(ClientGrantsFilter)} instead as it provides pagination support.
*/
@Deprecated
public Request<List<ClientGrant>> list() {
String url = baseUrl
.newBuilder()
.addPathSegments("api/v2/client-grants")
.build()
.toString();
return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference<List<ClientGrant>>() {
});
}

/**
* Create a Client Grant. A token with scope create:client_grants is needed.
* See https://auth0.com/docs/api/management/v2#!/Client_Grants/post_client_grants
Expand Down
19 changes: 0 additions & 19 deletions src/main/java/com/auth0/client/mgmt/ClientsEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,6 @@ public class ClientsEntity extends BaseManagementEntity {
super(client, baseUrl, tokenProvider);
}

/**
* Request all the Applications. A token with scope read:clients is needed. If you also need the client_secret and encryption_key attributes the token must have read:client_keys scope.
* See https://auth0.com/docs/api/management/v2#!/Clients/get_clients
*
* @return a Request to execute.
* @deprecated Calling this method will soon stop returning the complete list of clients and instead, limit to the first page of results.
* Please use {@link #list(ClientFilter)} instead as it provides pagination support.
*/
@Deprecated
public Request<List<Client>> list() {
String url = baseUrl
.newBuilder()
.addPathSegments("api/v2/clients")
.build()
.toString();
return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference<List<Client>>() {
});
}

/**
* Request all the Applications. A token with scope read:clients is needed. If you also need the client_secret and encryption_key attributes the token must have read:client_keys scope.
* See https://auth0.com/docs/api/management/v2#!/Clients/get_clients
Expand Down
27 changes: 0 additions & 27 deletions src/main/java/com/auth0/client/mgmt/ConnectionsEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,6 @@ public Request<ConnectionsPage> listAll(ConnectionFilter filter) {
}


/**
* Request all the ConnectionsEntity. A token with scope read:connections is needed.
* See https://auth0.com/docs/api/management/v2#!/Connections/get_connections
*
* @param filter the filter to use. Can be null.
* @return a Request to execute.
* @deprecated Calling this method will soon stop returning the complete list of connections and instead, limit to the first page of results.
* Please use {@link #listAll(ConnectionFilter)} instead as it provides pagination support.
*/
@Deprecated
public Request<List<Connection>> list(ConnectionFilter filter) {
HttpUrl.Builder builder = baseUrl
.newBuilder()
.addPathSegments("api/v2/connections");
if (filter != null) {
for (Map.Entry<String, Object> e : filter.getAsMap().entrySet()) {
//This check below is to prevent JSON parsing errors
if (!e.getKey().equalsIgnoreCase("include_totals")) {
builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue()));
}
}
}
String url = builder.build().toString();
return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference<List<Connection>>() {
});
}

/**
* Request a Connection. A token with scope read:connections is needed.
* See https://auth0.com/docs/api/management/v2#!/Connections/get_connections_by_id
Expand Down
23 changes: 0 additions & 23 deletions src/main/java/com/auth0/client/mgmt/GrantsEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,6 @@ public Request<GrantsPage> list(String userId, GrantsFilter filter) {
});
}

/**
* Request all Grants. A token with scope read:grants is needed
* See https://auth0.com/docs/api/management/v2#!/Grants/get_grants
*
* @param userId The user id of the grants to retrieve
* @return a Request to execute.
* @deprecated Calling this method will soon stop returning the complete list of grants and instead, limit to the first page of results.
* Please use {@link #list(String, GrantsFilter)} instead as it provides pagination support.
*/
@Deprecated
public Request<List<Grant>> list(String userId) {
Asserts.assertNotNull(userId, "user id");

String url = baseUrl
.newBuilder()
.addPathSegments("api/v2/grants")
.addQueryParameter("user_id", userId)
.build()
.toString();
return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference<List<Grant>>() {
});
}

/**
* Delete an existing Grant. A token with scope delete:grants is needed.
* See https://auth0.com/docs/api/management/v2#!/Grants/delete_grants_by_id<br>
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/auth0/client/mgmt/ManagementAPI.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.auth0.client.mgmt;

import com.auth0.client.HttpOptions;
import com.auth0.net.client.Auth0HttpClient;
import com.auth0.net.client.DefaultHttpClient;
import com.auth0.utils.Asserts;
Expand All @@ -25,7 +24,7 @@ public class ManagementAPI {

/**
* Create an instance with the given tenant's domain and API token.
* In addition, accepts an {@link HttpOptions} that will be used to configure the networking client.
* In addition, accepts an {@link com.auth0.client.HttpOptions} that will be used to configure the networking client.
* See the Management API section in the readme or visit https://auth0.com/docs/api/management/v2/tokens
* to learn how to obtain a token.
*
Expand All @@ -37,7 +36,8 @@ public class ManagementAPI {
* @see #ManagementAPI(String, String)
*/
@Deprecated
public ManagementAPI(String domain, String apiToken, HttpOptions options) {
@SuppressWarnings("baz")
public ManagementAPI(String domain, String apiToken, com.auth0.client.HttpOptions options) {
this(domain, SimpleTokenProvider.create(apiToken), buildNetworkingClient(options));
}

Expand Down Expand Up @@ -86,7 +86,8 @@ private ManagementAPI(String domain, TokenProvider tokenProvider, Auth0HttpClien
* @param options the options to set to the client.
* @return a new networking client instance configured as requested.
*/
private static DefaultHttpClient buildNetworkingClient(HttpOptions options) {
@SuppressWarnings("deprecation")
private static DefaultHttpClient buildNetworkingClient(com.auth0.client.HttpOptions options) {
Asserts.assertNotNull(options, "Http options");
return DefaultHttpClient.newBuilder()
.withLogging(options.getLoggingOptions())
Expand Down
20 changes: 0 additions & 20 deletions src/main/java/com/auth0/client/mgmt/ResourceServerEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,6 @@ public Request<ResourceServersPage> list(ResourceServersFilter filter) {
});
}

/**
* Creates request to fetch all resource servers.
* See <a href=https://auth0.com/docs/api/management/v2#!/Resource_Servers/get_resource_servers>API documentation</a>
*
* @return request to execute
* @deprecated Calling this method will soon stop returning the complete list of resource servers and instead, limit to the first page of results.
* Please use {@link #list(ResourceServersFilter)} instead as it provides pagination support.
*/
@Deprecated
public Request<List<ResourceServer>> list() {
HttpUrl.Builder builder = baseUrl
.newBuilder()
.addPathSegments("api/v2/resource-servers");

String url = builder.build().toString();
return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET,
new TypeReference<List<ResourceServer>>() {
});
}

/**
* Cretes request for fetching single resource server by it's ID.
* See <a href=https://auth0.com/docs/api/management/v2#!/Resource_Servers/get_resource_servers_by_id>API documentation</a>
Expand Down
27 changes: 0 additions & 27 deletions src/main/java/com/auth0/client/mgmt/RulesEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,6 @@ public Request<RulesPage> listAll(RulesFilter filter) {
});
}

/**
* Request all the Rules. A token with scope read:rules is needed.
* See https://auth0.com/docs/api/management/v2#!/Rules/get_rules
*
* @param filter the filter to use. Can be null.
* @return a Request to execute.
* @deprecated Calling this method will soon stop returning the complete list of rules and instead, limit to the first page of results.
* Please use {@link #listAll(RulesFilter)} instead as it provides pagination support.
*/
@Deprecated
public Request<List<Rule>> list(RulesFilter filter) {
HttpUrl.Builder builder = baseUrl
.newBuilder()
.addPathSegments("api/v2/rules");
if (filter != null) {
for (Map.Entry<String, Object> e : filter.getAsMap().entrySet()) {
//This check below is to prevent JSON parsing errors
if (!e.getKey().equalsIgnoreCase("include_totals")) {
builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue()));
}
}
}
String url = builder.build().toString();
return new BaseRequest<>(client, tokenProvider, url, HttpMethod.GET, new TypeReference<List<Rule>>() {
});
}

/**
* Request a Rule. A token with scope read:rules is needed.
* See https://auth0.com/docs/api/management/v2#!/Rules/get_rules_by_id
Expand Down
36 changes: 0 additions & 36 deletions src/main/java/com/auth0/json/mgmt/guardian/EnrollmentTicket.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@ public String getUserId() {
return userId;
}

/**
* Setter for the id of the user this ticket is meant to.
*
* @param userId the user id to set.
* @deprecated use the constructor instead
*/
@Deprecated
@JsonProperty("user_id")
public void setUserId(String userId) {
this.userId = userId;
}

/**
* Whether to send and email for enrollment or not.
*
Expand All @@ -96,18 +84,6 @@ public Boolean willSendEmail() {
return sendEmail;
}

/**
* Sets whether to send and email for enrollment or not.
*
* @param sendEmail whether this ticket will send an email upon enrollment or not.
* @deprecated use the constructor instead
*/
@Deprecated
@JsonProperty("send_mail")
public void setSendEmail(Boolean sendEmail) {
this.sendEmail = sendEmail;
}

/**
* Getter for the email to which the ticket will be sent.
*
Expand All @@ -118,18 +94,6 @@ public String getEmail() {
return email;
}

/**
* Setter for the email to which the ticket will be sent.
*
* @param email the email to sent the ticket to.
* @deprecated use the constructor instead
*/
@Deprecated
@JsonProperty("email")
public void setEmail(String email) {
this.email = email;
}

/**
* Getter for the ticket id.
*
Expand Down
Loading