code: protected static String calculateCodeCommitPassword(URIish uri, String awsSecretKey) {
  		String[] split = uri.getHost().split("\\.");
  		if (split.length < 4) {
  			throw new CredentialException("Cannot detect AWS region from URI", null);
  		}
  		String region = split[1];
  
  		Date now = new Date();
  		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmmss");
  		dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
  
  		String dateStamp = dateFormat.format(now);
  		String shortDateStamp = dateStamp.substring(0, 8);
  
  		String codeCommitPassword;
  		try {
  			StringBuilder stringToSign = new StringBuilder();
  			stringToSign.append("AWS4-HMAC-SHA256\n").append(dateStamp).append("\n")
  					.append(shortDateStamp).append("/").append(region)
  					.append("/codecommit/aws4_request\n")
  					.append(bytesToHexString(canonicalRequestDigest(uri)));
  
  			byte[] signedRequest = sign(awsSecretKey, shortDateStamp, region,
  					stringToSign.toString());
  			codeCommitPassword = dateStamp + "Z" + bytesToHexString(signedRequest);
  		}
  		catch (Exception e) {
  			throw new CredentialException("Error calculating AWS CodeCommit password", e);
  		}
  
  		return codeCommitPassword;
  	}
docs: Calculate the AWS CodeCommit password for the provided URI and AWS secret key. This
  uses the algorithm published by AWS at
  https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
  @param uri the codecommit repository uri
  @param awsSecretKey the aws secret key
  @return the password to use in the git request