package com.perforce.workshop.tjuricek.p4oauth.controllers; /** * The bean we turn into json for the response from a successful call to the * AccessTokenPost controller. */ public class AccessTokenResponse { private String access_token; private String token_type = "bearer"; private String perforce_token; public static AccessTokenResponse create(String accessToken, String p4dToken) { AccessTokenResponse response = new AccessTokenResponse(); response.setAccess_token(accessToken); response.setPerforce_token(p4dToken); return response; } public String getAccess_token() { return access_token; } public void setAccess_token(String access_token) { this.access_token = access_token; } public String getToken_type() { return token_type; } public void setToken_type(String token_type) { this.token_type = token_type; } public String getPerforce_token() { return perforce_token; } public void setPerforce_token(String perforce_token) { this.perforce_token = perforce_token; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AccessTokenResponse that = (AccessTokenResponse) o; if (access_token != null ? !access_token.equals(that.access_token) : that.access_token != null) return false; if (perforce_token != null ? !perforce_token.equals(that.perforce_token) : that.perforce_token != null) return false; if (token_type != null ? !token_type.equals(that.token_type) : that.token_type != null) return false; return true; } @Override public int hashCode() { int result = access_token != null ? access_token.hashCode() : 0; result = 31 * result + (token_type != null ? token_type.hashCode() : 0); result = 31 * result + (perforce_token != null ? perforce_token.hashCode() : 0); return result; } @Override public String toString() { return "AccessTokenResponse{" + "access_token='" + access_token + '\'' + ", token_type='" + token_type + '\'' + ", perforce_token='" + perforce_token + '\'' + '}'; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 9095 | tjuricek | Added some basic test data and renamed "workspace" to "workshop" in package name | ||
//guest/tjuricek/p4oauth/src/main/java/com/perforce/workspace/tjuricek/p4oauth/controllers/AccessTokenResponse.java | |||||
#1 | 9089 | tjuricek |
Moving some code that worked via some manual validation to the workshop. This just implements a basic code authorization grant scheme. Automated tests are forthcoming, awating some gradle plugin work that should sit outside of this project. |