Skip to content
Open
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
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.javaswift</groupId>
<artifactId>file-cli</artifactId>
<version>1.4.1</version>
<version>1.4.2</version>
<packaging>jar</packaging>
<name>JOSS File CLI</name>
<description>Command Line Interface for uploading files to the ObjectStore</description>
Expand Down Expand Up @@ -182,4 +182,4 @@
</plugins>
</reporting>

</project>
</project>
19 changes: 19 additions & 0 deletions src/main/java/org/javaswift/filecli/Arguments.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ public class Arguments {
@Parameter(names={ "--redirect" }, description="URL to which a redirect will take place after an upload")
private String redirectUrl;

@Parameter(names={ "--method" }, description="which authencition method to use [BASIC, KEYSTONE, KEYSTONE_V3, TEMPAUTH, EXTERNAL], default = BASIC")
private String method;

@Parameter(names={ "--domain" }, description="which domain to authenticate against")
private String domain;



public String getUsername() {
return username;
}
Expand Down Expand Up @@ -131,4 +139,15 @@ public int getPort() {
public String getRedirectUrl() {
return redirectUrl;
}

public String getMethod() {
if (method == null) {
return "BASIC";
}
return method;
}

public String getDomain() {
return domain;
}
}
5 changes: 4 additions & 1 deletion src/main/java/org/javaswift/filecli/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import freemarker.template.Configuration;
import freemarker.template.Template;
import org.javaswift.joss.client.factory.AccountFactory;
import org.javaswift.joss.client.factory.AuthenticationMethod;
import org.javaswift.joss.client.factory.TempUrlHashPrefixSource;
import org.javaswift.joss.model.Account;
import org.javaswift.joss.model.Container;
Expand Down Expand Up @@ -80,7 +81,7 @@ private Account createAccount(Arguments arguments) {
"tenant name "+arguments.getTenantName()+
", tenant ID "+arguments.getTenantId()+
" and usr/pwd "+arguments.getUsername()+"/"+arguments.getPassword()+"@"+arguments.getUrl());

return new AccountFactory()
.setUsername(arguments.getUsername())
.setPassword(arguments.getPassword())
Expand All @@ -90,6 +91,8 @@ private Account createAccount(Arguments arguments) {
.setTenantName(arguments.getTenantName())
.setHashPassword(arguments.getHashPassword())
.setTempUrlHashPrefixSource(TempUrlHashPrefixSource.INTERNAL_URL_PATH)
.setAuthenticationMethod(AuthenticationMethod.valueOf(arguments.getMethod()))
.setDomain(arguments.getDomain())
.createAccount();
}

Expand Down