Skip to content

Commit

Permalink
Merge pull request #1482 from mysteriumnetwork/1033-enrich-cli-proposals
Browse files Browse the repository at this point in the history
Show service type and access policy in proposal list (CLI)
  • Loading branch information
tadaskay authored Jan 6, 2020
2 parents faf2e82 + 967975f commit 9ca791e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/commands/cli/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,12 @@ func (c *cliApp) proposals(filter string) {
country = "Unknown"
}

msg := fmt.Sprintf("- provider id: %v, proposal id: %v, country: %v", proposal.ProviderID, proposal.ID, country)
var policies []string
for _, policy := range proposal.AccessPolicies {
policies = append(policies, policy.ID)
}

msg := fmt.Sprintf("- provider id: %v\ttype: %v\tcountry: %v\taccess policies: %v", proposal.ProviderID, proposal.ServiceType, country, strings.Join(policies, ","))

if filter == "" ||
strings.Contains(proposal.ProviderID, filter) ||
Expand Down
7 changes: 7 additions & 0 deletions tequilapi/client/dto.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ type ProposalDTO struct {
ProviderID string `json:"providerId"`
ServiceType string `json:"serviceType"`
ServiceDefinition ServiceDefinitionDTO `json:"serviceDefinition"`
AccessPolicies []AccessPolicy `json:"accessPolicies"`
}

// AccessPolicy represents the access controls for proposal
type AccessPolicy struct {
ID string `json:"id"`
Source string `json:"source"`
}

func (p ProposalDTO) String() string {
Expand Down

0 comments on commit 9ca791e

Please sign in to comment.