diff options
| author | Kevin Sawicki | 2011-04-10 21:44:41 +0000 |
|---|---|---|
| committer | Chris Aniszczyk | 2011-04-11 11:25:34 +0000 |
| commit | e9fe86833ecc7c2f82fda1f427df3fad9a1c493e (patch) | |
| tree | ec4481cab8c25db827251a3125996afbe63c5740 | |
| parent | ad7ca72365ecf4144bb57c25a41a6c2ccc7541f4 (diff) | |
| download | egit-github-e9fe86833ecc7c2f82fda1f427df3fad9a1c493e.tar.gz egit-github-e9fe86833ecc7c2f82fda1f427df3fad9a1c493e.tar.xz egit-github-e9fe86833ecc7c2f82fda1f427df3fad9a1c493e.zip | |
Remove API token support which is not supported in v3
GitHub password now required for issue task repository
which is supported in both v2 and v3 APIs.
Change-Id: I36dac5b68d7476843b9b19351d41ad21d718e927
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
3 files changed, 10 insertions, 16 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubCredentials.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubCredentials.java index 19cd580c..ff2300b2 100644 --- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubCredentials.java +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubCredentials.java @@ -18,12 +18,12 @@ import org.eclipse.mylyn.tasks.core.TaskRepository; public class GitHubCredentials { private final String username; - private final String apiToken; - - - public GitHubCredentials(String username, String apiToken) { + private final String password; + + + public GitHubCredentials(String username, String password) { this.username = username; - this.apiToken = apiToken; + this.password = password; } public GitHubCredentials(AuthenticationCredentials credentials) { @@ -37,8 +37,8 @@ public class GitHubCredentials { public String getUsername() { return username; } - public String getApiToken() { - return apiToken; + public String getPassword() { + return password; } } diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubService.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubService.java index cf897692..5cdca30b 100644 --- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubService.java +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GitHubService.java @@ -73,7 +73,6 @@ public class GitHubService { // private final static String COMMENT = "comment/"; private final static String ADD_LABEL = "label/add/"; // Implemented private final static String REMOVE_LABEL = "label/remove/"; // Implemented - private final static String TOKEN = "/token"; private static final String EMAILS = "emails"; @@ -96,7 +95,7 @@ public class GitHubService { */ public GitHubService setCredentials(GitHubCredentials credentials) { Credentials apiCredentials = new UsernamePasswordCredentials( - credentials.getUsername() + TOKEN, credentials.getApiToken()); + credentials.getUsername(), credentials.getPassword()); this.httpClient.getState().setCredentials(AuthScope.ANY, apiCredentials); return this; } diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositorySettingsPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositorySettingsPage.java index a6f5c801..39290cf0 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositorySettingsPage.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositorySettingsPage.java @@ -39,8 +39,6 @@ public class GitHubRepositorySettingsPage extends static final String URL = "http://github.com"; - private static final String PASS_LABEL_TEXT = "GitHub API Token:"; - /** * Populate taskRepository with repository settings. * @@ -51,7 +49,7 @@ public class GitHubRepositorySettingsPage extends super("GitHub Repository Settings", "", taskRepository); this.setHttpAuth(false); this.setNeedsAdvanced(false); - this.setNeedsAnonymousLogin(false); + this.setNeedsAnonymousLogin(true); this.setNeedsTimeZone(false); this.setNeedsHttpAuth(false); } @@ -78,10 +76,7 @@ public class GitHubRepositorySettingsPage extends repositoryUserNameEditor.setLabelText("GitHub " + text); } - // Use the password field for the API Token Key - if (repositoryPasswordEditor != null) { - repositoryPasswordEditor.setLabelText(PASS_LABEL_TEXT); - } + this.setAnonymous(false); } @Override |
