package com.perforce.hwsclient.models; import java.util.Objects; import com.perforce.hwsclient.models.ServerLoginRequest; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.*; import com.google.gson.annotations.SerializedName; /** * Captures the login information we need for logging into either a p4d server or our \"authentication source\". **/ @ApiModel(description = "Captures the login information we need for logging into either a p4d server or our \"authentication source\".") public class LoginRequest { @SerializedName("user") private String user = null; @SerializedName("password") private String password = null; @SerializedName("serverLogins") private List<ServerLoginRequest> serverLogins = new ArrayList<ServerLoginRequest>(); /** * Usually the Perforce username **/ @ApiModelProperty(value = "Usually the Perforce username") public String getUser() { return user; } public void setUser(String user) { this.user = user; } /** **/ @ApiModelProperty(value = "") public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } /** **/ @ApiModelProperty(value = "") public List<ServerLoginRequest> getServerLogins() { return serverLogins; } public void setServerLogins(List<ServerLoginRequest> serverLogins) { this.serverLogins = serverLogins; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } LoginRequest loginRequest = (LoginRequest) o; return Objects.equals(user, loginRequest.user) && Objects.equals(password, loginRequest.password) && Objects.equals(serverLogins, loginRequest.serverLogins); } @Override public int hashCode() { return Objects.hash(user, password, serverLogins); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LoginRequest {\n"); sb.append(" user: ").append(toIndentedString(user)).append("\n"); sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" serverLogins: ").append(toIndentedString(serverLogins)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 19634 | swellard | Swagger codegen - fix equals | ||
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/java/src/main/java/com/perforce/hwsclient/models/LoginRequest.java | |||||
#1 | 19535 | drobins | Refactor package names to hws | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/java/src/main/java/com/perforce/helix_web_services_client/models/LoginRequest.java | |||||
#2 | 19002 | tjuricek |
Improve API to interact with multiple p4ds. The configuration now requires an explicit setting of what P4Ds HWS can talk to via the 'P4D config dir', where there's a file indicating connection settings per p4d, and importantly, an ID. This is the "server ID" referenced everywhere. Most methods now require a server ID to indicate which p4d to manipulate. In the future, it's likely we will interact with *multiple* p4d instances on some services. This completely removes the ability to run HWS as a kind of an "open proxy" to whatever p4d you want. Given the nature of the change and the lack of priority, we've removed Helix Cloud testing and disabled several methods from their "Helix Cloud" implementation. These will be relatively easy to bring back, we'll just need a new method from Raymond that lists the "allowed server IDs" that map to the HWS configured server IDs for a particular user. Another notable aspect of this change is the use of JSON Web Token to create our authentication key. We associate this key with an in-memory "session" that contains the P4D tickets we use to authenticate users. The JWT token, by default, is assigned a timeout, which allows HWS to block further access to underlying servers without having to interact with multiple auth backends. If any backend fails with that session, the user will get a 403. If you disable the timeout, you'll need to ensure your clients clear out sessions. |
||
#1 | 18795 | tjuricek | Use point-release versioning for the client SDKs and installers. | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1/java/src/main/java/com/perforce/helix_web_services_client/models/LoginRequest.java | |||||
#2 | 18746 | tjuricek | Convert protections-related models, along with updating documentation around login and projects. | ||
#1 | 18727 | tjuricek | Convert the status method to be part of the documented API, and convert the login-related models. |