Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cmd/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The auth resource file can be generated using:
#
# The connection created is permitted to perform actions based on the entitlements that
# are configured on the OAuth client and the entitlements of the user based on assigned groups and roles.
verifyctl auth -f=login.yaml
verifyctl auth -f "login.yaml"
`))
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/create/accesspolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ You can identify the entitlement required by running:
verifyctl create accesspolicy --boilerplate

# Create a accessPolicy using a YAML file.
verifyctl create -f=./accesspolicy.yaml
verifyctl create -f "accesspolicy.yaml"

# Create a accessPolicy using a JSON file.
verifyctl create -f=./accesspolicy.json`))
verifyctl create -f "accesspolicy.json"`))
)

type accessPolicyOptions struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/create/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ var (
verifyctl create apiclient --boilerplate

# Create an API client using a YAML file.
verifyctl create -f=./apiclient.yaml
verifyctl create -f "apiclient.yaml"

# Create an API client using a JSON file.
verifyctl create -f=./apiclient.json`))
verifyctl create -f "apiclient.json"`))
)

type apiClientOptions struct {
Expand Down
8 changes: 5 additions & 3 deletions pkg/cmd/create/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"io"
"os"
"strings"

"github.com/ibm-verify/verify-sdk-go/pkg/config/applications"
contextx "github.com/ibm-verify/verify-sdk-go/pkg/core/context"
Expand Down Expand Up @@ -36,7 +37,7 @@ var (
verifyctl create application --boilerplate

# Create an application using a YAML file.
verifyctl create -f=./application.yaml`))
verifyctl create -f "application.yaml"`))
)

type applicationOptions struct {
Expand Down Expand Up @@ -73,7 +74,7 @@ func newApplicationCommand(config *config.CLIConfig, streams io.ReadWriter) *cob
func (o *applicationOptions) AddFlags(cmd *cobra.Command) {
o.addCommonFlags(cmd, applicationResourceName)
cmd.Flags().StringVarP(&o.file, "file", "f", "", i18n.Translate("Path to the yaml file containing application data"))
cmd.Flags().StringVarP(&o.applicationType, "applicationType", "t", "", i18n.Translate("Application type [OIDC, ACLC, SAML, BOOKMARK]"))
cmd.Flags().StringVarP(&o.applicationType, "applicationType", "t", "", i18n.Translate("Application type [oidc, aclc, saml, bookmark]"))
}

func (o *applicationOptions) Complete(cmd *cobra.Command, args []string) error {
Expand All @@ -93,6 +94,7 @@ func (o *applicationOptions) Validate(cmd *cobra.Command, args []string) error {
}

func (o *applicationOptions) Run(cmd *cobra.Command, args []string) error {
o.applicationType = strings.ToLower(o.applicationType)
if o.entitlements {
cmdutil.WriteString(cmd, entitlementsMessage+" "+applicationEntitlements)
return nil
Expand All @@ -101,7 +103,7 @@ func (o *applicationOptions) Run(cmd *cobra.Command, args []string) error {
if o.boilerplate {
if o.applicationType == "saml" || o.applicationType == "oidc" || o.applicationType == "aclc" || o.applicationType == "bookmark" || o.applicationType == "" {
resourceObj := &resource.ResourceObject{
Kind: resource.ResourceTypePrefix + "Applications",
Kind: resource.ResourceTypePrefix + "Application",
APIVersion: "1.0",
Data: applications.ApplicationExample(o.applicationType),
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/create/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You can identify the entitlement required by running:
verifyctl create attribute --boilerplate

# Create an attribute using the API model in JSON format.
verifyctl create -f=./customEmail.json`))
verifyctl create -f "customEmail.json"`))
)

type attributeOptions struct {
Expand Down
9 changes: 3 additions & 6 deletions pkg/cmd/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

const (
usage = "create -f=FILENAME [options]"
usage = "create -f FILENAME"
messagePrefix = "Create"
)

Expand Down Expand Up @@ -44,10 +44,7 @@ Certain resources may offer additional options and can be determined using:

examples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Create an application
verifyctl create -f=./app-1098012.json`))

