From 96e2df32aeca680659c8f0a2cedbed82abe04905 Mon Sep 17 00:00:00 2001 From: mattbramlage Date: Mon, 13 Aug 2018 15:14:21 -0700 Subject: [PATCH] Returning the #basicAuth methods to Client.java Instead, marking them as deprecated and telling apps to use the accessToken method instead --- src/main/java/com/asana/Client.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/com/asana/Client.java b/src/main/java/com/asana/Client.java index 9993ce0..7a73f0d 100644 --- a/src/main/java/com/asana/Client.java +++ b/src/main/java/com/asana/Client.java @@ -241,6 +241,29 @@ private String versionHeader() { return builder.toString().substring(1); } + /** + * WARNING: API Keys are deprecated and have been removed from Asana's API. + * Prefer using {@link #accessToken(String) accessToken method}. + * @param apiKey Basic Auth API key + * @deprecated + * @return Client instance + */ + public static Client basicAuth(String apiKey) { + return new Client(new BasicAuthDispatcher(apiKey)); + } + + /** + * WARNING: API Keys are deprecated and have been removed from Asana's API. + * Prefer using {@link #accessToken(String, HttpTransport) accessToken method}. + * @param apiKey Basic Auth API key + * @param httpTransport HttpTransport implementation to use for requests + * @deprecated + * @return Client instance + */ + public static Client basicAuth(String apiKey, HttpTransport httpTransport) { + return new Client(new BasicAuthDispatcher(apiKey, httpTransport)); + } + /** * @param accessToken Personal Access Token * @return Client instance