Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for masked fields in terminal #7

Open
alechp opened this issue Sep 25, 2024 · 0 comments
Open

Add support for masked fields in terminal #7

alechp opened this issue Sep 25, 2024 · 0 comments

Comments

@alechp
Copy link
Contributor

alechp commented Sep 25, 2024

Example of what that would look like:

{
			Label:   "Setup Gitea",
			Command: "setup",
			Parameters: []gsplug.ParameterInfo{
				{Name: "username", Description: "Gitea username", Required: true},
				{Name: "password", Description: "Gitea password", Required: true, Sensitive: true}, // Added Sensitive: true
				{Name: "email", Description: "Gitea email", Required: true},
				{Name: "git_name", Description: "Name for Git commits", Required: true},
				{Name: "repo_name", Description: "Repository name", Required: true},
				{Name: "ssh_port", Description: "SSH port for Gitea (default is 22)", Required: false},
			},
		},

Relevant line:

Sensitive: true

On sdk side, would need to update this:

type MenuOption struct {
	Label      string          `json:"label"`
	Command    string          `json:"command"`
	Parameters []ParameterInfo `json:"parameters,omitempty"`
}

type ParameterInfo struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Required    bool   `json:"required"`
}

But also need to update gitspace to support processing this. Implementation on gitspace side with huh will look like this:
Screenshot 2024-09-25 at 5 32 46 AM

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

No branches or pull requests

1 participant