Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Augment template source list: include if authenticated, username if available #3101

Open
eharris369 opened this issue Jun 4, 2020 · 5 comments

Comments

@eharris369
Copy link

Further requirement for #2647

Include the username in the template source list if available, similar to how it is included in the cwctl connections list output. This way the user does not need to re-type in their username if they are updating the password.

@eharris369
Copy link
Author

eharris369 commented Jun 4, 2020

@rwalle61 I think including whether the template source has authentication in the template source list is useful too. I want to have an edit template source wizard and I need to know when to include the authentication page and when not to. I can open a separate issue if you prefer. It might also be useful to the user if it shows in the template source table in the IDE which template sources are authenticated and which are not.

@eharris369 eharris369 changed the title Template source list: include username if available Augment template source list: include if authenticated, username if available Jun 4, 2020
@rwalle61
Copy link
Contributor

rwalle61 commented Jun 9, 2020

FYI whoever picks this up:

The current output from cwctl templates repos list (and cwctl templates repos add) is something like:

{
		"description": "Use Appsody in Codewind to develop applications with sharable technology stacks.",
		"url": "https://github.com/appsody/stacks/releases/latest/download/incubator-index.json",
		"name": "Appsody Stacks - incubator",
		"id": "incubator",
		"enabled": true,
		"protected": true,
		"projectStyles": [
			"Appsody"
		]
	},
	{
		"description": "The default set of templates for new projects in Codewind.",
		"url": "https://raw.github.ibm.com/Richard-Waller/sampleGHETemplateRepo/master/devfiles/index.json",
		"name": "Default templates",
		"id": "fd36a0bc-7a2b-544f-a999-fbe0ce9e5ebb",
		"enabled": true,
		"protected": false,
		"projectStyles": [
			"Codewind"
		]
	}

@eharris369 is suggesting PFE return the username for any secure template repos (such as the GHE one). So something like:

{
		"description": "The default set of templates for new projects in Codewind.",
		"url": "https://raw.github.ibm.com/Richard-Waller/sampleGHETemplateRepo/master/devfiles/index.json",
		"name": "Default templates",
		"id": "fd36a0bc-7a2b-544f-a999-fbe0ce9e5ebb",
		"enabled": true,
		"protected": false,
		"projectStyles": [
			"Codewind"
		],
                "authentication: {
                       username: richard.waller@ibm.com
                       required: true // do we need this field?
                }
	}

@eharris369 would the IDEs like an authentication field on all template repos, or just the secure template repos?

Bear in mind that currently someone can add secure template repos using cwctl templates repos add with just --personalAccessToken to , so PFE won't know the username in those cases.

@ebuckle
Copy link
Contributor

ebuckle commented Jun 9, 2020

/assign

@eharris369
Copy link
Author

eharris369 commented Jun 9, 2020

It only needs to be there on secure template repos. If the authentication is only there on secure template repos then the required field is not needed, as long as it is ok to have an empty authentication object when the user is using an access token instead of username and password (or username is null).

@eharris369
Copy link
Author

I noticed that the authentication object is showing up for repos that are not authenticated.

        {
                "description": "Use Appsody in Codewind to develop applications with sharable technology stacks.",
                "url": "https://github.com/appsody/stacks/releases/latest/download/incubator-index.json",
                "name": "Appsody Stacks - incubator",
                "id": "incubator",
                "enabled": true,
                "protected": true,
                "projectStyles": [
                        "Appsody"
                ],
                "authentication": {}
        }

So there is no difference between this and a template source that is authenticated using an access token:

        {
                "description": "My set of templates for new projects in Codewind.",
                "url": "https://raw.github.ibm.com/eharris/test-repo/master/devfiles/index.json",
                "name": "My default templates",
                "id": "4bdbf971-c4f8-537f-af17-6e5778ffe330",
                "enabled": true,
                "protected": false,
                "projectStyles": [
                        "Codewind"
                ],
                "authentication": {}
        }

The IDEs need to be able to tell the difference. So either the authentication object should not show up on repos that don't need authentication or there should be a flag in the object to indicate if authentication is required or not.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants