Hey,
TL;DR : how to have the plugin auto guess the correct URI for AWS CodeCommit. bottom line questions are at the very bottom.
I'm trying to get the URL thingy working for an AWS CodeCommit repository.
There's multiple way to clone such repository :
I used HTTPS.
There's multiple ways to authenticate to the git repository for checking out :
- Specific "https" credentials bound to that usage
- SSH key configured for that
- a git helper provided by AWS whom relies on other classic AWS authentication methods.
I use the later, but I'm unsure if this is important to the use of this extension.
When cloning a repository via HTTPS, regardless of the authentication method, we get an URI like this : https://git-codecommit.[AWS_REGION].amazonaws.com/v1/repos/[REPONAME]
This extension uses this URI by default to construct the link for viewing : I believe this URI cannot be used via a browser to browse the repository. I tried to authenticate with credentials fetched from the aws-cli helper, with no success :
$ echo 'protocol=https
host=eu-west-1.console.aws.amazon.com
path=codesuite/codecommit/repositories/[REPONAME]' | aws codecommit --profile [AWS_PROFILE] --region eu-west-1 credential-helper get
This returns a username & password that I used to access :
All of these URI yield :
<AccessDeniedException>
<Message>Invalid request</Message>
</AccessDeniedException>
From the AWS Console, the browsing URI to see a commit details would be https://[AWS_REGION].console.aws.amazon.com/codesuite/codecommit/repositories/[REPONAME]/commit/[COMMITID]?region=[AWS_REGION]
(I'm not sure about the usefulness of this last AWS_REGION, as removing it let stuff working).
I have read the README about constructing a custom URI with the help of variables, an I can make one work for me : https://eu-west-1.console.aws.amazon.com/codesuite/codecommit/repositories/${project.name}/commit/${hash}
, but this assumes all repository will be in eu-west-1
- How could the region could be parsed / obtained to fill in the URI ?
- How could we have the plugin "guess" this correctly ?