-
Notifications
You must be signed in to change notification settings - Fork 44
Conversation
@@ -323,6 +323,9 @@ async function constructRepositoryObject(url, description, name, isRepoProtected | |||
repository = await fetchRepositoryDetails(repository, gitCredentials); | |||
if (isRepoProtected !== undefined) { | |||
repository.protected = isRepoProtected; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi protected
means "this repository should not be deleted". (It doesn't mean "this repository is secure / requires authentication")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks! Do we have an alternative? Or do we only need git user/password on authenticated repos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea we only need to add the authenticated
field to the template repo object if the repo is authenticated / requires auth.
So your 'trigger' for adding the field can be just if there are gitCredentials
. (Maybe check that if the gitCredentials are invalid we will error before reaching this point)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, how does this code make the response body include authentication: {}
when gitCredentials
is the personalAccessToken?
It'd be good to see some tests with this, and an update to our openapi.yaml
:)
Signed-off-by: Edward Buckle <[email protected]>
Signed-off-by: Edward Buckle <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - Will pass the username field through if it is set.
Signed-off-by: Edward Buckle [email protected]
What type of PR is this ?
What does this PR do ?
For secure template repos, the template object will now contain a field for the user's github username, if available. If not available, the authorization object will be empty:
Which issue(s) does this PR fix ?
#3101
Link to the Codewind repository issue(s) this PR fixes or references:
Does this PR require a documentation change ?
Yes.
Any special notes for your reviewer ?
None.