Added CRUD support for API-client object#4
Merged
Conversation
vivshankar
requested changes
Apr 9, 2025
vivshankar
left a comment
Collaborator
There was a problem hiding this comment.
Please review my comments. Thanks for your contribution.
|
|
||
| if o.boilerplate { | ||
| resourceObj := &resource.ResourceObject{ | ||
| Kind: resource.ResourceTypePrefix + "ApiClient", |
Collaborator
There was a problem hiding this comment.
Please use APIClient and not ApiClient. Acronyms, such as API, should be in caps.
| config *config.CLIConfig | ||
| } | ||
|
|
||
| func NewAPIclientCommand(config *config.CLIConfig, streams io.ReadWriter) *cobra.Command { |
Collaborator
There was a problem hiding this comment.
Please correct the naming of this function. It should be NewAPIClientCommand.
|
|
||
| calledAs := cmd.CalledAs() | ||
| if calledAs == "apiclient" && o.name == "" { | ||
| return module.MakeSimpleError(i18n.Translate("'clientName' flag is required")) |
Collaborator
There was a problem hiding this comment.
Why are we not also accepting clientID? In fact that is more natural for customers than the name, in this case.
vivshankar
approved these changes
Apr 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Usage:
Commands:
Create API client:
verifyctl create -f "api_client.yaml"
Update API client:
verifyctl replace -f "api_client.yaml"
Delete API client by clientName:
verifyctl delete apiclient --clientName "Test API client"
Delete API client by clientId:
verifyctl delete apiclient --clientId "12345"
Get API client:
verifyctl get apiclient --clientName "Automation Client"
Get all API clients:
verifyctl get apiclients
Input YAML:
apiVersion: '1.0'
kind: IBMVerifyAPIClient
data:
clientName: Testing_custom_apiclient
description: Testing_custom_apiclient Description
entitlements:
- analyticsDataSyncToCloud
- analyticsSatelliteOnboard
- readCerts
- readAPIClients
- manageIdentitySources
- readIdentitySources
- manageMFAMethods
- readMFAMethods
- manageEnrollMFAMethodAnyUser
- readEnrollMFAMethodAnyUser
- authnAnyUser
- manageAuthenticatorsConfig
enabled: true
overrideSettings:
restrictScopes: true
scopes:
- name: test scope
description: scope description
ipFilterOp: allow
ipFilters:
- 1.2.3.4
jwkUri: ''
additionalConfig:
clientAuthMethod: default
validateClientAssertionJti: true
allowedClientAssertionVerificationKeys:
- string
additionalProperties:
Namespace: Namespace1