@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); hashCode = prime * hashCode + ((getAccessKeyId() == null) ? 0 : getAccessKeyId().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getSecretAccessKey() == null) ? 0 : getSecretAccessKey().hashCode()); hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); return hashCode; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getUserName() != null) sb.append("UserName: ").append(getUserName()).append(","); if (getAccessKeyId() != null) sb.append("AccessKeyId: ").append(getAccessKeyId()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getSecretAccessKey() != null) sb.append("SecretAccessKey: ").append("***Sensitive Data Redacted***").append(","); if (getCreateDate() != null) sb.append("CreateDate: ").append(getCreateDate()); sb.append("}"); return sb.toString(); }
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getSecretAccessKey() == null ^ this.getSecretAccessKey() == null) return false; if (other.getSecretAccessKey() != null && other.getSecretAccessKey().equals(this.getSecretAccessKey()) == false) return false; if (other.getCreateDate() == null ^ this.getCreateDate() == null)
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); hashCode = prime * hashCode + ((getAccessKeyId() == null) ? 0 : getAccessKeyId().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getSecretAccessKey() == null) ? 0 : getSecretAccessKey().hashCode()); hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); return hashCode; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getUserName() != null) sb.append("UserName: ").append(getUserName()).append(","); if (getAccessKeyId() != null) sb.append("AccessKeyId: ").append(getAccessKeyId()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getSecretAccessKey() != null) sb.append("SecretAccessKey: ").append("***Sensitive Data Redacted***").append(","); if (getCreateDate() != null) sb.append("CreateDate: ").append(getCreateDate()); sb.append("}"); return sb.toString(); }
private static AWSCredentials createIamAccessKey(AmazonIdentityManagementClient iamClient, String username) { CreateAccessKeyResult accessKeyResult = iamClient.createAccessKey(new CreateAccessKeyRequest().withUserName(username)); AccessKey accessKey = accessKeyResult.getAccessKey(); return new BasicAWSCredentials(accessKey.getAccessKeyId(), accessKey.getSecretAccessKey()); }
private static AWSCredentials createIamAccessKey(AmazonIdentityManagementClient iamClient, String username) { CreateAccessKeyResult accessKeyResult = iamClient.createAccessKey(new CreateAccessKeyRequest().withUserName(username)); AccessKey accessKey = accessKeyResult.getAccessKey(); return new BasicAWSCredentials(accessKey.getAccessKeyId(), accessKey.getSecretAccessKey()); }
private static AWSCredentials createIamAccessKey(AmazonIdentityManagementClient iamClient, String username) { CreateAccessKeyResult accessKeyResult = iamClient.createAccessKey(new CreateAccessKeyRequest().withUserName(username)); AccessKey accessKey = accessKeyResult.getAccessKey(); return new BasicAWSCredentials(accessKey.getAccessKeyId(), accessKey.getSecretAccessKey()); }
private void createAccessKey(Name name, String userName, List<String> keys) { AccessKey accessKey = iam_.createAccessKey(new CreateAccessKeyRequest() .withUserName(userName)).getAccessKey(); // secret.println("#######################################################"); // secret.println("# SAVE THIS ACCESS KEY IN ~/.aws/credentials"); // secret.println("#######################################################"); // secret.format("[%s]%n", userName); // secret.format("aws_access_key_id = %s%n", accessKey.getAccessKeyId()); // secret.format("aws_secret_access_key = %s%n", accessKey.getSecretAccessKey()); // secret.println("#######################################################"); String accessKeyJson = " \"" + name + "\": {\n" + " \"accessKeyId\": \"" + accessKey.getAccessKeyId() + "\",\n" + " \"secretAccessKey\": \"" + accessKey.getSecretAccessKey() + "\"\n" + " }"; keys.add(accessKeyJson); }
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getSecretAccessKey() == null ^ this.getSecretAccessKey() == null) return false; if (other.getSecretAccessKey() != null && other.getSecretAccessKey().equals(this.getSecretAccessKey()) == false) return false; if (other.getCreateDate() == null ^ this.getCreateDate() == null)
System.out.format("[%s]%n", userName_); System.out.format("aws_access_key_id = %s%n", accessKey.getAccessKeyId()); System.out.format("aws_secret_access_key = %s%n", accessKey.getSecretAccessKey()); System.out.println("#######################################################"); out.format("aws_secret_access_key = %s%n", accessKey.getSecretAccessKey());
id, key.getAccessKey().getSecretAccessKey());