// # Create and get an attribute
// verifyctl create -f=./attribute.yml -o=yaml
verifyctl create -f "app.json"`))

entitlementsMessage = i18n.Translate("Choose any of the following entitlements to configure your application or API client:\n")
)
Expand Down Expand Up @@ -165,7 +162,7 @@ func (o *options) Run(cmd *cobra.Command, args []string) error {
options := &apiClientOptions{}
err = options.createAPIClientFromDataMap(cmd, resourceObject.Data.(map[string]interface{}))

case resource.ResourceTypePrefix + "Applications":
case resource.ResourceTypePrefix + "Application":
options := &applicationOptions{}
err = options.createApplicationFromDataMap(cmd, resourceObject.Data.(map[string]interface{}))

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/create/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You can identify the entitlement required by running:
verifyctl create group --boilerplate

# Create a group using a JSON file.
verifyctl create -f=./group.json`))
verifyctl create -f "group.json"`))
)

type groupOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/create/identity_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var (
verifyctl create identityagent --boilerplate

# Create an Identity Agent using a JSON file.
verifyctl create identityagent -f=./identityagent.json`))
verifyctl create identityagent -f "identityagent.json"`))
)

type identityAgentOptions struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/create/identity_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ You can identify the entitlement required by running:
verifyctl create identitysource --boilerplate

# Create a identitySource using a YAML file.
verifyctl create -f=./identitysource.yaml
verifyctl create -f "identitysource.yaml"

# Create a identitySource using a JSON file.
verifyctl create -f=./identitysource.json`))
verifyctl create -f "identitysource.json"`))
)

type identitySourceOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/create/password_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ You can identify the entitlement required by running:
verifyctl create passwordpolicy --boilerplate

# Create a password policy using the API model in YAML format.
verifyctl create -f=./password_Policy.yaml`,
verifyctl create -f "password_Policy.yaml"`,
),
)
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/create/personal_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ var (
`# Create an empty personal certificate resource.
verifyctl create personalCert --boilerplate
# Create a personal certificate using a YAML file.
verifyctl create -f=./personal_cert.yaml
verifyctl create -f "personal_cert.yaml"
# Create a personal certificate using a JSON file.
verifyctl create -f=./personal_cert.json`,
verifyctl create -f "personal_cert.json"`,
),
)
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/create/signer_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ var (
`# Create an empty signer certificate resource.
verifyctl create signerCert --boilerplate
# Create a signer certificate using a YAML file.
verifyctl create -f=./signer_cert.yaml
verifyctl create -f "signer_cert.yaml"
# Create a signer certificate using a JSON file.
verifyctl create -f=./signer_cert.json`,
verifyctl create -f "signer_cert.json"`,
),
)
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/create/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ You can identify the entitlement required by running:
verifyctl create user --boilerplate

# Create a user using a YAML file.
verifyctl create -f "./user.yaml
verifyctl create -f "user.yaml"

# Create a user using a JSON file.
verifyctl create -f "./user.json"`))
verifyctl create -f "user.json"`))
)

type userOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/accesspolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You can identify the entitlement required by running:

accessPoliciesExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Delete an accessPolicy
verifyctl delete accesspolicy --ID=accesspolicyID`,
verifyctl delete accesspolicy --ID "accesspolicyID"`,
))
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/delete/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ You can identify the entitlement required by running:

apiclientExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Delete an API client by name
verifyctl delete apiclient --clientName="clientName",
verifyctl delete apiclient --clientName "clientName",

# Delete an API client by ID
verifyctl delete apiclient --clientID="12345"`,
verifyctl delete apiclient --clientID "12345"`,
))
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You can identify the entitlement required by running:

applicationExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Delete an Application
verifyctl delete application --applicationID="applicationID"`,
verifyctl delete application --applicationID "applicationID"`,
))
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (

attributeExamples = templates.Examples(cmdutil.TranslateExamples(attributeMessagePrefix, `
# Delete an attribute by ID
verifyctl delete attribute --id=some-attribute-id
verifyctl delete attribute --id "some-attribute-id"
`))
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Certain resources may offer additional options and can be determined using:
verifyctl delete [resource-type] -h`))

examples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Delete an user
verifyctl delete [resource-type] --name=userName`))
# Delete an application
verifyctl delete application --applicationID "applicationID"`))

entitlementsMessage = i18n.Translate("Choose any of the following entitlements to configure your application or API client:\n")
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You can identify the entitlement required by running:

groupsExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Delete a group
verifyctl delete group --displayName=Sales`,
verifyctl delete group --displayName "Sales"`,
))
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/identity_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ You can identify the entitlement required by running:

identityAgentExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Delete an Identity Agent by ID
verifyctl delete identityagent --identityAgentID="12345"`,
verifyctl delete identityagent --identityAgentID "12345"`,
))
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/identity_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You can identify the entitlement required by running:

identitySourcesExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Delete an identitySource
verifyctl delete identitysource --identitySourceID=identitySourceID`,
verifyctl delete identitysource --identitySource "identitySourceID"`,
))
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/password_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ verifyctl delete passwordpolicy --entitlements`))

passwordPolicyExamples = templates.Examples(cmdutil.TranslateExamples(passwordPolicyMessagePrefix, `
# Delete a password policy by passwordPolicyID
verifyctl delete passwordpolicy --passwordPolicyID=passwordPolicyID
verifyctl delete passwordpolicy --passwordPolicyID "passwordPolicyID"
`))
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/personal_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (

personalCertExamples = templates.Examples(cmdutil.TranslateExamples(personalCertMessagePrefix, `
# Delete a personal certificate by label
verifyctl delete personalCert --personalCertLabel=certificateLabel
verifyctl delete personalCert --personalCertLabel "certificateLabel"
`))
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/signer_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var (

signerCertExamples = templates.Examples(cmdutil.TranslateExamples(signerCertMessagePrefix, `
# Delete a signer certificate by label
verifyctl delete signerCert --signerCertLabel=certificateLabel
verifyctl delete signerCert --signerCertLabel "certificateLabel"
`))
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You can identify the entitlement required by running:

usersExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Delete an user
verifyctl delete user --userName=userName`,
verifyctl delete user --userName "userName"`,
))
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/get/accesspolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ You can identify the entitlement required by running:

accessPoliciesExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Get an accessPolicy and print the output in yaml
verifyctl get accesspolicy -o=yaml --ID=testAccesspolicyID
verifyctl get accesspolicy -o "yaml" --ID "testAccesspolicyID"

# Get 2 accessPolicies .
verifyctl get accesspolicies --limit=2 --page=1 -o=yaml`))
verifyctl get accesspolicies --limit 2 --page 1 -o "yaml"`))
)

type accessPoliciesOptions struct {
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/get/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ You can identify the entitlement required by running:

apiclientsExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Get an apiclient and print the output in yaml
verifyctl get apiclient -o=yaml --clientName=testApiclient
verifyctl get apiclient -o=yaml --clientID=12345
verifyctl get apiclient -o yaml --clientName "testApiclient"
verifyctl get apiclient -o yaml --clientID "12345"

# Get 2 apiclients
verifyctl get apiclients --limit=2 --page=1 -o=yaml`))
verifyctl get apiclients --limit 2 --page 1 -o "yaml"`))
)

type apiclientsOptions struct {
Expand Down
12 changes: 10 additions & 2 deletions pkg/cmd/get/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ var (

applicationExamples = templates.Examples(cmdutil.TranslateExamples(applicationsMessagePrefix, `
# Get an application and print the output in yaml
verifyctl get application -o=yaml --applicationID=testApplicationID
verifyctl get application -o=yaml --applicationID "testApplicationID"

# Get 2 applications
verifyctl get applications --limit=2 --page=1 -o=yaml`))
verifyctl get applications --limit=2 --page=1 -o=yaml

# To sort applications [To sort results, supported values are 'name' and 'applicationID'. Prepend the attribute with '+' or '-' sign for ascending and descending sorted order respectively. If not specified, sorted in ascending order on applicationID.]
verifyctl get applications --sort "-name"`))
)

type applicationsOptions struct {
Expand Down Expand Up @@ -136,6 +139,11 @@ func (o *applicationsOptions) handleSingleApplicationClient(cmd *cobra.Command,

func (o *applicationsOptions) handleApplicationClientList(cmd *cobra.Command, _ []string) error {
c := applications.NewApplicationClient()
if o.sort == "+applicationID" {
o.sort = "+entityid"
} else if o.sort == "-applicationID" {
o.sort = "-entityid"
}
appls, uri, err := c.GetApplications(cmd.Context(), o.search, o.sort, o.page, o.limit)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/get/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ You can identify the entitlement required by running:

attributesExamples = templates.Examples(cmdutil.TranslateExamples(messagePrefix, `
# Get an attribute and print the output in yaml
verifyctl get attribute -o=yaml --id=work_email
verifyctl get attribute -o "yaml" --id "work_email"

# Get 2 attributes based on a given search criteria and sort it in the ascending order by name.
verifyctl get attributes --search="tags=\"sso\"" --limit=10 --page=1 --sort=+name -o=yaml`))
verifyctl get attributes --search "tags=\"sso\"" --limit 10 --page 1 --sort "name" -o "yaml"`))
)

type attributesOptions struct {
Expand Down
Loading
Loading